|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * HTML for testing the iAPI's style assets management. |
| 4 | + * |
| 5 | + * @package gutenberg-test-interactive-blocks |
| 6 | + * |
| 7 | + * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 8 | + */ |
| 9 | + |
| 10 | +$wrapper_attributes = get_block_wrapper_attributes(); |
| 11 | +?> |
| 12 | +<div <?php echo $wrapper_attributes; ?>> |
| 13 | + <!-- These get colored when the corresponding block is present. --> |
| 14 | + <fieldset> |
| 15 | + <legend>Styles from block styles</legend> |
| 16 | + <p data-testid="red" class="red">Red</p> |
| 17 | + <p data-testid="green" class="green">Green</p> |
| 18 | + <p data-testid="blue" class="blue">Blue</p> |
| 19 | + <p data-testid="all" class="red green blue">All</p> |
| 20 | + </fieldset> |
| 21 | + |
| 22 | + <!-- These get colored when the corresponding block enqueues a referenced stylesheet. --> |
| 23 | + <fieldset> |
| 24 | + <legend>Styles from referenced style sheets</legend> |
| 25 | + <p data-testid="red-from-link" class="red-from-link">Red from link</p> |
| 26 | + <p data-testid="green-from-link" class="green-from-link">Green from link</p> |
| 27 | + <p data-testid="blue-from-link" class="blue-from-link">Blue from link</p> |
| 28 | + <p data-testid="all-from-link" class="red-from-link green-from-link blue-from-link">All from link</p> |
| 29 | + <div data-testid="background-from-link"class="background-from-link" style="width: 10px; height: 10px"></div> |
| 30 | + </fieldset> |
| 31 | + |
| 32 | + <!-- These get colored when the corresponding block adds inline style. --> |
| 33 | + <fieldset> |
| 34 | + <legend>Styles from inline styles</legend> |
| 35 | + <p data-testid="red-from-inline" class="red-from-inline">Red</p> |
| 36 | + <p data-testid="green-from-inline" class="green-from-inline">Green</p> |
| 37 | + <p data-testid="blue-from-inline" class="blue-from-inline">Blue</p> |
| 38 | + <p data-testid="all-from-inline" class="red-from-inline green-from-inline blue-from-inline">All</p> |
| 39 | + </fieldset> |
| 40 | + |
| 41 | + <!-- Links to pages with different blocks combination. --> |
| 42 | + <nav data-wp-interactive="test/router-styles"> |
| 43 | + <?php foreach ( $attributes['links'] as $label => $link ) : ?> |
| 44 | + <a |
| 45 | + data-testid="link <?php echo $label; ?>" |
| 46 | + data-wp-on--click="actions.navigate" |
| 47 | + href="<?php echo $link; ?>" |
| 48 | + > |
| 49 | + <?php echo $label; ?> |
| 50 | + </a> |
| 51 | + <?php endforeach; ?> |
| 52 | + </nav> |
| 53 | + |
| 54 | + <!-- HTML updated on navigation. --> |
| 55 | + <div |
| 56 | + data-wp-interactive="test/router-styles" |
| 57 | + data-wp-router-region="router-styles" |
| 58 | + > |
| 59 | + <?php echo $content; ?> |
| 60 | + </div> |
| 61 | + |
| 62 | + <!-- Text to check whether a navigation was client-side. --> |
| 63 | + <div |
| 64 | + data-testid="client-side navigation" |
| 65 | + data-wp-interactive="test/router-styles" |
| 66 | + data-wp-bind--hidden="!state.clientSideNavigation" |
| 67 | + > |
| 68 | + Client-side navigation |
| 69 | + </div> |
| 70 | +</div> |
0 commit comments