-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Image: Add lightbox using directives. #50373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SantosGuillamot
merged 126 commits into
WordPress:trunk
from
artemiomorales:experiment/image-with-interactivity-api
May 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
126 commits
Select commit
Hold shift + click to select a range
bd53de2
Add behaviors to the core theme.json
michalczaplinski bd43bf6
Add behaviors to json schemas for theme.json
michalczaplinski e1dd737
Add a behaviors panel
michalczaplinski 8b84a22
Remove the changes to theme.json schema
michalczaplinski d5dbc1c
Add behaviors to the VALID_SETTINGS in class-wp-theme-json-gutenberg.php
michalczaplinski 037d669
Add the first (still broken) version of the lightbox settings
michalczaplinski 8f62d34
WIP: Added a SelectControl for the behaviors
michalczaplinski 62b6217
Format PHP
michalczaplinski edfd7d1
Format correctly again
michalczaplinski 8ee4065
Use the props.name when getting the behaviors
michalczaplinski 594224b
Add initial e2e tests
cbravobernal fd6fe36
Update the withBehaviors description
michalczaplinski da4a5ad
Cleaned up behaviors.js
michalczaplinski 2958fd1
Update e2e tests to check visibility
cbravobernal 0a68bea
Update core-blocks doc with behaviors attribute
cbravobernal fd08928
Update fixtures with new lightbox attribute
cbravobernal 4e03e0d
Add a new theme for e2e tests
michalczaplinski 92b6e6c
Change theme.json to include `settings.behaviors`
michalczaplinski ffa881e
Remove default behavior value from block.json
michalczaplinski 99c964b
Minor fix to the implementation
michalczaplinski 7f7db2c
Add more e2e tests
michalczaplinski 5e5ff9a
Create a selector for behaviors
michalczaplinski ad20b64
Add a filter to load behaviors on the server from the theme.json
michalczaplinski d16266b
Add behaviors on the top-level in core theme.json
michalczaplinski 0982d9f
Use the behaviors in the hooks
michalczaplinski 0ef7b5e
Update the comment
michalczaplinski e75fd87
Update the comment in behaviors.js
michalczaplinski f6414f9
Update fixtures and e2e
cbravobernal 31c0623
Prevent mobile test gutenberg error (temporary - not the best solution)
cbravobernal ee3701f
Add priority on filter
cbravobernal a0ac748
Fix php standards
cbravobernal 1dd6df1
Found a much better way to fix php tests
cbravobernal a737200
Small refactor
cbravobernal 3fd9270
Add `behaviors` as an allowed key to BLOCK_EDITOR_SETTINGS
michalczaplinski 5a9748c
Move the behaviors to top level in the e2e test theme.json file
michalczaplinski 9a6b1f2
Rename the `behaviors` setting to `behaviorsUIEnabled`
michalczaplinski 1c7f6d5
Change "None" to "No behaviors"
michalczaplinski 470f74f
Behaviors -> behavior
michalczaplinski bba7c2d
Fix redundant ternary
michalczaplinski 2cb348c
Improve the JSDoc for behaviors selector
michalczaplinski c65bc57
Rename the test themes to make more sense
michalczaplinski 1c655f7
Remove definition of `behaviors` attribute in core/image
michalczaplinski 697c04f
Change default value for `behaviors.lightbox` to false and update e2e…
michalczaplinski d4fd9d9
Change the way we get the data from `theme.json` and adjust e2e
michalczaplinski a57d634
Capitalize behaviors' labels
michalczaplinski 234a8b6
Move PHP code adding `theme.json` behaviors to `block-editor-settings`
michalczaplinski 4bef633
Update comment
michalczaplinski 7aa7231
Remove the behaviors require from load.php
michalczaplinski 1d923ab
Revert "Update comment"
michalczaplinski aee908a
Revert "Move PHP code adding `theme.json` behaviors to `block-editor-…
michalczaplinski 33cb62d
Remove the comment that was added previously
michalczaplinski 55e37a3
Update comments in `behaviors.php`
michalczaplinski d4d657b
Add back the require_once in load.php
michalczaplinski 8d6b0d0
Use `settings.blocks.core/image.behaviors.lightbox`
michalczaplinski 76b2a75
Use `behaviors.blocks.core/image.lightbox`
michalczaplinski 70e51cd
Remove experimental setting for interactivity API
cbravobernal e69833b
Add lightbox to image block
artemiomorales 9ca2918
Add logic for hiding lightbox on esc key press and overlay click
artemiomorales dca1b36
Improve styles and add note to add conditional for lightbox markup
artemiomorales 552bc3c
Add editor UI and attribute for toggling lightbox
artemiomorales a46c35e
Remove image translation animation and add fade instead
artemiomorales 5bdddd5
Add accessibility; clean up styles; fix bug regarding ref in directives
artemiomorales 3c8a458
Configure image to use new Interactivity API runtime included in Gute…
artemiomorales c69f6ff
Remove viewScript from image config
artemiomorales 4802229
Add Portal directive to Interactivity API runtime
artemiomorales e7a7a4c
Set scrim to site background color
artemiomorales 46b95d6
Remove extraneous image CSS declaration
artemiomorales f5ee39e
Improve aria labeling
artemiomorales 5cc8eae
Code cleanup; simplify syntax, consolidate code
artemiomorales 7009fa1
Refactor code, remove event listeners, consolidate logic
artemiomorales 910706f
Fix formatting in SCSS file
artemiomorales 1ebe07b
Change CheckboxControl to a ToggleControl; update API docs
artemiomorales 10cdc07
Update wp_enqueue_script to correctly add interactivity runtime
artemiomorales d035dc4
Fix linter errors
artemiomorales aa267c0
Update to use core.image namespace
artemiomorales 43dfa46
Pause closing of lightbox slightly when using the mousewheel
artemiomorales 58b5392
Rename portal directive to 'wp-body' and remove unused reference
artemiomorales 0d5ef70
Add internal dependencies flag; update comment
artemiomorales 1c0e406
Remove extraneous code
artemiomorales 926d503
Fix accessibility bug due to directives being defined incorrectly
artemiomorales 68685f1
Move enableLightbox declaration in block.json
artemiomorales 3811186
Remove extraneous package.json declarations
artemiomorales 7840dfe
Fix PHP indentation linter error
artemiomorales 7f2cfe5
Revise package-lock.json to match trunk
artemiomorales effd389
Fix linter errors in portals.js
artemiomorales 8c7adae
Update fixtures
artemiomorales 4558d29
Tests: Add e2e specs for Image block on the frontend
gziolo 6629975
Disable lightbox by default
artemiomorales 409941e
Add aria-role attribute to lightbox markup
artemiomorales 457cbfe
Add tests
artemiomorales 7807fdf
Update fixtures
artemiomorales 0141d68
Fix accessibility issues
artemiomorales f8aa92f
Add focus trap
artemiomorales 5558e8d
Label elements as 'inert' when lightbox is open
artemiomorales 3dc3bf9
Update import of image interactivity scripts
artemiomorales 99d95f9
Fix bug where interactivity only worked with admin enabled
artemiomorales 53e1d47
Put lightbox rendering behind experimental flag
artemiomorales 518e94f
Add check for query selector and update tests
artemiomorales fb7af8b
Update spacing in PHP file
artemiomorales ce9b0c0
Remove tick() and modify CSS
artemiomorales 84be707
Update config based on behaviors UI and trunk changes
artemiomorales 899b11e
Remove extraneous code
artemiomorales 1ea0d58
Remove extraneous code and simplify variable name
artemiomorales 3986e35
Use core WordPress API for experiments flag
artemiomorales 32dc7a8
Clean up declarations
artemiomorales 48a62d2
Fix PHP spacing
artemiomorales ced26e1
Remove `enableLightbox`
michalczaplinski 528b60a
Remove defaultValue from image block.json
michalczaplinski 566460c
Update render_callback of core/image to use Behaviors UI
michalczaplinski 5efaa21
Fix e2e test:
michalczaplinski 77e7fb8
Remove 'inert' declarations for now
artemiomorales d854c7e
Add period to behaviors help text
artemiomorales 6b75413
Create selector for 'role' attribute
artemiomorales 330f403
Update fixtures
artemiomorales 5556ad7
Update comment
artemiomorales cdae7fe
Clean up data-wp-island attribute
artemiomorales 9b1534d
Readd mistakenly deleted line
artemiomorales 3b89cef
Improve syntax of tests
artemiomorales e532fb1
Replace getByLabel() with getByRole() in some tests
artemiomorales cd0c9dd
Remove 'experiments' flag
artemiomorales 429ebbe
Remove dependency on 'experiments' flag in tests
artemiomorales 95a89f7
Revert "Remove dependency on 'experiments' flag in tests"
SantosGuillamot 7c9e0eb
Revert "Remove 'experiments' flag"
SantosGuillamot 8aebca8
Change `aria-label` separator
SantosGuillamot 6ce95ae
Add back the experimental setting
SantosGuillamot 1eaffe1
Merge branch 'trunk' into experiment/image-with-interactivity-api
SantosGuillamot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix bug where interactivity only worked with admin enabled
- Loading branch information
commit 99d95f9e691cd0d0ca3667dcc2b9881846097474
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.