-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Move mobile ImageLinkDestinationsScreen from components package to block-editor package #56775
Move mobile ImageLinkDestinationsScreen from components package to block-editor package #56775
Conversation
…ock-editor package
Size Change: +326 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified the UI worked as expected via the Demo editor on an iPhone 15 Pro simulator.
I left a few suggestions to consider.
@@ -11,13 +11,12 @@ import { __ } from '@wordpress/i18n'; | |||
import { Icon, check, chevronRight } from '@wordpress/icons'; | |||
import { blockSettingsScreens } from '@wordpress/block-editor'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My perception is that the project generally prefers importing internal dependencies. We could change this to a local import now that this file resides within the block-editor
package.
import { | ||
InspectorControls, | ||
ImageLinkDestinationsScreen, | ||
useMultipleOriginColorsAndGradients, | ||
} from '@wordpress/block-editor'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize some of these imports were already in place, but my perception is that the project generally prefers importing internal dependencies. We could technically change these to local imports.
// used in both light and dark modes | ||
.placeholderTextColor { | ||
color: #87a6bc; | ||
} | ||
|
||
.optionIcon { | ||
color: $blue-50; | ||
} | ||
|
||
.optionIconDark { | ||
color: $blue-30; | ||
} | ||
|
||
.unselectedOptionIcon { | ||
opacity: 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears these selectors in the original stylesheet are now unused and can be removed. Note that .linkSettingsPanel
remains in use.
// used in both light and dark modes | |
.placeholderTextColor { | |
color: #87a6bc; | |
} | |
.optionIcon { | |
color: $blue-50; | |
} | |
.optionIconDark { | |
color: $blue-30; | |
} | |
.unselectedOptionIcon { | |
opacity: 0; | |
} |
@@ -91,6 +91,7 @@ export { default as DefaultBlockAppender } from './default-block-appender'; | |||
export { default as __unstableEditorStyles } from './editor-styles'; | |||
export { default as Inserter } from './inserter'; | |||
export { default as InserterButton } from './inserter-button'; | |||
export { default as ImageLinkDestinationsScreen } from './image-link-destinations'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this component is only used within the block-editor
packages, we should likely consider it private and not export it. WDYT?
Note: in making it private, we would need to import it via a relative path.
@dcalhoun Thanks for the review. I agree updating the imports would be more consistent, and I've done so. Would you be able to take another quick look to verify? |
Flaky tests detected in 7ccd625. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7110581764
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
import styles from './style.scss'; | ||
import PanelBody from '../../panel/body'; | ||
import BottomSheet from '../bottom-sheet'; | ||
import styles from './style.native.scss'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken, we are not required to explicitly add the native
suffix. I'm not requesting it be changed here (and re-tested), but merely sharing knowledge.
import styles from './style.native.scss'; | |
import styles from './style.scss'; |
What?
This PR moves the mobile
ImageLinkDestinationsScreen
from the components package to the block-editor package.Related PRs:
Why?
There is an ongoing effort to remove block-editor package dependencies in native files from the components package in order to eliminate cyclic dependencies:
block-editor
package in native files within thecomponents
package #52692How?
Moves code and code references to
ImageLinkDestinationsScreen
from the components package to the block-editor package.Testing Instructions