Skip to content

Commit d90d55a

Browse files
author
bfintal@gmail.com
committed
updated tours
1 parent e5a3c7f commit d90d55a

7 files changed

Lines changed: 503 additions & 258 deletions

File tree

src/lazy-components/modal-tour/tours/advanced-hover-states.js

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export const advancedHoverStates = {
5656
},
5757
steps: [
5858
{
59-
title: __( 'Styling Containers with Hover Styles', i18n ),
59+
title: __( 'Advnaced Hover State Styling', i18n ),
6060
description: createInterpolateElement(
61-
__( 'Styling the container with hover styles is a great way to add interactivity to your designs. Click the <strong>hover toggle</strong> next to <strong>Background Color</strong> to start.', i18n ),
61+
__( 'Learn how to style containers and their contents together by applying hover effects to multiple blocks at once.', i18n ),
6262
{ strong: <strong /> }
6363
),
6464
help: createInterpolateElement( __( 'Click the <strong>hover toggle</strong> next to <strong>Background Color</strong> to start.', i18n ), {
@@ -82,12 +82,12 @@ export const advancedHoverStates = {
8282
{
8383
title: __( 'Selecting the Hover State', i18n ),
8484
description: createInterpolateElement(
85-
__( 'Now select the <strong>hover button</strong>. This lets you adjust how the container will look when hovered.', i18n ),
85+
__( 'Now select the <strong>Hovered State</strong> button. This lets you adjust how the container will look when hovered.', i18n ),
8686
{ strong: <strong /> }
8787
),
88-
anchor: '.stk-control:has([data-attribute="containerBackgroundColor"]) .stk-label-unit-toggle__wrapper',
88+
anchor: '.stk-control:has([data-attribute="containerBackgroundColor"]) .stk-label-unit-toggle__wrapper button[data-value="hover"]',
8989
position: 'left',
90-
glowTarget: '.stk-control:has([data-attribute="containerBackgroundColor"]) .stk-label-unit-toggle__wrapper',
90+
glowTarget: '.stk-control:has([data-attribute="containerBackgroundColor"]) .stk-label-unit-toggle__wrapper button[data-value="hover"]',
9191
nextEventTarget: '.stk-control:has([data-attribute="containerBackgroundColor"]) .stk-label-unit-toggle__wrapper button:not(.is-active)[data-value="hover"]',
9292
nextEvent: 'mousedown',
9393
preStep: () => {
@@ -98,9 +98,9 @@ export const advancedHoverStates = {
9898
},
9999
},
100100
{
101-
title: __( 'Adjusting the Background Color on Hover', i18n ),
101+
title: __( 'Hover Background Color', i18n ),
102102
description: createInterpolateElement(
103-
__( 'The controls now affect the <strong>Hover</strong> state only. Try adjusting the <strong>Background Color</strong> value and see how the preview changes when hovered.', i18n ),
103+
__( 'The controls now affect the <strong>Hover</strong> state only. Let\'s try adjusting the <strong>Background Color</strong> to black.', i18n ),
104104
{ strong: <strong /> }
105105
),
106106
help: createInterpolateElement( __( 'Click on <strong>Background Color</strong> to open the color picker and select a color.', i18n ), {
@@ -118,13 +118,14 @@ export const advancedHoverStates = {
118118
},
119119
},
120120
{
121-
title: __( 'Pick a Color', i18n ),
122-
description: __( 'Select a color from the palette to apply it.', i18n ),
121+
title: __( 'Pick a Dark Color', i18n ),
122+
description: __( 'Select a black or another dark color from the palette to apply it to the hovered state of this container.', i18n ),
123123
anchor: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
124124
position: 'left',
125+
help: createInterpolateElement( __( 'Click next to continue.', i18n ), {
126+
strong: <strong />,
127+
} ),
125128
glowTarget: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
126-
nextEvent: 'mousedown',
127-
nextEventTarget: '.stk-color-palette-control__popover-content *',
128129
postStep: () => {
129130
const allBlocks = select( 'core/block-editor' ).getBlocks()
130131
const columnsBlock = allBlocks.find( block => block.name === 'stackable/columns' )
@@ -138,9 +139,9 @@ export const advancedHoverStates = {
138139
},
139140
},
140141
{
141-
title: __( 'Preview Your Hover Effect', i18n ),
142-
description: __( 'Now the background will turn dark when your mouse hovers over the container, however the text is now hard to read, let\'s change it.', i18n ),
143-
help: createInterpolateElement( __( 'Select the <strong>Heading Block</strong> to continue.', i18n ), {
142+
title: __( 'Text is Now Unreadable', i18n ),
143+
description: __( 'On hover, the background will now be black, but now we cannot read the Heading text properly! Let\'s change it!', i18n ),
144+
help: createInterpolateElement( __( 'Select the <strong>Heading Block</strong> and click next to continue.', i18n ), {
144145
strong: <strong />,
145146
} ),
146147
offsetX: '300px',
@@ -153,8 +154,8 @@ export const advancedHoverStates = {
153154
},
154155
},
155156
{
156-
title: __( 'Selecting the Parent Container Hover State', i18n ),
157-
description: createInterpolateElement( __( 'Now select the <strong>parent container hover state</strong>. This lets you adjust how the heading text will look when the parent container is hovered.', i18n ), {
157+
title: __( 'Parent Hovered State', i18n ),
158+
description: createInterpolateElement( __( 'Now select the <strong>Parent Container Hover State</strong>. This lets you adjust how the heading text will look when the parent container is hovered.', i18n ), {
158159
strong: <strong />,
159160
} ),
160161
help: createInterpolateElement( __( 'Select the <strong>parent container hover state</strong> to continue.', i18n ), {
@@ -164,6 +165,7 @@ export const advancedHoverStates = {
164165
position: 'left',
165166
glowTarget: '.stk-control:has([data-attribute="textColor1"]) .stk-label-unit-toggle__wrapper button[data-value="parent-hover"]',
166167
nextEventTarget: '.stk-control:has([data-attribute="textColor1"]) .stk-label-unit-toggle__wrapper button:not(.is-active)[data-value="parent-hover"]',
168+
nextEvent: 'mousedown',
167169
modalDelay: 150,
168170
preStep: () => {
169171
setTimeout( () => {
@@ -187,7 +189,7 @@ export const advancedHoverStates = {
187189
},
188190
},
189191
{
190-
title: __( 'Selecting the Heading Color', i18n ),
192+
title: __( 'Heading Color', i18n ),
191193
description: createInterpolateElement( __( 'Now select the <strong>heading color</strong> to open the color picker.', i18n ), {
192194
strong: <strong />,
193195
} ),
@@ -210,13 +212,14 @@ export const advancedHoverStates = {
210212
},
211213
},
212214
{
213-
title: __( 'Pick a Text Color', i18n ),
214-
description: __( 'Select a text color from the palette to apply it.', i18n ),
215+
title: __( 'Make the Heading White', i18n ),
216+
description: __( 'Select white from the palette to apply it to the hovered state of the heading text.', i18n ),
217+
help: createInterpolateElement( __( 'Click next to continue.', i18n ), {
218+
strong: <strong />,
219+
} ),
215220
anchor: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
216221
position: 'left',
217222
glowTarget: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
218-
nextEvent: 'mousedown',
219-
nextEventTarget: '.stk-color-palette-control__popover-content *',
220223
postStep: () => {
221224
const allBlocks = select( 'core/block-editor' ).getBlocks()
222225
const columnsBlock = allBlocks.find( block => block.name === 'stackable/columns' )
@@ -230,23 +233,11 @@ export const advancedHoverStates = {
230233
},
231234
},
232235
{
233-
title: __( 'Heading Block is Now Readable', i18n ),
234-
description: __( 'Now the heading block is readable when your mouse hovers over the container. Let\'s do the same for the text color in the text block.', i18n ),
235-
offsetX: '300px',
236-
postStep: () => {
237-
const allBlocks = select( 'core/block-editor' ).getBlocks()
238-
const columnsBlock = allBlocks.find( block => block.name === 'stackable/columns' )
239-
if ( columnsBlock?.innerBlocks?.[ 0 ]?.innerBlocks?.[ 1 ] ) {
240-
dispatch( 'core/block-editor' ).selectBlock( columnsBlock.innerBlocks[ 0 ].innerBlocks[ 1 ].clientId )
241-
}
242-
},
243-
},
244-
{
245-
title: __( 'Selecting the Text Color for Parent Hover State', i18n ),
246-
description: createInterpolateElement( __( 'Now select the <strong>parent container hover state</strong>. This lets you adjust how the text block will look when the parent container is hovered.', i18n ), {
236+
title: __( 'Text Color', i18n ),
237+
description: createInterpolateElement( __( 'Now that\'s better! Let\'s do the same for the text block.', i18n ), {
247238
strong: <strong />,
248239
} ),
249-
help: createInterpolateElement( __( 'Select the <strong>parent container hover state</strong> to continue.', i18n ), {
240+
help: createInterpolateElement( __( 'Select the <strong>text color</strong> to open the color picker.', i18n ), {
250241
strong: <strong />,
251242
} ),
252243
anchor: '.stk-control:has([data-attribute="textColor1"])',
@@ -256,6 +247,12 @@ export const advancedHoverStates = {
256247
modalDelay: 150,
257248
preStep: () => {
258249
setTimeout( () => {
250+
const allBlocks = select( 'core/block-editor' ).getBlocks()
251+
const columnsBlock = allBlocks.find( block => block.name === 'stackable/columns' )
252+
if ( columnsBlock?.innerBlocks?.[ 0 ]?.innerBlocks?.[ 1 ] ) {
253+
dispatch( 'core/block-editor' ).selectBlock( columnsBlock.innerBlocks[ 0 ].innerBlocks[ 1 ].clientId )
254+
}
255+
259256
const targetElTop = document.querySelector( '.stk-control:has([data-attribute="textColor1"])' )?.getBoundingClientRect()?.top
260257
const editorSidebar = document.querySelector( '.editor-sidebar.ugb--has-panel-tabs' )
261258

@@ -272,13 +269,14 @@ export const advancedHoverStates = {
272269
},
273270
},
274271
{
275-
title: __( 'Pick a Text Color', i18n ),
276-
description: __( 'Select a text color from the palette to apply it.', i18n ),
272+
title: __( 'Make the Text White', i18n ),
273+
description: __( 'With the Text block now selected, pick white from the palette to apply it to the hovered state of the text block.', i18n ),
274+
help: createInterpolateElement( __( 'Click next to continue.', i18n ), {
275+
strong: <strong />,
276+
} ),
277277
anchor: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
278278
position: 'left',
279279
glowTarget: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
280-
nextEvent: 'mousedown',
281-
nextEventTarget: '.stk-color-palette-control__popover-content *',
282280
postStep: () => {
283281
const allBlocks = select( 'core/block-editor' ).getBlocks()
284282
const columnsBlock = allBlocks.find( block => block.name === 'stackable/columns' )
@@ -292,16 +290,14 @@ export const advancedHoverStates = {
292290
},
293291
},
294292
{
295-
title: __( 'Text Block is also now readable', i18n ),
296-
description: __( 'Now the text block is also readable when your mouse hovers over the container.', i18n ),
297-
offsetX: '300px',
298-
},
299-
{
300-
title: __( 'Return to Normal State', i18n ),
293+
title: __( 'Back to Normal State', i18n ),
301294
description: createInterpolateElement(
302-
__( 'Switch back to the normal state by clicking the <strong>cursor icon</strong> to test the hover states in action.', i18n ),
295+
__( 'Our block looks good! Now let\'s switch back to the normal state by clicking the <strong>Normal State</strong> button.', i18n ),
303296
{ strong: <strong /> }
304297
),
298+
help: createInterpolateElement( __( 'You can also de-select the block to return to the normal state.', i18n ), {
299+
strong: <strong />,
300+
} ),
305301
anchor: '.stk-control:has([data-attribute="textColor1"]) .stk-label-unit-toggle__wrapper button[data-value="normal"]',
306302
position: 'left',
307303
glowTarget: '.stk-control:has([data-attribute="textColor1"]) .stk-label-unit-toggle__wrapper button[data-value="normal"]',
@@ -318,22 +314,24 @@ export const advancedHoverStates = {
318314
},
319315
},
320316
{
321-
title: __( 'Back on Normal State', i18n ),
317+
title: __( 'We\'re Done!', i18n ),
322318
description: createInterpolateElement(
323-
__( 'You are now back on the <strong>normal</strong> state. You can now test the hover states in action.', i18n ),
319+
__( 'You are now seeing the block in its <strong>normal</strong> state. Hover over the block to see the hover states in action.', i18n ),
324320
{ strong: <strong /> }
325321
),
322+
help: createInterpolateElement( __( 'Hover your mouse over the block and see it switch live.', i18n ), {
323+
strong: <strong />,
324+
} ),
326325
offsetX: '300px',
327326
},
328327
{
329-
title: __( 'Prop Tip: The Levels of Hover States', i18n ),
328+
title: __( 'Pro Tip: Different Hover States', i18n ),
330329
description: createInterpolateElement(
331-
__( 'There are <strong>three levels of hover states</strong> you can style: <ul><li><strong>Normal State</strong>: when the mouse is not over any block</li><li><strong>Container Hover</strong>: when the mouse is hovering over a container</li><li><strong>Block Hover</strong>: when the mouse is directly over a block</li></ul>With Stackable, you can customize the appearance for all these states, making your designs more interactive and visually appealing.', i18n ),
330+
__( 'There are <strong>three levels of hover states</strong> you can style: <ul><li><strong>Normal State</strong>: when the mouse is not over any block</li><li><strong>Block Hover</strong>: when the mouse is directly over a block</li><li><strong>Container Hover</strong>: when the mouse is hovering over a container</li></ul>You can customize the appearance for all these states, making your designs more interactive and visually appealing.', i18n ),
332331
{
333332
strong: <strong />, ul: <ul />, li: <li />,
334333
}
335334
),
336-
offsetX: '300px',
337335
},
338336
],
339337
}

src/lazy-components/modal-tour/tours/block-backgrounds.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ export const blockBackgrounds = {
149149
{
150150
title: __( 'Pick Your Brand Color', i18n ),
151151
description: __( 'Select a color that matches your brand or mood. Try out different colors and instantly see the changes on your block.', i18n ),
152-
help: createInterpolateElement( __( 'Choose a <strong>Color</strong> from the palette to apply it.', i18n ), {
152+
help: createInterpolateElement( __( 'Choose a <strong>Color</strong> from the palette to apply it, click next when done.', i18n ), {
153153
strong: <strong />,
154154
} ),
155155
anchor: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
156156
position: 'left',
157157
glowTarget: '.components-popover__content:has(.stk-color-palette-control__popover-content)',
158-
nextEvent: 'mousedown',
159-
nextEventTarget: '.stk-color-palette-control__popover-content *',
158+
// nextEvent: 'mousedown',
159+
// nextEventTarget: '.stk-color-palette-control__popover-content *',
160160
postStep: () => {
161161
// Click the color picker
162162
document.querySelector( '.ugb-block-background-panel .stk-color-palette-control .block-editor-panel-color-gradient-settings__dropdown.is-open' )?.click()

src/lazy-components/modal-tour/tours/hover-states.js

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ export const hoverStates = {
3535
{
3636
title: __( 'Using the Hover Effect Controls', i18n ),
3737
description: createInterpolateElement(
38-
__( 'Locate the <strong>hover toggle</strong> next to <strong> Zoom</strong>. Click it to show the different hover state options.', i18n ),
38+
__( 'Block options with a <strong>hover toggle</strong> on them can be adjusted for different hover states.', i18n ),
3939
{ strong: <strong /> }
4040
),
41+
help: createInterpolateElement( __( 'Click the <strong>hover toggle</strong> beside <strong> Zoom</strong> to open the hover state options.', i18n ), {
42+
strong: <strong />,
43+
} ),
4144
anchor: '.stk-control:has([data-attribute="imageZoom"])',
4245
position: 'left',
4346
glowTarget: '.stk-control:has([data-attribute="imageZoom"]) .stk-control-label button[data-value="normal"]',
@@ -52,12 +55,15 @@ export const hoverStates = {
5255
{
5356
title: __( 'Different Hover States', i18n ),
5457
description: createInterpolateElement(
55-
__( 'Now select the <strong>hover button</strong>. This lets you adjust how the image will look when hovered.', i18n ),
58+
__( 'Now select the <strong>Hovered State button</strong>. This lets you adjust how the image will look when hovered.', i18n ),
5659
{ strong: <strong /> }
5760
),
61+
help: createInterpolateElement( __( 'Click the <strong>Second button from the list</strong> to toggle this hover state.', i18n ), {
62+
strong: <strong />,
63+
} ),
5864
anchor: '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper',
5965
position: 'left',
60-
glowTarget: '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper',
66+
glowTarget: '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper button[data-value="hover"]',
6167
nextEventTarget: '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper button:not(.is-active)[data-value="hover"]',
6268
nextEvent: 'mousedown',
6369
preStep: () => {
@@ -73,6 +79,9 @@ export const hoverStates = {
7379
__( 'The controls now affect the <strong>Hover</strong> state only. Try adjusting the <strong>Image Zoom</strong> value and see how the preview changes when hovered.', i18n ),
7480
{ strong: <strong /> }
7581
),
82+
help: createInterpolateElement( __( 'Pick a zoom value of <strong>1.2</strong> to see the hover effect then click on next.', i18n ), {
83+
strong: <strong />,
84+
} ),
7685
anchor: '.stk-control:has([data-attribute="imageZoom"])',
7786
position: 'left',
7887
glowTarget: '.stk-control:has([data-attribute="imageZoom"]) .stk-control-content',
@@ -85,17 +94,18 @@ export const hoverStates = {
8594
const imageBlock = allBlocks.find( block => block.name === 'stackable/image' )
8695
if ( imageBlock && ! imageBlock.attributes?.imageZoomHover ) {
8796
dispatch( 'core/block-editor' ).updateBlockAttributes( imageBlock.clientId, {
88-
imageZoomHover: 1.5,
97+
imageZoomHover: 1.2,
8998
} )
9099
}
91100
},
92101
},
93102
{
94-
title: __( 'Preview Your Hover Effect', i18n ),
103+
title: __( 'Hover State Preview', i18n ),
95104
description: createInterpolateElement(
96-
__( 'The image on the canvas is now showing your <strong>new hover zoom effect</strong>. No need to hover—this view already reflects the hover state.', i18n ),
105+
__( 'Notice that the image block is now zoomed in. Any changes you make to the block will be reflected in the hover state only.', i18n ),
97106
{ strong: <strong /> }
98107
),
108+
help: __( 'Click next to continue.', i18n ),
99109
offsetX: '300px',
100110
},
101111
{
@@ -122,20 +132,31 @@ export const hoverStates = {
122132
{
123133
title: __( 'Back on Normal State', i18n ),
124134
description: createInterpolateElement(
125-
__( 'You are now back on the <strong>normal</strong> state. Notice the hover toggle is <strong>yellow</strong> - that means a custom hover effect has been saved!', i18n ),
135+
__( 'You are now back on the <strong>normal</strong> state. Notice the hover toggle is <strong>yellow</strong>, this means there is a value set for the hover state!', i18n ),
126136
{ strong: <strong /> }
127137
),
128-
anchor: '.stk-control:has([data-attribute="imageZoom"]) .stk-control-label button',
138+
anchor: '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle',
129139
position: 'left',
130-
glowTarget: '.stk-control:has([data-attribute="imageZoom"]) .stk-control-label button',
140+
glowTarget: '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle',
131141
},
132142
{
133-
title: __( 'Pro Tip: Only Some Controls Feature Hover Toggle', i18n ),
143+
title: __( 'Hover Over the Image', i18n ),
134144
description: createInterpolateElement(
135-
__( 'Tip: Watch out—for some controls you <strong>won\'t see the hover state toggle</strong>. Only certain options support hover states. If you don\'t see the toggle, that control doesn\'t have hover customization!', i18n ),
145+
__( 'Hover over the image block to see the hover effect in action.', i18n ),
136146
{ strong: <strong /> }
137147
),
148+
help: __( 'Click next to continue.', i18n ),
138149
offsetX: '300px',
139150
},
151+
{
152+
title: __( 'Tip: Not All Controls Have Hover States', i18n ),
153+
description: createInterpolateElement(
154+
__( 'Only certain options support hover states. If you see the toggle on another option (like <strong>Image Shadow</strong>), that means the control has hover states!', i18n ),
155+
{ strong: <strong /> }
156+
),
157+
anchor: '.stk-control:has([data-attribute="imageShadow"])',
158+
position: 'left',
159+
glowTarget: '.stk-control:has([data-attribute="imageShadow"])',
160+
},
140161
],
141162
}

0 commit comments

Comments
 (0)