[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
(no description)
File Size: | 67559 lines (2353 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
PostCSSPrefixWrap:: (4 methods):
ValueParser()
stringifyNode()
stringify()
likeNumber()
AtRule:: (0 methods):
Comment:: (2 methods):
cleanSource()
markDirtyUp()
Container:: (0 methods):
CssSyntaxError:: (0 methods):
Declaration:: (0 methods):
Document:: (1 method):
fromJSON()
Input:: (4 methods):
isPromise()
getEvents()
toStack()
cleanMarks()
LazyResult:: (0 methods):
MapGenerator:: (0 methods):
NoWorkResult:: (1 method):
cloneNode()
Node:: (2 methods):
parse()
findLastWithPosition()
Parser:: (3 methods):
postcss()
creator()
fromBase64()
PreviousMap:: (0 methods):
Processor:: (0 methods):
Result:: (0 methods):
Root:: (0 methods):
Rule:: (1 method):
capitalize()
Stringifier:: (6 methods):
stringify()
position()
unclosed()
endOfFile()
nextToken()
back()
Warning:: (306 methods):
emptyFunction()
emptyFunctionWithReset()
shim()
getShim()
__()
TextareaAutosizeClass()
matcher()
__webpack_require__()
useBlockEditContext()
insertAt()
moveTo()
mapBlockOrder()
mapBlockParents()
flattenBlocks()
getFlattenedClientIds()
getFlattenedBlocksWithoutAttributes()
getFlattenedBlockAttributes()
hasSameKeys()
isUpdatingSameBlockAttribute()
updateBlockTreeForBlocks()
updateParentInnerBlocksInTree()
withPersistentBlockChange()
withIgnoredBlockChange()
isBlockInterfaceHidden()
isTyping()
isDragging()
draggedBlocks()
blockVisibility()
selectionHelper()
selection()
isMultiSelecting()
isSelectionEnabled()
removalPromptData()
blockRemovalRules()
initialPosition()
blocksMode()
insertionPoint()
template()
settings()
preferences()
editorMode()
hasBlockMovingClientId()
lastBlockAttributesChange()
highlightedBlock()
lastBlockInserted()
temporarilyEditingAsBlocks()
temporarilyEditingFocusModeRevert()
blockEditingModes()
openedBlockSettingsMenu()
styleOverrides()
registeredInserterMediaCategories()
lastFocus()
withAutomaticChangeReset()
arrayOf()
isObjectLike()
createCache()
isShallowEqual()
rememo()
getCache()
clear()
callSelector()
orderBy()
getBlockName()
isBlockValid()
getBlockAttributes()
getBlock()
getBlocks()
__experimentalGetGlobalBlocksByName()
getBlockCount()
getSelectionStart()
getSelectionEnd()
getBlockSelectionStart()
getBlockSelectionEnd()
getSelectedBlockCount()
hasSelectedBlock()
getSelectedBlockClientId()
getSelectedBlock()
getBlockRootClientId()
getBlockHierarchyRootClientId()
getLowestCommonAncestorWithSelectedBlock()
getAdjacentBlockClientId()
getPreviousBlockClientId()
getNextBlockClientId()
getSelectedBlocksInitialCaretPosition()
getMultiSelectedBlockClientIds()
getFirstMultiSelectedBlockClientId()
getLastMultiSelectedBlockClientId()
isFirstMultiSelectedBlock()
isBlockMultiSelected()
getMultiSelectedBlocksStartClientId()
getMultiSelectedBlocksEndClientId()
__unstableIsFullySelected()
__unstableIsSelectionCollapsed()
__unstableSelectionHasUnmergeableBlock()
__unstableIsSelectionMergeable()
getBlockOrder()
getBlockIndex()
isBlockSelected()
hasSelectedInnerBlock()
hasDraggedInnerBlock()
isBlockWithinSelection()
hasMultiSelection()
selectors_isMultiSelecting()
selectors_isSelectionEnabled()
getBlockMode()
selectors_isTyping()
isDraggingBlocks()
getDraggedBlockClientIds()
isBlockBeingDragged()
isAncestorBeingDragged()
isCaretWithinFormattedText()
isBlockInsertionPointVisible()
isValidTemplate()
getTemplate()
getTemplateLock()
canInsertBlocks()
canRemoveBlock()
canRemoveBlocks()
canMoveBlock()
canMoveBlocks()
canEditBlock()
canLockBlockType()
getInsertUsage()
getBlockListSettings()
getSettings()
isLastBlockChangePersistent()
__unstableIsLastBlockChangeIgnored()
__experimentalGetLastBlockAttributeChanges()
getReusableBlocks()
isNavigationMode()
__unstableGetEditorMode()
selectors_hasBlockMovingClientId()
didAutomaticChange()
isBlockHighlighted()
areInnerBlocksControlled()
wasBlockJustInserted()
isBlockVisible()
__unstableGetTemporarilyEditingAsBlocks()
__unstableGetTemporarilyEditingFocusModeToRevert()
__unstableHasActiveBlockOverlayActive()
__unstableIsWithinBlockOverlay()
__experimentalUpdateSettings()
hideBlockInterface()
showBlockInterface()
displayBlockRemovalPrompt()
clearBlockRemovalPrompt()
setBlockRemovalRules()
setOpenedBlockSettingsMenu()
setStyleOverride()
deleteStyleOverride()
syncDerivedUpdates()
setLastFocus()
stopEditingAsBlocks()
startDragging()
stopDragging()
isPatternFiltered()
setImmutably()
mergeOrigins()
overrideOrigins()
hasOriginValue()
getBlockSettings()
private_selectors_isBlockInterfaceHidden()
getLastInsertedBlocksClientIds()
getBlockWithoutAttributes()
getEnabledClientIdsTreeUnmemoized()
getRemovalPromptData()
getBlockRemovalRules()
getOpenedBlockSettingsMenu()
getStyleOverrides()
getRegisteredInserterMediaCategories()
getLastFocus()
private_selectors_isDragging()
retrieveSelectedAttribute()
resetSelection()
receiveBlocks()
updateBlockAttributes()
updateBlock()
selectBlock()
startMultiSelect()
stopMultiSelect()
clearSelectedBlock()
toggleSelection()
getBlocksWithDefaultStylesApplied()
replaceBlock()
moveBlockToPosition()
insertBlock()
showInsertionPoint()
setTemplateValidity()
removeBlock()
replaceInnerBlocks()
toggleBlockMode()
startTyping()
stopTyping()
startDraggingBlocks()
stopDraggingBlocks()
enterFormattedText()
exitFormattedText()
selectionChange()
updateBlockListSettings()
updateSettings()
__unstableSaveReusableBlock()
__unstableMarkLastChangeAsPersistent()
__unstableMarkNextChangeAsNotPersistent()
toggleBlockHighlight()
setHasControlledInnerBlocks()
setBlockVisibility()
__unstableSetTemporarilyEditingAsBlocks()
setBlockEditingMode()
unsetBlockEditingMode()
use_settings_useSettings()
useSetting()
getComputedFluidTypographyValue()
getTypographyValueAndUnit()
roundToPrecision()
getTypographyFontSizeValue()
isFluidTypographyEnabled()
getFluidTypographyOptionsFromSettings()
findInPresetsBy()
getPresetVariableFromValue()
getValueFromPresetVariable()
getValueFromCustomVariable()
getValueFromVariable()
scopeSelector()
appendToSelector()
areGlobalStyleConfigsEqual()
getBlockStyleVariationSelector()
useGlobalSetting()
useGlobalStyle()
useSettingsForBlockElement()
useColorsPerOrigin()
useGradientsPerOrigin()
transformStyles()
shouldSkipSerialization()
useStyleOverride()
useBlockSettings()
createBlockEditFilter()
BlockProps()
createBlockListBlockFilter()
createBlockSaveFilter()
extraPropsFromHooks()
migrateLightBlockWrapper()
useBlockControlsFill()
BlockControlsFill()
BlockControlsSlot()
appendSelectors()
getBlockGapCSS()
getAlignmentsInfo()
isValueSpacingPreset()
getCustomValueFromPreset()
getPresetValueFromCustomValue()
getSpacingPresetCssVar()
getSpacingPresetSlug()
getSliderValueFromPreset()
mode()
getAllRawValue()
isValuesMixed()
isValuesDefined()
hasAxisSupport()
getSupportedMenuItems()
hasBalancedSidesSupport()
getInitialView()
getGapBoxControlValueFromStyle()
getGapCSSValue()
BlockVerticalAlignmentUI()
applyOrUnset()
JustifyContentUI()
FlexLayoutVerticalAlignmentControl()
FlexLayoutJustifyContentControl()
FlexWrapControl()
OrientationControl()
Icon()
GridLayoutMinimumWidthControl()
GridLayoutColumnsControl()
getLayoutType()
getLayoutTypes()
useLayout()
LayoutStyle()
useAvailableAlignments()
BlockAlignmentUI()
onChangeAlignment()
useBlockEditingMode()
getValidAlignments()
addAttribute()
BlockEditAlignmentToolbarControlsPure()
useBlockProps()
addAssignedAlign()
lock_addAttribute()
InspectorControlsFill()
RegisterResetAll()
ToolsPanelInspectorControl()
BlockSupportToolsPanel()
BlockSupportSlotContainer()
InspectorControlsSlot()
anchor_addAttribute()
BlockEditAnchorControlPure()
addSaveProps()
aria_label_addAttribute()
aria_label_addSaveProps()
custom_class_name_addAttribute()
CustomClassNameControlsPure()
custom_class_name_addSaveProps()
addTransforms()
addGeneratedClassName()
MediaUploadCheck()
LinkSettingsDrawer()
isFunction()
URLInput:: (293 methods):
SearchItemIcon()
addLeadingSlash()
removeTrailingSlash()
getURLForDisplay()
getVisualTypeName()
LinkControlSearchResults()
isURLLike()
hasPossibleTLD()
useSearchHandler()
use_rich_url_data_reducer()
useRemoteUrlData()
LinkPreview()
useCreatePage()
useInternalValue()
LinkControl()
hasBackgroundImageValue()
hasBackgroundSizeValue()
hasBackgroundSupport()
resetBackgroundImage()
resetBackgroundSize()
getBackgroundImageClasses()
InspectorImagePreview()
BackgroundImagePanelItem()
backgroundSizeHelpText()
BackgroundSizePanelItem()
BackgroundImagePanel()
names()
getColorClassName()
getMostReadableColor()
useMultipleOriginColorsAndGradients()
utils_mode()
getAllUnit()
getAllValue()
hasMixedValues()
hasDefinedValues()
AllInputControl()
BoxInputControls()
LinkedButton()
BorderRadiusControl()
ShadowPopoverContainer()
ShadowPresets()
ShadowIndicator()
ShadowPopover()
renderShadowToggle()
useShadowPresets()
useHasBorderPanel()
useHasBorderPanelControls()
useHasBorderColorControl()
useHasBorderRadiusControl()
useHasBorderStyleControl()
useHasBorderWidthControl()
useHasShadowControl()
BorderToolsPanel()
BorderPanel()
getColorSlugFromVariable()
styleToAttributes()
attributesToStyle()
BordersInspectorControl()
border_BorderPanel()
selector()
hasBorderSupport()
hasShadowSupport()
useBorderPanelLabel()
removeBorderAttribute()
addAttributes()
border_addSaveProps()
getBorderClasses()
border_useBlockProps()
__experimentalGetGradientClass()
getGradientValueBySlug()
__experimentalGetGradientObjectByGradientValue()
getGradientSlugByValue()
__experimentalUseGradient()
ColorGradientControlInner()
ColorGradientControlSelect()
ColorGradientControl()
useHasColorPanel()
useHasTextPanel()
useHasLinkPanel()
useHasCaptionPanel()
useHasHeadingPanel()
useHasButtonPanel()
useHasBackgroundPanel()
ColorToolsPanel()
ColorPanelTab()
ColorPanelDropdown()
ColorPanel()
ContrastChecker()
BlockRefsProvider()
useBlockRefProvider()
useBlockRef()
useBlockElement()
getComputedStyle()
BlockColorContrastChecker()
color_addAttributes()
color_addSaveProps()
color_styleToAttributes()
color_attributesToStyle()
ColorInspectorControl()
ColorEdit()
selector()
color_useBlockProps()
color_addTransforms()
FontFamilyControl()
FontAppearanceControl()
isLineHeightDefined()
LetterSpacingControl()
TextTransformControl()
TextDecorationControl()
WritingModeControl()
useHasTypographyPanel()
useHasFontSizeControl()
useHasFontFamilyControl()
useHasLineHeightControl()
useHasAppearanceControl()
useAppearanceControlLabel()
useHasLetterSpacingControl()
useHasTextTransformControl()
useHasTextDecorationControl()
useHasWritingModeControl()
useHasTextColumnsControl()
getUniqueFontSizesBySlug()
TypographyToolsPanel()
TypographyPanel()
LineHeightEdit()
useIsLineHeightDisabled()
font_family_addAttributes()
font_family_addSaveProps()
font_family_useBlockProps()
resetFontFamily()
utils_getFontSizeObjectByValue()
getFontSizeClass()
font_size_addAttributes()
font_size_addSaveProps()
FontSizeEdit()
useIsFontSizeDisabled()
font_size_useBlockProps()
font_size_addTransforms()
omit()
typography_styleToAttributes()
typography_attributesToStyle()
TypographyInspectorControl()
typography_TypographyPanel()
selector()
SpacingInputControl()
AxialInputControls()
SeparatedInputControls()
SingleInputControl()
SidesDropdown()
useSpacingSizes()
SpacingSizesControl()
HeightControl()
helpText()
ChildLayoutControl()
childLayoutOrientation()
AspectRatioTool()
useHasDimensionsPanel()
useHasContentSize()
useHasWideSize()
useHasPadding()
useHasMargin()
useHasGap()
useHasMinHeight()
useHasAspectRatio()
useHasChildLayout()
useHasSpacingPresets()
filterValuesBySides()
splitStyleValue()
splitGapValue()
DimensionsToolsPanel()
DimensionsPanel()
usePopoverScroll()
onWheel()
BlockPopover()
getComputedCSS()
MarginVisualizer()
padding_getComputedCSS()
PaddingVisualizer()
useVisualizer()
DimensionsInspectorControl()
dimensions_DimensionsPanel()
hasDimensionsSupport()
dimensions_useBlockProps()
useCustomSides()
getInlineStyles()
style_addAttribute()
omitStyle()
style_addSaveProps()
BlockStyleControls()
style_useBlockProps()
settings_addAttribute()
DuotoneControl()
getValuesFromColors()
getDuotoneUnsetStylesheet()
getDuotoneStylesheet()
getDuotoneFilter()
getBlockCSSSelector()
useMultiOriginColorPresets()
useHasFiltersPanel()
useHasDuotoneControl()
FiltersToolsPanel()
FiltersPanel()
useMultiOriginPresets()
getColorsFromDuotonePreset()
getDuotonePresetFromColors()
DuotonePanelPure()
addDuotoneAttributes()
useDuotoneStyles()
duotone_useBlockProps()
getPositionTypeLabel()
useBlockDisplayInformation()
getPositionCSS()
hasStickyPositionSupport()
hasFixedPositionSupport()
hasPositionSupport()
hasPositionValue()
hasStickyOrFixedPositionValue()
resetPosition()
useIsPositionDisabled()
PositionPanelPure()
position_useBlockProps()
hasLayoutBlockSupport()
useLayoutClasses()
useLayoutStyles()
LayoutPanelPure()
LayoutTypeSwitcher()
layout_addAttribute()
BlockWithLayoutStyles()
useBlockPropsChildLayoutStyles()
useConvertToGroupButtonProps()
ConvertToGroupButton()
useBlockLock()
getTemplateLockValue()
BlockLockModal()
BlockLockMenuItem()
BlockModeToggle()
useBlockRename()
isEmptyString()
BlockRenameModal()
BlockRenameControl()
onChange()
BlockSettingsMenuControls()
ContentLockControlsPure()
addMetaAttribute()
BlockIcon()
BlockHooksControlPure()
addLabelCallback()
BlockRenameControlPure()
canBindBlock()
canBindAttribute()
BlockBindingBridge()
shimAttributeSource()
getBorderClassesAndStyles()
useBorderProps()
getShadowClassesAndStyles()
getColorClassesAndStyles()
useColorProps()
getSpacingClassesAndStyles()
getTypographyClassesAndStyles()
useCachedTruthy()
createColorHOC()
createCustomColorsHOC()
withColors()
font_size_picker_FontSizePicker()
AlignmentUI()
applyOrUnset()
setIcon()
localeLowerCase()
lowerCase()
noCase()
dist_es2015_replace()
extractWords()
normalizeSearchInput()
getItemSearchRank()
createBlockCompleter()
createLinkCompleter()
useCompleters()
useBlockEditorAutocompleteProps()
BlockEditorAutocomplete()
BlockFullHeightAlignmentControl()
BlockAlignmentMatrixControl()
useBlockDisplayTitle()
BlockTitle()
BlockBreadcrumb()
useBlockOverlayActive()
BlockContextProvider()
BlockEdit()
Warning()
BlockView()
BlockCompare()
getDifference()
getConvertedContent()
BlockInvalidWarning()
BlockCrashBoundary:: (143 methods):
BlockHTML()
dist_esm_I()
getAbsolutePosition()
useMovingAnimation()
preserveScrollPosition()
isInSameBlock()
isInsideRootBlock()
getBlockClientId()
useFocusFirstElement()
listener()
useIsHovered()
useFocusHandler()
onFocus()
useEventHandlers()
onKeyDown()
onDragStart()
useNavModeExit()
onMouseDown()
useIntersectionObserver()
useFlashEditableBlocks()
use_block_props_useBlockProps()
mergeWrapperProps()
Block()
BlockListBlock()
moveFirstItemUp()
BlockListBlockProvider()
Tips()
BlockCard()
useBlockSync()
KeyboardShortcuts()
KeyboardShortcutsRegister()
useBlockSelectionClearer()
onMouseDown()
BlockSelectionClearer()
selector()
useMultiSelection()
useTabNav()
onFocusCapture()
onKeyDown()
onFocusOut()
preventScrollOnTab()
isNavigationCandidate()
getClosestTabbable()
isTabCandidate()
useArrowNav()
onMouseDown()
isClosestTabbableABlock()
onKeyDown()
useSelectAll()
onKeyDown()
setContentEditableWrapper()
useDragSelection()
onMouseUp()
onMouseLeave()
extractSelectionStartNode()
extractSelectionEndNode()
findDepth()
use_selection_observer_setContentEditableWrapper()
getRichTextElement()
useSelectionObserver()
onSelectionChange()
useClickSelection()
onMouseDown()
useInput()
onBeforeInput()
onKeyDown()
onCompositionStart()
useNotifyCopy()
removeWindowsFragments()
removeCharsetMetaTag()
getPasteEventData()
shouldDismissPastedFiles()
setClipboardBlocks()
getPasteBlocks()
toPlainText()
useClipboardHandler()
handler()
useWritingFlow()
WritingFlow()
getCompatibilityStyles()
matchFromRules()
bubbleEvent()
useBubbleEvents()
Iframe()
preventFileDropDefault()
onLoad()
IframeIfReady()
transformStyle()
useDarkThemeBodyClassName()
EditorStyles()
ScaledBlockPreview()
AutoBlockPreview()
BlockPreview()
useBlockPreview()
InserterPreviewPanel()
InserterListboxItem()
BlockDraggableChip()
InserterListItem()
InserterListboxGroup()
InserterListboxRow()
chunk()
BlockTypesList()
InserterPanel()
InserterListbox()
BlockTypesTab()
PatternCategoriesList()
PatternsExplorerSearch()
PatternExplorerSidebar()
Pagination()
BlockPattern()
BlockPatternPlaceholder()
BlockPatternsList()
useInsertionPoint()
usePatternsPaging()
PatternsListHeader()
PatternList()
hasRegisteredCategory()
usePatternCategories()
PatternsExplorer()
PatternsExplorerModal()
ScreenHeader()
MobileTabNavigation()
PatternsFilter()
handleSetSourceFilterChange()
PatternCategoryPreviews()
BlockPatternsTab()
PatternCategoryPreviewPanel()
useMediaResults()
useMediaCategories()
getBlockAndPreviewFromMedia()
MediaPreviewOptions()
InsertExternalImageModal()
MediaPreview()
MediaList()
InserterNoResults()
MediaCategoryDialog()
MediaCategoryPanel()
MediaTab()
InserterSearchResults()
InserterTabs()
InserterMenu()
QuickInserter()
handleClick()
PrivateInserter:: (301 methods):
getAdjacentBlockAttributes()
getInsertionIndex()
DefaultBlockAppender()
ButtonBlockAppender()
DefaultAppender()
BlockListAppender()
BlockPopoverInbetween()
BlockDropZonePopover()
InbetweenInsertionPointPopover()
onClick()
maybeHideInserterPoint()
onFocus()
InsertionPoint()
useInBetweenInserter()
onMouseMove()
useShallowMemo()
useNestedSettingsUpdate()
useInnerBlockTemplateSync()
useBlockContext()
parseDropEvent()
onBlockDrop()
onFilesDrop()
onHTMLDrop()
useOnBlockDrop()
getDistanceFromPointToEdge()
getDistanceToNearestEdge()
isPointContainedByRect()
isPointWithinTopAndBottomBoundariesOfRect()
getDropTargetPosition()
isDropTargetValid()
useBlockDropZone()
BlockContext()
UncontrolledInnerBlocks()
ControlledInnerBlocks()
useInnerBlocksProps()
isKeyDownEligibleForStartTyping()
useMouseMoveTypingReset()
stopTypingOnMouseMove()
useTypingObserver()
stopTypingOnNonTextField()
stopTypingOnEscapeKey()
stopTypingOnSelectionUncollapse()
startTypingInTextField()
ObserveTyping()
block_list_Root()
StopEditingAsBlocksOnOutsideSelect()
BlockList()
Items()
BlockListItems()
getProps()
useBlockToolbarPopoverProps()
useSelectedBlockToolProps()
EmptyBlockInserter()
useScrollWhenDragging()
getBlockMoverDescription()
getMultiBlockMoverDescription()
BlockMover()
useDebouncedShowGestures()
useShowHoveredOrFocusedGestures()
BlockParentSelector()
PreviewBlockPopover()
useBlockVariationTransforms()
BlockVariationTranformationItem()
useGroupedTransforms()
RestTransformationItems()
BlockTranformationItem()
getActiveStyle()
replaceActiveStyle()
getRenderedStyles()
getDefaultStyle()
useGenericPreviewBlock()
useStylesForBlocks()
BlockStylesMenuItems()
BlockStylesMenu()
PatternTransformationsMenu()
PreviewPatternsPopover()
pattern_transformations_menu_BlockPatternsList()
pattern_transformations_menu_BlockPattern()
BlockSwitcherDropdownMenuContents()
selectForMultipleBlocks()
onBlockTransform()
onBlockVariationTransform()
onPatternTransform()
supports_hasBorderSupport()
hasSerializedBlocks()
getStyleAttributes()
recursivelyUpdateBlockAttributes()
usePasteStyles()
BlockActions()
BlockHTMLConvertButton()
CopyMenuItem()
ParentSelectorMenuItem()
BlockSettingsDropdown()
BlockSettingsMenu()
BlockLockToolbar()
BlockGroupToolbar()
BlockEditVisuallyButton()
hasOnlyToolbarItem()
getAllFocusableToolbarItemsIn()
hasFocusWithin()
focusFirstTabbableIn()
useIsAccessibleToolbar()
useToolbarFocus()
NavigableToolbar()
useHasAnyBlockControls()
useHasBlockControls()
BlockBindingsToolbarIndicator()
PrivateBlockToolbar()
BlockToolbar()
BlockToolbarPopover()
BlockSelectionButton()
onKeyDown()
BlockToolbarBreadcrumb()
ZoomOutModeInserters()
block_tools_selector()
BlockTools()
onKeyDown()
ExperimentalBlockCanvas()
BlockCanvas()
AriaReferencedText()
useListViewScrollIntoView()
ListViewExpander()
getImage()
getImagesFromGallery()
getImagesFromBlock()
useListViewImages()
ListViewBlockSelectButton()
getBlocksToUpdate()
getCommonDepthClientIds()
focusListItem()
getDragDisplacementValues()
ListViewBlock()
countBlocks()
ListViewBranch()
ListViewDropIndicatorPreview()
useBlockSelection()
useListViewBlockIndexes()
useListViewClientIds()
isUpGesture()
getDesiredRelativeParentLevel()
getCandidateBlockParents()
getNextNonDraggedBlock()
isNestingGesture()
getListViewDropTarget()
useListViewDropZone()
useListViewExpandSelectedItem()
use_clipboard_handler_useClipboardHandler()
updateFocusAndSelection()
getBlocksToUpdate()
handler()
ListViewComponent()
BlockNavigationDropdownToggle()
BlockNavigationDropdown()
BlockStylesPreviewPanel()
BlockStyles()
HeadingLevelIcon()
HeadingLevelDropdown()
BlockVariationPicker()
usePatternsSetup()
block_pattern_setup_BlockPattern()
BlockPatternSlide()
VariationsButtons()
VariationsDropdown()
VariationsToggleGroupControl()
__experimentalBlockVariationTransforms()
ColorPaletteControl()
DateFormatPicker()
NonDefaultControls()
ColorGradientSettingsDropdown()
useSaveImage()
useTransformImage()
editImage()
ImageEditingProvider()
__extends()
__()
__rest()
__decorate()
__param()
__metadata()
__awaiter()
adopt()
fulfilled()
rejected()
step()
__generator()
verb()
step()
__exportStar()
__values()
__read()
__spread()
__spreadArrays()
__await()
__asyncGenerator()
verb()
resume()
step()
fulfill()
reject()
settle()
__asyncDelegator()
verb()
__asyncValues()
verb()
settle()
__makeTemplateObject()
__importStar()
__importDefault()
__classPrivateFieldGet()
__classPrivateFieldSet()
getCropSize()
getMediaZoom()
restrictPosition()
restrictPositionCoord()
getDistanceBetweenPoints()
getRotationBetweenPoints()
computeCroppedArea()
limitArea()
noOp()
getInitialCropFromCroppedAreaPercentages()
getZoomFromCroppedAreaPixels()
getInitialCropFromCroppedAreaPixels()
getCenter()
getRadianAngle()
rotateSize()
clamp()
classNames()
Cropper()
ImageCropper()
ZoomDropdown()
AspectGroup()
AspectRatioDropdown()
RotationButton()
FormControls()
ImageEditor()
useDimensionHandler()
ImageSizeControl()
LinkViewerURL()
LinkViewer()
LinkEditor()
MediaPlaceholder()
recursivelyFindMediaFromBlocks()
InlineSelectionToolbar()
InlineToolbar()
useUndoAutomaticChange()
onKeyDown()
useMarkPersistent()
addActiveFormats()
getMultilineTag()
getAllowedFormats()
createLinkInParagraph()
splitValue()
usePasteHandler()
_onPaste()
pasteInline()
useBeforeInputRules()
onInput()
preventEventDiscovery()
findSelection()
useInputRules()
inputRule()
onInput()
useDelete()
onKeyDown()
useEnter()
onKeyDown()
formatTypesSelector()
prefixSelectKeys()
getPrefixedSelectKeys()
useFormatTypes()
useRemoveBrowserShortcuts()
onKeydown()
useShortcuts()
onKeyDown()
useInputEvents()
onInput()
useInsertReplacementText()
onInput()
useFirefoxCompat()
onFocus()
format_edit_Edit()
FormatEdit()
Content()
RichTextMultiline()
_onChange()
withDeprecations()
removeNativeProps()
RichTextWrapper()
addEditorOnlyFormats()
removeEditorOnlyFormats()
addInvisibleFormats()
onFocus()
ResponsiveBlockControlLabel()
ResponsiveBlockControl()
RichTextShortcut()
callback()
RichTextToolbarButton()
__unstableRichTextInputEvent()
callback()
ToolSelector()
UnitControl()
URLInputButton:: (124 methods):
PreviewOptions()
useResizeCanvas()
MultiSelectionInspector()
DefaultStylePicker()
InspectorControlsTabsHint()
InspectorControlsTabs()
getShowTabs()
useInspectorControlsTabs()
useBlockInspectorAnimationSettings()
BlockQuickNavigation()
BlockQuickNavigationItem()
BlockInspectorLockedBlocks()
CopyHandler()
InserterLibrary()
MultiSelectScrollIntoView()
useTypewriter()
onScrollResize()
onKeyDown()
maintainCaretPosition()
addSelectionChangeListener()
computeCaretRectOnSelectionChange()
computeCaretRectangle()
isSelectionEligibleForScroll()
isLastEditableNode()
Typewriter()
addToBlockType()
RecursionProvider()
useHasRecursion()
InspectorPopoverHeader()
PublishDateTimePicker()
selectForMultipleBlocks()
onBlockTransform()
useReusableBlocksRenameHint()
ReusableBlocksRenameHint()
compileStyleValue()
getPresetsDeclarations()
getPresetsClasses()
getPresetsSvgFilters()
flattenTree()
concatFeatureVariationSelectorString()
getStylesDeclarations()
getLayoutStyles()
pickStyleKeys()
toSvgFilters()
updateConfigWithSeparator()
processCSSNesting()
useGlobalStylesOutputWithConfig()
useGlobalStylesOutput()
useHasImageSettingsPanel()
ImageSettingsPanel()
AdvancedPanel()
handleOnChange()
handleOnBlur()
memize()
memoized()
getTranslation()
deepCompare()
getGlobalStylesChangelist()
getGlobalStylesChanges()
addValuesForElement()
addValuesForElements()
addValuesForBlocks()
getRichTextValues()
ResizableBoxPopover()
useCanBlockToolbarBeFocused()
BlockRemovalWarningModal()
ScaleTool()
extends_extends()
memoize()
sheetForTag()
createStyleElement()
StyleSheet()
hash()
trim()
Utility_match()
Utility_replace()
indexof()
Utility_charat()
Utility_substr()
Utility_strlen()
Utility_sizeof()
Utility_append()
Utility_combine()
node()
Tokenizer_copy()
Tokenizer_char()
prev()
next()
peek()
caret()
slice()
token()
alloc()
dealloc()
delimit()
Tokenizer_tokenize()
whitespace()
tokenizer()
escaping()
delimiter()
commenter()
identifier()
Serializer_serialize()
Serializer_stringify()
middleware()
rulesheet()
prefixer()
namespace()
compile()
Parser_parse()
ruleset()
Parser_comment()
declaration()
emotion_cache_browser_esm_prefix()
murmur2()
emotion_memoize_esm_memoize()
handleInterpolation()
createStringFromObject()
withTheme()
emotion_utils_browser_esm_getRegisteredStyles()
_EMOTION_STRINGIFIED_CSS_ERROR__()
WidthHeightTool()
DimensionsTool()
ResolutionTool()
Class: PostCSSPrefixWrap - X-Ref
ValueParser(value) X-Ref |
stringifyNode(node, custom) X-Ref |
No description |
stringify(nodes, custom) X-Ref |
No description |
likeNumber(value) X-Ref |
No description |
Class: CssSyntaxError - X-Ref
Class: Declaration - X-Ref
Class: LazyResult - X-Ref
Class: MapGenerator - X-Ref
Class: NoWorkResult - X-Ref
Class: PreviousMap - X-Ref
capitalize(str) X-Ref |
No description |
Class: Stringifier - X-Ref
emptyFunction() X-Ref |
No description |
emptyFunctionWithReset() X-Ref |
No description |
shim(props, propName, componentName, location, propFullName, secret) X-Ref |
No description |
getShim() X-Ref |
No description |
__() X-Ref |
No description |
TextareaAutosizeClass() X-Ref |
A light replacement for built-in textarea component which automaticaly adjusts its height to match the content |
matcher(match) X-Ref |
No description |
__webpack_require__(moduleId) X-Ref |
No description |
useBlockEditContext() X-Ref |
A hook that returns the block edit context. return: {Object} Block edit context |
insertAt(array, elements, index) X-Ref |
Insert one or multiple elements into a given position of an array. return: {Array} Result. param: {Array} array Source array. param: {*} elements Elements to insert. param: {number} index Insert Position. |
moveTo(array, from, to, count = 1) X-Ref |
Moves an element in an array. return: {Array} Result. param: {Array} array Source array. param: {number} from Source index. param: {number} to Destination index. param: {number} count Number of elements to move. |
mapBlockOrder(blocks, rootClientId = '') X-Ref |
Given an array of blocks, returns an object where each key is a nesting context, the value of which is an array of block client IDs existing within that nesting context. return: {Object} Block order map object. param: {Array} blocks Blocks to map. param: {?string} rootClientId Assumed root client ID. |
mapBlockParents(blocks, rootClientId = '') X-Ref |
Given an array of blocks, returns an object where each key contains the clientId of the block and the value is the parent of the block. return: {Object} Block order map object. param: {Array} blocks Blocks to map. param: {?string} rootClientId Assumed root client ID. |
flattenBlocks(blocks, transform = identity) X-Ref |
Helper method to iterate through all blocks, recursing into inner blocks, applying a transformation function to each one. Returns a flattened object with the transformed blocks. return: {Array} Flattened object. param: {Array} blocks Blocks to flatten. param: {Function} transform Transforming function to be applied to each block. |
getFlattenedClientIds(blocks) X-Ref |
No description |
getFlattenedBlocksWithoutAttributes(blocks) X-Ref |
Given an array of blocks, returns an object containing all blocks, without attributes, recursing into inner blocks. Keys correspond to the block client ID, the value of which is the attributes object. return: {Array} Flattened block attributes object. param: {Array} blocks Blocks to flatten. |
getFlattenedBlockAttributes(blocks) X-Ref |
Given an array of blocks, returns an object containing all block attributes, recursing into inner blocks. Keys correspond to the block client ID, the value of which is the attributes object. return: {Array} Flattened block attributes object. param: {Array} blocks Blocks to flatten. |
hasSameKeys(a, b) X-Ref |
Returns true if the two object arguments have the same keys, or false otherwise. return: {boolean} Whether the two objects have the same keys. param: {Object} a First object. param: {Object} b Second object. |
isUpdatingSameBlockAttribute(action, lastAction) X-Ref |
Returns true if, given the currently dispatching action and the previously dispatched action, the two actions are updating the same block attribute, or false otherwise. return: {boolean} Whether actions are updating the same block attribute. param: {Object} action Currently dispatching action. param: {Object} lastAction Previously dispatched action. |
updateBlockTreeForBlocks(state, blocks) X-Ref |
No description |
updateParentInnerBlocksInTree(state, updatedClientIds, updateChildrenOfUpdatedClientIds = false) X-Ref |
No description |
withPersistentBlockChange(reducer) X-Ref |
Higher-order reducer intended to augment the blocks reducer, assigning an `isPersistentChange` property value corresponding to whether a change in state can be considered as persistent. All changes are considered persistent except when updating the same block attribute as in the previous action. return: {Function} Enhanced reducer function. param: {Function} reducer Original reducer function. |
withIgnoredBlockChange(reducer) X-Ref |
Higher-order reducer intended to augment the blocks reducer, assigning an `isIgnoredChange` property value corresponding to whether a change in state can be considered as ignored. A change is considered ignored when the result of an action not incurred by direct user interaction. return: {Function} Enhanced reducer function. param: {Function} reducer Original reducer function. |
isBlockInterfaceHidden(state = false, action) X-Ref |
Reducer returning visibility status of block interface. return: {boolean} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
isTyping(state = false, action) X-Ref |
Reducer returning typing state. return: {boolean} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
isDragging(state = false, action) X-Ref |
Reducer returning dragging state. It is possible for a user to be dragging data from outside of the editor, so this state is separate from `draggedBlocks`. return: {boolean} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
draggedBlocks(state = [], action) X-Ref |
Reducer returning dragged block client id. return: {string[]} Updated state. param: {string[]} state Current state. param: {Object} action Dispatched action. |
blockVisibility(state = {}, action) X-Ref |
Reducer tracking the visible blocks. return: {Record<string,boolean>} Block visibility. param: {Record<string,boolean>} state Current state. param: {Object} action Dispatched action. |
selectionHelper(state = {}, action) X-Ref |
Internal helper reducer for selectionStart and selectionEnd. Can hold a block selection, represented by an object with property clientId. return: {Object} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
selection(state = {}, action) X-Ref |
Reducer returning the selection state. return: {boolean} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
isMultiSelecting(state = false, action) X-Ref |
Reducer returning whether the user is multi-selecting. return: {boolean} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
isSelectionEnabled(state = true, action) X-Ref |
Reducer returning whether selection is enabled. return: {boolean} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
removalPromptData(state = false, action) X-Ref |
Reducer returning the data needed to display a prompt when certain blocks are removed, or `false` if no such prompt is requested. return: {Object|false} Data for removal prompt display, if any. param: {boolean} state Current state. param: {Object} action Dispatched action. |
blockRemovalRules(state = false, action) X-Ref |
Reducer returning any rules that a block editor may provide in order to prevent a user from accidentally removing certain blocks. These rules are then used to display a confirmation prompt to the user. For instance, in the Site Editor, the Query Loop block is important enough to warrant such confirmation. The data is a record whose keys are block types (e.g. 'core/query') and whose values are the explanation to be shown to users (e.g. 'Query Loop displays a list of posts or pages.'). return: {Record<string,string>} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
initialPosition(state = null, action) X-Ref |
Reducer returning the initial block selection. Currently this in only used to restore the selection after block deletion and pasting new content.This reducer should eventually be removed in favour of setting selection directly. return: {number|null} Initial position: 0, -1 or null. param: {boolean} state Current state. param: {Object} action Dispatched action. |
blocksMode(state = {}, action) X-Ref |
No description |
insertionPoint(state = null, action) X-Ref |
Reducer returning the block insertion point visibility, either null if there is not an explicit insertion point assigned, or an object of its `index` and `rootClientId`. return: {Object} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
template(state = {isValid: true}, action) X-Ref |
Reducer returning whether the post blocks match the defined template or not. return: {boolean} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
settings(state = SETTINGS_DEFAULTS, action) X-Ref |
Reducer returning the editor setting. return: {Object} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
preferences(state = PREFERENCES_DEFAULTS, action) X-Ref |
Reducer returning the user preferences. return: {string} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
editorMode(state = 'edit', action) X-Ref |
Reducer returning which mode is enabled. return: {string} Updated state. param: {string} state Current state. param: {Object} action Dispatched action. |
hasBlockMovingClientId(state = null, action) X-Ref |
Reducer returning whether the block moving mode is enabled or not. return: {string|null} Updated state. param: {string|null} state Current state. param: {Object} action Dispatched action. |
lastBlockAttributesChange(state = null, action) X-Ref |
Reducer return an updated state representing the most recent block attribute update. The state is structured as an object where the keys represent the client IDs of blocks, the values a subset of attributes from the most recent block update. The state is always reset to null if the last action is anything other than an attributes update. return: {[string,Object]} Updated state. param: {Object<string,Object>} state Current state. param: {Object} action Action object. |
highlightedBlock(state, action) X-Ref |
Reducer returning current highlighted block. return: {string} Updated state. param: {boolean} state Current highlighted block. param: {Object} action Dispatched action. |
lastBlockInserted(state = {}, action) X-Ref |
Reducer returning the block insertion event list state. return: {Object} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
temporarilyEditingAsBlocks(state = '', action) X-Ref |
Reducer returning the block that is eding temporarily edited as blocks. return: {Object} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
temporarilyEditingFocusModeRevert(state = '', action) X-Ref |
Reducer returning the focus mode that should be used when temporarily edit as blocks finishes. return: {Object} Updated state. param: {Object} state Current state. param: {Object} action Dispatched action. |
blockEditingModes(state = new Map() X-Ref |
Reducer returning a map of block client IDs to block editing modes. return: {Map} Updated state. param: {Map} state Current state. param: {Object} action Dispatched action. |
openedBlockSettingsMenu(state = null, action) X-Ref |
Reducer returning the clientId of the block settings menu that is currently open. return: {string|null} Updated state. param: {string|null} state Current state. param: {Object} action Dispatched action. |
styleOverrides(state = new Map() X-Ref |
Reducer returning a map of style IDs to style overrides. return: {Map} Updated state. param: {Map} state Current state. param: {Object} action Dispatched action. |
registeredInserterMediaCategories(state = [], action) X-Ref |
Reducer returning a map of the registered inserter media categories. return: {Array} Updated state. param: {Array} state Current state. param: {Object} action Dispatched action. |
lastFocus(state = false, action) X-Ref |
Reducer setting last focused element return: {boolean} Updated state. param: {boolean} state Current state. param: {Object} action Dispatched action. |
withAutomaticChangeReset(reducer) X-Ref |
No description |
arrayOf(value) X-Ref |
Returns the first argument as the sole entry in an array. return: {[T]} Value returned as entry in array. param: {T} value Value to return. |
isObjectLike(value) X-Ref |
Returns true if the value passed is object-like, or false otherwise. A value is object-like if it can support property assignment, e.g. object or array. return: {boolean} Whether value is object-like. param: {*} value Value to test. |
createCache() X-Ref |
Creates and returns a new cache object. return: {Cache} Cache object. |
isShallowEqual(a, b, fromIndex) X-Ref |
Returns true if entries within the two arrays are strictly equal by reference from a starting index. return: {boolean} Whether arrays are shallowly equal. param: {*[]} a First array. param: {*[]} b Second array. param: {number} fromIndex Index from which to start comparison. |
rememo(selector, getDependants) X-Ref |
Returns a memoized selector function. The getDependants function argument is called before the memoized selector and is expected to return an immutable reference or array of references on which the selector depends for computing its own return value. The memoize cache is preserved only as long as those dependant references remain the same. If getDependants returns a different reference(s), the cache is cleared and the selector value regenerated. param: {S} selector Selector function. param: {GetDependants=} getDependants Dependant getter returning an array of |
getCache(dependants) X-Ref |
Returns the cache for a given dependants array. When possible, a WeakMap will be used to create a unique cache for each set of dependants. This is feasible due to the nature of WeakMap in allowing garbage collection to occur on entries where the key object is no longer referenced. Since WeakMap requires the key to be an object, this is only possible when the dependant is object-like. The root cache is created as a hierarchy where each top-level key is the first entry in a dependants set, the value a WeakMap where each key is the next dependant, and so on. This continues so long as the dependants are object-like. If no dependants are object- like, then the cache is shared across all invocations. return: {Cache} Cache object. param: {*[]} dependants Selector dependants. |
clear() X-Ref |
Resets root memoization cache. |
callSelector() X-Ref |
The augmented selector call, considering first whether dependants have changed before passing it to underlying memoize function. return: {*} Selector result. param: {*} source Source object for derivation. param: {...*} extraArgs Additional arguments to pass to selector. |
orderBy(items, field, order = 'asc') X-Ref |
Order items by a certain key. Supports decorator functions that allow complex picking of a comparison field. Sorts in ascending order by default, but supports descending as well. Stable sort - maintains original order of equal items. return: {Array} Sorted items. param: {Array} items Items to order. param: {string|Function} field Field to order by. param: {string} order Sorting order, `asc` or `desc`. |
getBlockName(state, clientId) X-Ref |
Returns a block's name given its client ID, or null if no block exists with the client ID. return: {string} Block name. param: {Object} state Editor state. param: {string} clientId Block client ID. |
isBlockValid(state, clientId) X-Ref |
Returns whether a block is valid or not. return: {boolean} Is Valid. param: {Object} state Editor state. param: {string} clientId Block client ID. |
getBlockAttributes(state, clientId) X-Ref |
Returns a block's attributes given its client ID, or null if no block exists with the client ID. return: {Object?} Block attributes. param: {Object} state Editor state. param: {string} clientId Block client ID. |
getBlock(state, clientId) X-Ref |
Returns a block given its client ID. This is a parsed copy of the block, containing its `blockName`, `clientId`, and current `attributes` state. This is not the block's registration settings, which must be retrieved from the blocks module registration store. getBlock recurses through its inner blocks until all its children blocks have been retrieved. Note that getBlock will not return the child inner blocks of an inner block controller. This is because an inner block controller syncs itself with its own entity, and should therefore not be included with the blocks of a different entity. For example, say you call `getBlocks( TP )` to get the blocks of a template part. If another template part is a child of TP, then the nested template part's child blocks will not be returned. This way, the template block itself is considered part of the parent, but the children are not. return: {Object} Parsed block object. param: {Object} state Editor state. param: {string} clientId Block client ID. |
getBlocks(state, rootClientId) X-Ref |
Returns all block objects for the current post being edited as an array in the order they appear in the post. Note that this will exclude child blocks of nested inner block controllers. return: {Object[]} Post blocks. param: {Object} state Editor state. param: {?string} rootClientId Optional root client ID of block list. |
__experimentalGetGlobalBlocksByName(state, blockName) X-Ref |
Returns all global blocks that match a blockName. Results include nested blocks. return: {Array} Array of clientIds of blocks with name equal to blockName. param: {Object} state Global application state. param: {?string} blockName Optional block name, if not specified, returns an empty array. |
getBlockCount(state, rootClientId) X-Ref |
Returns the number of blocks currently present in the post. return: {number} Number of blocks in the post. param: {Object} state Editor state. param: {?string} rootClientId Optional root client ID of block list. |
getSelectionStart(state) X-Ref |
Returns the current selection start block client ID, attribute key and text offset. return: {WPBlockSelection} Selection start information. param: {Object} state Block editor state. |
getSelectionEnd(state) X-Ref |
Returns the current selection end block client ID, attribute key and text offset. return: {WPBlockSelection} Selection end information. param: {Object} state Block editor state. |
getBlockSelectionStart(state) X-Ref |
Returns the current block selection start. This value may be null, and it may represent either a singular block selection or multi-selection start. A selection is singular if its start and end match. return: {?string} Client ID of block selection start. param: {Object} state Global application state. |
getBlockSelectionEnd(state) X-Ref |
Returns the current block selection end. This value may be null, and it may represent either a singular block selection or multi-selection end. A selection is singular if its start and end match. return: {?string} Client ID of block selection end. param: {Object} state Global application state. |
getSelectedBlockCount(state) X-Ref |
Returns the number of blocks currently selected in the post. return: {number} Number of blocks selected in the post. param: {Object} state Global application state. |
hasSelectedBlock(state) X-Ref |
Returns true if there is a single selected block, or false otherwise. return: {boolean} Whether a single block is selected. param: {Object} state Editor state. |
getSelectedBlockClientId(state) X-Ref |
Returns the currently selected block client ID, or null if there is no selected block. return: {?string} Selected block client ID. param: {Object} state Editor state. |
getSelectedBlock(state) X-Ref |
Returns the currently selected block, or null if there is no selected block. return: {?Object} Selected block. param: {Object} state Global application state. |
getBlockRootClientId(state, clientId) X-Ref |
Given a block client ID, returns the root block from which the block is nested, an empty string for top-level blocks, or null if the block does not exist. return: {?string} Root client ID, if exists param: {Object} state Editor state. param: {string} clientId Block from which to find root client ID. |
getBlockHierarchyRootClientId(state, clientId) X-Ref |
Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks. return: {string} Root client ID param: {Object} state Editor state. param: {string} clientId Block from which to find root client ID. |
getLowestCommonAncestorWithSelectedBlock(state, clientId) X-Ref |
Given a block client ID, returns the lowest common ancestor with selected client ID. return: {string} Common ancestor client ID or undefined param: {Object} state Editor state. param: {string} clientId Block from which to find common ancestor client ID. |
getAdjacentBlockClientId(state, startClientId, modifier = 1) X-Ref |
Returns the client ID of the block adjacent one at the given reference startClientId and modifier directionality. Defaults start startClientId to the selected block, and direction as next block. Returns null if there is no adjacent block. return: {?string} Return the client ID of the block, or null if none exists. param: {Object} state Editor state. param: {?string} startClientId Optional client ID of block from which to param: {?number} modifier Directionality multiplier (1 next, -1 |
getPreviousBlockClientId(state, startClientId) X-Ref |
Returns the previous block's client ID from the given reference start ID. Defaults start to the selected block. Returns null if there is no previous block. return: {?string} Adjacent block's client ID, or null if none exists. param: {Object} state Editor state. param: {?string} startClientId Optional client ID of block from which to |
getNextBlockClientId(state, startClientId) X-Ref |
Returns the next block's client ID from the given reference start ID. Defaults start to the selected block. Returns null if there is no next block. return: {?string} Adjacent block's client ID, or null if none exists. param: {Object} state Editor state. param: {?string} startClientId Optional client ID of block from which to |
getSelectedBlocksInitialCaretPosition(state) X-Ref |
Returns the initial caret position for the selected block. This position is to used to position the caret properly when the selected block changes. If the current block is not a RichText, having initial position set to 0 means "focus block" return: {0|-1|null} Initial position. param: {Object} state Global application state. |
getMultiSelectedBlockClientIds(state) X-Ref |
Returns the current multi-selection set of block client IDs, or an empty array if there is no multi-selection. return: {Array} Multi-selected block client IDs. param: {Object} state Editor state. |
getFirstMultiSelectedBlockClientId(state) X-Ref |
Returns the client ID of the first block in the multi-selection set, or null if there is no multi-selection. return: {?string} First block client ID in the multi-selection set. param: {Object} state Editor state. |
getLastMultiSelectedBlockClientId(state) X-Ref |
Returns the client ID of the last block in the multi-selection set, or null if there is no multi-selection. return: {?string} Last block client ID in the multi-selection set. param: {Object} state Editor state. |
isFirstMultiSelectedBlock(state, clientId) X-Ref |
Returns true if a multi-selection exists, and the block corresponding to the specified client ID is the first block of the multi-selection set, or false otherwise. return: {boolean} Whether block is first in multi-selection. param: {Object} state Editor state. param: {string} clientId Block client ID. |
isBlockMultiSelected(state, clientId) X-Ref |
Returns true if the client ID occurs within the block multi-selection, or false otherwise. return: {boolean} Whether block is in multi-selection set. param: {Object} state Editor state. param: {string} clientId Block client ID. |
getMultiSelectedBlocksStartClientId(state) X-Ref |
Returns the client ID of the block which begins the multi-selection set, or null if there is no multi-selection. This is not necessarily the first client ID in the selection. return: {?string} Client ID of block beginning multi-selection. param: {Object} state Editor state. |
getMultiSelectedBlocksEndClientId(state) X-Ref |
Returns the client ID of the block which ends the multi-selection set, or null if there is no multi-selection. This is not necessarily the last client ID in the selection. return: {?string} Client ID of block ending multi-selection. param: {Object} state Editor state. |
__unstableIsFullySelected(state) X-Ref |
Returns true if the selection is not partial. return: {boolean} Whether the selection is mergeable. param: {Object} state Editor state. |
__unstableIsSelectionCollapsed(state) X-Ref |
Returns true if the selection is collapsed. return: {boolean} Whether the selection is collapsed. param: {Object} state Editor state. |
__unstableSelectionHasUnmergeableBlock(state) X-Ref |
No description |
__unstableIsSelectionMergeable(state, isForward) X-Ref |
Check whether the selection is mergeable. return: {boolean} Whether the selection is mergeable. param: {Object} state Editor state. param: {boolean} isForward Whether to merge forwards. |
getBlockOrder(state, rootClientId) X-Ref |
Returns an array containing all block client IDs in the editor in the order they appear. Optionally accepts a root client ID of the block list for which the order should be returned, defaulting to the top-level block order. return: {Array} Ordered client IDs of editor blocks. param: {Object} state Editor state. param: {?string} rootClientId Optional root client ID of block list. |
getBlockIndex(state, clientId) X-Ref |
Returns the index at which the block corresponding to the specified client ID occurs within the block order, or `-1` if the block does not exist. return: {number} Index at which block exists in order. param: {Object} state Editor state. param: {string} clientId Block client ID. |
isBlockSelected(state, clientId) X-Ref |
Returns true if the block corresponding to the specified client ID is currently selected and no multi-selection exists, or false otherwise. return: {boolean} Whether block is selected and multi-selection exists. param: {Object} state Editor state. param: {string} clientId Block client ID. |
hasSelectedInnerBlock(state, clientId, deep = false) X-Ref |
Returns true if one of the block's inner blocks is selected. return: {boolean} Whether the block has an inner block selected param: {Object} state Editor state. param: {string} clientId Block client ID. param: {boolean} deep Perform a deep check. |
hasDraggedInnerBlock(state, clientId, deep = false) X-Ref |
Returns true if one of the block's inner blocks is dragged. return: {boolean} Whether the block has an inner block dragged param: {Object} state Editor state. param: {string} clientId Block client ID. param: {boolean} deep Perform a deep check. |
isBlockWithinSelection(state, clientId) X-Ref |
Returns true if the block corresponding to the specified client ID is currently selected but isn't the last of the selected blocks. Here "last" refers to the block sequence in the document, _not_ the sequence of multi-selection, which is why `state.selectionEnd` isn't used. return: {boolean} Whether block is selected and not the last in the param: {Object} state Editor state. param: {string} clientId Block client ID. |
hasMultiSelection(state) X-Ref |
Returns true if a multi-selection has been made, or false otherwise. return: {boolean} Whether multi-selection has been made. param: {Object} state Editor state. |
selectors_isMultiSelecting(state) X-Ref |
Whether in the process of multi-selecting or not. This flag is only true while the multi-selection is being selected (by mouse move), and is false once the multi-selection has been settled. return: {boolean} True if multi-selecting, false if not. param: {Object} state Global application state. |
selectors_isSelectionEnabled(state) X-Ref |
Selector that returns if multi-selection is enabled or not. return: {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled. param: {Object} state Global application state. |
getBlockMode(state, clientId) X-Ref |
Returns the block's editing mode, defaulting to "visual" if not explicitly assigned. return: {Object} Block editing mode. param: {Object} state Editor state. param: {string} clientId Block client ID. |
selectors_isTyping(state) X-Ref |
Returns true if the user is typing, or false otherwise. return: {boolean} Whether user is typing. param: {Object} state Global application state. |
isDraggingBlocks(state) X-Ref |
Returns true if the user is dragging blocks, or false otherwise. return: {boolean} Whether user is dragging blocks. param: {Object} state Global application state. |
getDraggedBlockClientIds(state) X-Ref |
Returns the client ids of any blocks being directly dragged. This does not include children of a parent being dragged. return: {string[]} Array of dragged block client ids. param: {Object} state Global application state. |
isBlockBeingDragged(state, clientId) X-Ref |
Returns whether the block is being dragged. Only returns true if the block is being directly dragged, not if the block is a child of a parent being dragged. See `isAncestorBeingDragged` for child blocks. return: {boolean} Whether the block is being dragged. param: {Object} state Global application state. param: {string} clientId Client id for block to check. |
isAncestorBeingDragged(state, clientId) X-Ref |
Returns whether a parent/ancestor of the block is being dragged. return: {boolean} Whether the block's ancestor is being dragged. param: {Object} state Global application state. param: {string} clientId Client id for block to check. |
isCaretWithinFormattedText() X-Ref |
Returns true if the caret is within formatted text, or false otherwise. return: {boolean} Whether the caret is within formatted text. |
isBlockInsertionPointVisible(state) X-Ref |
Returns true if we should show the block insertion point. return: {?boolean} Whether the insertion point is visible or not. param: {Object} state Global application state. |
isValidTemplate(state) X-Ref |
Returns whether the blocks matches the template or not. return: {?boolean} Whether the template is valid or not. param: {boolean} state |
getTemplate(state) X-Ref |
Returns the defined block template return: {?Array} Block Template. param: {boolean} state |
getTemplateLock(state, rootClientId) X-Ref |
Returns the defined block template lock. Optionally accepts a root block client ID as context, otherwise defaulting to the global context. return: {string|false} Block Template Lock param: {Object} state Editor state. param: {?string} rootClientId Optional block root client ID. |
canInsertBlocks(state, clientIds, rootClientId = null) X-Ref |
Determines if the given blocks are allowed to be inserted into the block list. return: {boolean} Whether the given blocks are allowed to be inserted. param: {Object} state Editor state. param: {string} clientIds The block client IDs to be inserted. param: {?string} rootClientId Optional root client ID of block list. |
canRemoveBlock(state, clientId, rootClientId = null) X-Ref |
Determines if the given block is allowed to be deleted. return: {boolean} Whether the given block is allowed to be removed. param: {Object} state Editor state. param: {string} clientId The block client Id. param: {?string} rootClientId Optional root client ID of block list. |
canRemoveBlocks(state, clientIds, rootClientId = null) X-Ref |
Determines if the given blocks are allowed to be removed. return: {boolean} Whether the given blocks are allowed to be removed. param: {Object} state Editor state. param: {string} clientIds The block client IDs to be removed. param: {?string} rootClientId Optional root client ID of block list. |
canMoveBlock(state, clientId, rootClientId = null) X-Ref |
Determines if the given block is allowed to be moved. return: {boolean | undefined} Whether the given block is allowed to be moved. param: {Object} state Editor state. param: {string} clientId The block client Id. param: {?string} rootClientId Optional root client ID of block list. |
canMoveBlocks(state, clientIds, rootClientId = null) X-Ref |
Determines if the given blocks are allowed to be moved. return: {boolean} Whether the given blocks are allowed to be moved. param: {Object} state Editor state. param: {string} clientIds The block client IDs to be moved. param: {?string} rootClientId Optional root client ID of block list. |
canEditBlock(state, clientId) X-Ref |
Determines if the given block is allowed to be edited. return: {boolean} Whether the given block is allowed to be edited. param: {Object} state Editor state. param: {string} clientId The block client Id. |
canLockBlockType(state, nameOrType) X-Ref |
Determines if the given block type can be locked/unlocked by a user. return: {boolean} Whether a given block type can be locked/unlocked. param: {Object} state Editor state. param: {(string|Object)} nameOrType Block name or type object. |
getInsertUsage(state, id) X-Ref |
Returns information about how recently and frequently a block has been inserted. return: {?{ time: number, count: number }} An object containing `time` which is when the last param: {Object} state Global application state. param: {string} id A string which identifies the insert, e.g. 'core/block/12' |
getBlockListSettings(state, clientId) X-Ref |
Returns the Block List settings of a block, if any exist. return: {?Object} Block settings of the block if set. param: {Object} state Editor state. param: {?string} clientId Block client ID. |
getSettings(state) X-Ref |
Returns the editor settings. return: {Object} The editor settings object. param: {Object} state Editor state. |
isLastBlockChangePersistent(state) X-Ref |
Returns true if the most recent block change is be considered persistent, or false otherwise. A persistent change is one committed by BlockEditorProvider via its `onChange` callback, in addition to `onInput`. return: {boolean} Whether the most recent block change was persistent. param: {Object} state Block editor state. |
__unstableIsLastBlockChangeIgnored(state) X-Ref |
Returns true if the most recent block change is be considered ignored, or false otherwise. An ignored change is one not to be committed by BlockEditorProvider, neither via `onChange` nor `onInput`. return: {boolean} Whether the most recent block change was ignored. param: {Object} state Block editor state. |
__experimentalGetLastBlockAttributeChanges(state) X-Ref |
Returns the block attributes changed as a result of the last dispatched action. return: {Object<string,Object>} Subsets of block attributes changed, keyed param: {Object} state Block editor state. |
getReusableBlocks(state) X-Ref |
Returns the available reusable blocks return: {Array} Reusable blocks param: {Object} state Global application state. |
isNavigationMode(state) X-Ref |
Returns whether the navigation mode is enabled. return: {boolean} Is navigation mode enabled. param: {Object} state Editor state. |
__unstableGetEditorMode(state) X-Ref |
Returns the current editor mode. return: {string} the editor mode. param: {Object} state Editor state. |
selectors_hasBlockMovingClientId(state) X-Ref |
Returns whether block moving mode is enabled. return: {string} Client Id of moving block. param: {Object} state Editor state. |
didAutomaticChange(state) X-Ref |
Returns true if the last change was an automatic change, false otherwise. return: {boolean} Whether the last change was automatic. param: {Object} state Global application state. |
isBlockHighlighted(state, clientId) X-Ref |
Returns true if the current highlighted block matches the block clientId. return: {boolean} Whether the block is currently highlighted. param: {Object} state Global application state. param: {string} clientId The block to check. |
areInnerBlocksControlled(state, clientId) X-Ref |
Checks if a given block has controlled inner blocks. return: {boolean} True if the block has controlled inner blocks. param: {Object} state Global application state. param: {string} clientId The block to check. |
wasBlockJustInserted(state, clientId, source) X-Ref |
Tells if the block with the passed clientId was just inserted. return: {boolean} True if the block matches the last block inserted from the specified source. param: {Object} state Global application state. param: {Object} clientId Client Id of the block. param: {?string} source Optional insertion source of the block. |
isBlockVisible(state, clientId) X-Ref |
Tells if the block is visible on the canvas or not. return: {boolean} True if the block is visible. param: {Object} state Global application state. param: {Object} clientId Client Id of the block. |
__unstableGetTemporarilyEditingAsBlocks(state) X-Ref |
DO-NOT-USE in production. This selector is created for internal/experimental only usage and may be removed anytime without any warning, causing breakage on any plugin or theme invoking it. param: {Object} state Global application state. |
__unstableGetTemporarilyEditingFocusModeToRevert(state) X-Ref |
DO-NOT-USE in production. This selector is created for internal/experimental only usage and may be removed anytime without any warning, causing breakage on any plugin or theme invoking it. param: {Object} state Global application state. |
__unstableHasActiveBlockOverlayActive(state, clientId) X-Ref |
No description |
__unstableIsWithinBlockOverlay(state, clientId) X-Ref |
No description |
__experimentalUpdateSettings(settings, {stripExperimentalSettings = false,reset = false} = {}) X-Ref |
Action that updates the block editor settings and conditionally preserves the experimental ones. return: {Object} Action object param: {Object} settings Updated settings param: {Object} options Options object. param: {boolean} options.stripExperimentalSettings Whether to strip experimental settings. param: {boolean} options.reset Whether to reset the settings. |
hideBlockInterface() X-Ref |
Hides the block interface (eg. toolbar, outline, etc.) return: {Object} Action object. |
showBlockInterface() X-Ref |
Shows the block interface (eg. toolbar, outline, etc.) return: {Object} Action object. |
displayBlockRemovalPrompt(clientIds, selectPrevious, blockNamesForPrompt, messageType) X-Ref |
Returns an action object used in signalling that a block removal prompt must be displayed. Contrast with `setBlockRemovalRules`. return: {Object} Action object. param: {string|string[]} clientIds Client IDs of blocks to remove. param: {boolean} selectPrevious True if the previous block param: {string[]} blockNamesForPrompt Names of the blocks that param: {string} messageType The type of message to display. |
clearBlockRemovalPrompt() X-Ref |
Returns an action object used in signalling that a block removal prompt must be cleared, either be cause the user has confirmed or canceled the request for removal. return: {Object} Action object. |
setBlockRemovalRules(rules = false) X-Ref |
Returns an action object used to set up any rules that a block editor may provide in order to prevent a user from accidentally removing certain blocks. These rules are then used to display a confirmation prompt to the user. For instance, in the Site Editor, the Query Loop block is important enough to warrant such confirmation. IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks` action that the editor will be responsible for displaying block removal prompts and confirming deletions. This action is meant to be used by component `BlockRemovalWarningModal` only. The data is a record whose keys are block types (e.g. 'core/query') and whose values are the explanation to be shown to users (e.g. 'Query Loop displays a list of posts or pages.'). Contrast with `displayBlockRemovalPrompt`. return: {Object} Action object. param: {Record<string,string>|false} rules Block removal rules. |
setOpenedBlockSettingsMenu(clientId) X-Ref |
Sets the client ID of the block settings menu that is currently open. return: {Object} Action object. param: {?string} clientId The block client ID. |
setStyleOverride(id, style) X-Ref |
No description |
deleteStyleOverride(id) X-Ref |
No description |
syncDerivedUpdates(callback) X-Ref |
A higher-order action that mark every change inside a callback as "non-persistent" and ignore pushing to the undo history stack. It's primarily used for synchronized derived updates from the block editor without affecting the undo history. param: {() => void} callback The synchronous callback to derive updates. |
setLastFocus(lastFocus = null) X-Ref |
Action that sets the element that had focus when focus leaves the editor canvas. return: {Object} Action object. param: {Object} lastFocus The last focused element. |
stopEditingAsBlocks(clientId) X-Ref |
Action that stops temporarily editing as blocks. param: {string} clientId The block's clientId. |
startDragging() X-Ref |
Returns an action object used in signalling that the user has begun to drag. return: {Object} Action object. |
stopDragging() X-Ref |
Returns an action object used in signalling that the user has stopped dragging. return: {Object} Action object. |
isPatternFiltered(pattern, sourceFilter, syncFilter) X-Ref |
No description |
setImmutably(object, path, value) X-Ref |
Immutably sets a value inside an object. Like `lodash#set`, but returning a new object. Treats nullish initial values as empty objects. Clones any nested objects. Supports arrays, too. return: {Object} Cloned object with the new value set. param: {Object} object Object to set a value in. param: {number|string|Array} path Path in the object to modify. param: {*} value New value to set. |
mergeOrigins(value) X-Ref |
For settings like `color.palette`, which have a value that is an object with `default`, `theme`, `custom`, with field values that are arrays of items, merge these three arrays into one and return it. The calculation is memoized so that identical input values produce identical output. return: {Array} Array of merged items param: {Object} value Object to merge |
overrideOrigins(value) X-Ref |
For settings like `color.palette`, which have a value that is an object with `default`, `theme`, `custom`, with field values that are arrays of items, returns the one with the highest priority among these three arrays. return: {Array} Array of items extracted from the three origins param: {Object} value Object to extract from |
hasOriginValue(value) X-Ref |
For settings like `color.palette`, which have a value that is an object with `default`, `theme`, `custom`, with field values that are arrays of items, see if any of the three origins have values. return: {boolean} Whether the object has values in any of the three origins param: {Object} value Object to check |
getBlockSettings(state, clientId, ...paths) X-Ref |
No description |
private_selectors_isBlockInterfaceHidden(state) X-Ref |
Returns true if the block interface is hidden, or false otherwise. return: {boolean} Whether the block toolbar is hidden. param: {Object} state Global application state. |
getLastInsertedBlocksClientIds(state) X-Ref |
Gets the client ids of the last inserted blocks. return: {Array|undefined} Client Ids of the last inserted block(s). param: {Object} state Global application state. |
getBlockWithoutAttributes(state, clientId) X-Ref |
No description |
getEnabledClientIdsTreeUnmemoized(state, rootClientId) X-Ref |
No description |
getRemovalPromptData(state) X-Ref |
Selector that returns the data needed to display a prompt when certain blocks are removed, or `false` if no such prompt is requested. return: {Object|false} Data for removal prompt display, if any. param: {Object} state Global application state. |
getBlockRemovalRules(state) X-Ref |
Returns true if removal prompt exists, or false otherwise. return: {boolean} Whether removal prompt exists. param: {Object} state Global application state. |
getOpenedBlockSettingsMenu(state) X-Ref |
Returns the client ID of the block settings menu that is currently open. return: {string|null} The client ID of the block menu that is currently open. param: {Object} state Global application state. |
getStyleOverrides(state) X-Ref |
Returns all style overrides, intended to be merged with global editor styles. return: {Map} A map of style IDs to style overrides. param: {Object} state Global application state. |
getRegisteredInserterMediaCategories(state) X-Ref |
Returns the registered inserter media categories through the public API. return: {InserterMediaCategory[]} Inserter media categories. param: {Object} state Editor state. |
getLastFocus(state) X-Ref |
Returns the element of the last element that had focus when focus left the editor canvas. return: {Object} Element. param: {Object} state Block editor state. |
private_selectors_isDragging(state) X-Ref |
Returns true if the user is dragging anything, or false otherwise. It is possible for a user to be dragging data from outside of the editor, so this selector is separate from the `isDraggingBlocks` selector which only returns true if the user is dragging blocks. return: {boolean} Whether user is dragging. param: {Object} state Global application state. |
retrieveSelectedAttribute(blockAttributes) X-Ref |
Retrieve the block attribute that contains the selection position. return: {string|void} The name of the block attribute that was previously selected. param: {Object} blockAttributes Block attributes. |
resetSelection(selectionStart, selectionEnd, initialPosition) X-Ref |
Returns an action object used in signalling that selection state should be reset to the specified selection. return: {Object} Action object. param: {WPBlockSelection} selectionStart The selection start. param: {WPBlockSelection} selectionEnd The selection end. param: {0|-1|null} initialPosition Initial block position. |
receiveBlocks(blocks) X-Ref |
Returns an action object used in signalling that blocks have been received. Unlike resetBlocks, these should be appended to the existing known set, not replacing. return: {Object} Action object. param: {Object[]} blocks Array of block objects. |
updateBlockAttributes(clientIds, attributes, uniqueByBlock = false) X-Ref |
Action that updates attributes of multiple blocks with the specified client IDs. return: {Object} Action object. param: {string|string[]} clientIds Block client IDs. param: {Object} attributes Block attributes to be merged. Should be keyed by clientIds if param: {boolean} uniqueByBlock true if each block in clientIds array has a unique set of attributes |
updateBlock(clientId, updates) X-Ref |
Action that updates the block with the specified client ID. return: {Object} Action object. param: {string} clientId Block client ID. param: {Object} updates Block attributes to be merged. |
selectBlock(clientId, initialPosition = 0) X-Ref |
Returns an action object used in signalling that the block with the specified client ID has been selected, optionally accepting a position value reflecting its selection directionality. An initialPosition of -1 reflects a reverse selection. return: {Object} Action object. param: {string} clientId Block client ID. param: {0|-1|null} initialPosition Optional initial position. Pass as -1 to |
startMultiSelect() X-Ref |
Action that starts block multi-selection. return: {Object} Action object. |
stopMultiSelect() X-Ref |
Action that stops block multi-selection. return: {Object} Action object. |
clearSelectedBlock() X-Ref |
Action that clears the block selection. return: {Object} Action object. |
toggleSelection(isSelectionEnabled = true) X-Ref |
Action that enables or disables block selection. return: {Object} Action object. param: {boolean} [isSelectionEnabled=true] Whether block selection should |
getBlocksWithDefaultStylesApplied(blocks, blockEditorSettings) X-Ref |
No description |
replaceBlock(clientId, block) X-Ref |
Action that replaces a single block with one or more replacement blocks. return: {Object} Action object. param: {(string|string[])} clientId Block client ID to replace. param: {(Object|Object[])} block Replacement block(s). |
moveBlockToPosition(clientId, fromRootClientId = '', toRootClientId = '', index) X-Ref |
Action that moves given block to a new position. param: {?string} clientId The client ID of the block. param: {?string} fromRootClientId Root client ID source. param: {?string} toRootClientId Root client ID destination. param: {number} index The index to move the block to. |
insertBlock(block, index, rootClientId, updateSelection, meta) X-Ref |
Action that inserts a single block, optionally at a specific index respective a root block list. Only allowed blocks are inserted. The action may fail silently for blocks that are not allowed or if a templateLock is active on the block list. return: {Object} Action object. param: {Object} block Block object to insert. param: {?number} index Index at which block should be inserted. param: {?string} rootClientId Optional root client ID of block list on which to insert. param: {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true. param: {?Object} meta Optional Meta values to be passed to the action object. |
showInsertionPoint(rootClientId, index, __unstableOptions = {}) X-Ref |
Action that shows the insertion point. return: {Object} Action object. param: {?string} rootClientId Optional root client ID of block list on param: {?number} index Index at which block should be inserted. param: {?Object} __unstableOptions Additional options. |
setTemplateValidity(isValid) X-Ref |
Action that resets the template validity. return: {Object} Action object. param: {boolean} isValid template validity flag. |
removeBlock(clientId, selectPrevious) X-Ref |
Returns an action object used in signalling that the block with the specified client ID is to be removed. return: {Object} Action object. param: {string} clientId Client ID of block to remove. param: {boolean} selectPrevious True if the previous block should be |
replaceInnerBlocks(rootClientId, blocks, updateSelection = false, initialPosition = 0) X-Ref |
Returns an action object used in signalling that the inner blocks with the specified client ID should be replaced. return: {Object} Action object. param: {string} rootClientId Client ID of the block whose InnerBlocks will re replaced. param: {Object[]} blocks Block objects to insert as new InnerBlocks param: {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to false. param: {0|-1|null} initialPosition Initial block position. |
toggleBlockMode(clientId) X-Ref |
Returns an action object used to toggle the block editing mode between visual and HTML modes. return: {Object} Action object. param: {string} clientId Block client ID. |
startTyping() X-Ref |
Returns an action object used in signalling that the user has begun to type. return: {Object} Action object. |
stopTyping() X-Ref |
Returns an action object used in signalling that the user has stopped typing. return: {Object} Action object. |
startDraggingBlocks(clientIds = []) X-Ref |
Returns an action object used in signalling that the user has begun to drag blocks. return: {Object} Action object. param: {string[]} clientIds An array of client ids being dragged |
stopDraggingBlocks() X-Ref |
Returns an action object used in signalling that the user has stopped dragging blocks. return: {Object} Action object. |
enterFormattedText() X-Ref |
Returns an action object used in signalling that the caret has entered formatted text. return: {Object} Action object. |
exitFormattedText() X-Ref |
Returns an action object used in signalling that the user caret has exited formatted text. return: {Object} Action object. |
selectionChange(clientId, attributeKey, startOffset, endOffset) X-Ref |
Action that changes the position of the user caret. return: {Object} Action object. param: {string|WPSelection} clientId The selected block client ID. param: {string} attributeKey The selected block attribute key. param: {number} startOffset The start offset. param: {number} endOffset The end offset. |
updateBlockListSettings(clientId, settings) X-Ref |
Action that changes the nested settings of a given block. return: {Object} Action object param: {string} clientId Client ID of the block whose nested setting are param: {Object} settings Object with the new settings for the nested block. |
updateSettings(settings) X-Ref |
Action that updates the block editor settings. return: {Object} Action object param: {Object} settings Updated settings |
__unstableSaveReusableBlock(id, updatedId) X-Ref |
Action that signals that a temporary reusable block has been saved in order to switch its temporary id with the real id. return: {Object} Action object. param: {string} id Reusable block's id. param: {string} updatedId Updated block's id. |
__unstableMarkLastChangeAsPersistent() X-Ref |
Action that marks the last block change explicitly as persistent. return: {Object} Action object. |
__unstableMarkNextChangeAsNotPersistent() X-Ref |
Action that signals that the next block change should be marked explicitly as not persistent. return: {Object} Action object. |
toggleBlockHighlight(clientId, isHighlighted) X-Ref |
Action that toggles the highlighted block state. param: {string} clientId The block's clientId. param: {boolean} isHighlighted The highlight state. |
setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) X-Ref |
Action that sets whether a block has controlled inner blocks. param: {string} clientId The block's clientId. param: {boolean} hasControlledInnerBlocks True if the block's inner blocks are controlled. |
setBlockVisibility(updates) X-Ref |
Action that sets whether given blocks are visible on the canvas. param: {Record<string,boolean>} updates For each block's clientId, its new visibility setting. |
__unstableSetTemporarilyEditingAsBlocks(temporarilyEditingAsBlocks, focusModeToRevert) X-Ref |
Action that sets whether a block is being temporarily edited as blocks. DO-NOT-USE in production. This action is created for internal/experimental only usage and may be removed anytime without any warning, causing breakage on any plugin or theme invoking it. param: {?string} temporarilyEditingAsBlocks The block's clientId being temporarily edited as blocks. param: {?string} focusModeToRevert The focus mode to revert after temporarily edit as blocks finishes. |
setBlockEditingMode(clientId = '', mode) X-Ref |
Sets the block editing mode for a given block. return: {Object} Action object. param: {string} clientId The block client ID, or `''` for the root container. param: {BlockEditingMode} mode The block editing mode. One of `'disabled'`, |
unsetBlockEditingMode(clientId = '') X-Ref |
Clears the block editing mode for a given block. return: {Object} Action object. param: {string} clientId The block client ID, or `''` for the root container. |
use_settings_useSettings(...paths) X-Ref |
Hook that retrieves the given settings for the block instance in use. It looks up the settings first in the block instance hierarchy. If none are found, it'll look them up in the block editor settings. return: {any[]} Returns the values defined for the settings. param: {string[]} paths The paths to the settings. |
useSetting(path) X-Ref |
Hook that retrieves the given setting for the block instance in use. It looks up the setting first in the block instance hierarchy. If none is found, it'll look it up in the block editor settings. return: {any} Returns the value defined for the setting. param: {string} path The path to the setting. |
getComputedFluidTypographyValue({minimumFontSize,maximumFontSize,fontSize,minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,scaleFactor = DEFAULT_SCALE_FACTOR,minimumFontSizeLimit}) X-Ref |
Computes a fluid font-size value that uses clamp(). A minimum and maximum font size OR a single font size can be specified. If a single font size is specified, it is scaled up and down using a logarithmic scale. return: {string|null} A font-size value using clamp(). param: {Object} args param: {?string} args.minimumViewportWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified. param: {?string} args.maximumViewportWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified. param: {string|number} [args.fontSize] Size to derive maximumFontSize and minimumFontSize from, if necessary. Optional if minimumFontSize and maximumFontSize are specified. param: {?string} args.maximumFontSize Maximum font size for any clamp() calculation. Optional. param: {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional. param: {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional. param: {?string} args.minimumFontSizeLimit The smallest a calculated font size may be. Optional. |
getTypographyValueAndUnit(rawValue, options = {}) X-Ref |
Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ]. A raw font size of `value + unit` is expected. If the value is an integer, it will convert to `value + 'px'`. return: {{ unit: string, value: number }|null} An object consisting of `'value'` and `'unit'` properties. param: {string|number} rawValue Raw size value from theme.json. param: {Object|undefined} options Calculation options. |
roundToPrecision(value, digits = 3) X-Ref |
Returns a value rounded to defined precision. Returns `undefined` if the value is not a valid finite number. return: {number|undefined} Value rounded to standard precision. param: {number} value Raw value. param: {number} digits The number of digits to appear after the decimal point |
getTypographyFontSizeValue(preset, typographyOptions) X-Ref |
Returns a font-size value based on a given font-size preset. Takes into account fluid typography parameters and attempts to return a css formula depending on available, valid values. return: {string|*} A font-size value or the value of preset.size. param: {Preset} preset param: {Object} typographyOptions param: {boolean|TypographySettings} typographyOptions.fluid Whether fluid typography is enabled, and, optionally, fluid font size options. |
isFluidTypographyEnabled(typographySettings) X-Ref |
No description |
getFluidTypographyOptionsFromSettings(settings) X-Ref |
Returns fluid typography settings from theme.json setting object. return: {TypographySettings} Fluid typography settings param: {Object} settings Theme.json settings param: {Object} settings.typography Theme.json typography settings param: {Object} settings.layout Theme.json layout settings |
findInPresetsBy(features, blockName, presetPath, presetProperty, presetValueValue) X-Ref |
No description |
getPresetVariableFromValue(features, blockName, variableStylePath, presetPropertyValue) X-Ref |
No description |
getValueFromPresetVariable(features, blockName, variable, [presetType, slug]) X-Ref |
No description |
getValueFromCustomVariable(features, blockName, variable, path) X-Ref |
No description |
getValueFromVariable(features, blockName, variable) X-Ref |
Attempts to fetch the value of a theme.json CSS variable. return: {string|*|{ref}} The value of the CSS var, if found. If not found, the passed variable argument. param: {Object} features GlobalStylesContext config, e.g., user, base or merged. Represents the theme.json tree. param: {string} blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/${blockName}' for blocks. param: {string|*} variable An incoming style value. A CSS var value is expected, but it could be any value. |
scopeSelector(scope, selector) X-Ref |
Function that scopes a selector with another one. This works a bit like SCSS nesting except the `&` operator isn't supported. return: {string} Scoped selector. param: {string} scope Selector to scope to. param: {string} selector Original selector. |
appendToSelector(selector, toAppend) X-Ref |
Appends a sub-selector to an existing one. Given the compounded `selector` "h1, h2, h3" and the `toAppend` selector ".some-class" the result will be "h1.some-class, h2.some-class, h3.some-class". return: {string} The new selector. param: {string} selector Original selector. param: {string} toAppend Selector to append. |
areGlobalStyleConfigsEqual(original, variation) X-Ref |
Compares global style variations according to their styles and settings properties. return: {boolean} Whether `original` and `variation` match. param: {Object} original A global styles object. param: {Object} variation A global styles object. |
getBlockStyleVariationSelector(variation, blockSelector) X-Ref |
Generates the selector for a block style variation by creating the appropriate CSS class and adding it to the ancestor portion of the block's selector. For example, take the Button block which has a compound selector: `.wp-block-button .wp-block-button__link`. With a variation named 'custom', the class `.is-style-custom` should be added to the `.wp-block-button` ancestor only. This function will take into account comma separated and complex selectors. return: {string} CSS selector for the block style variation. param: {string} variation Name for the variation. param: {string} blockSelector CSS selector for the block. |
useGlobalSetting(propertyPath, blockName, source = 'all') X-Ref |
No description |
useGlobalStyle(path, blockName, source = 'all', {shouldDecodeEncode = true} = {}) X-Ref |
No description |
useSettingsForBlockElement(parentSettings, blockName, element) X-Ref |
React hook that overrides a global settings object with block and element specific settings. return: {Object} Merge of settings and supports. param: {Object} parentSettings Settings object. param: {blockName?} blockName Block name. param: {element?} element Element name. |
useColorsPerOrigin(settings) X-Ref |
No description |
useGradientsPerOrigin(settings) X-Ref |
No description |
transformStyles(activeSupports, migrationPaths, result, source, index, results) X-Ref |
No description |
shouldSkipSerialization(blockNameOrType, featureSet, feature) X-Ref |
Check whether serialization of specific block support feature or set should be skipped. return: {boolean} Whether serialization should occur. param: {string|Object} blockNameOrType Block name or block type object. param: {string} featureSet Name of block support feature set. param: {string} feature Name of the individual feature to check. |
useStyleOverride({id,css,assets,__unstableType} = {}) X-Ref |
No description |
useBlockSettings(name, parentLayout) X-Ref |
Based on the block and its context, returns an object of all the block settings. This object can be passed as a prop to all the Styles UI components (TypographyPanel, DimensionsPanel...). return: {Object} Settings object. param: {string} name Block name. param: {*} parentLayout Parent layout. |
createBlockEditFilter(features) X-Ref |
No description |
BlockProps({index,useBlockProps,setAllWrapperProps,...props}) X-Ref |
No description |
createBlockListBlockFilter(features) X-Ref |
No description |
createBlockSaveFilter(features) X-Ref |
No description |
extraPropsFromHooks(props, name, attributes) X-Ref |
No description |
migrateLightBlockWrapper(settings) X-Ref |
WordPress dependencies |
useBlockControlsFill(group, shareWithChildBlocks) X-Ref |
Internal dependencies |
BlockControlsFill({group = 'default',controls,children,__experimentalShareWithChildBlocks = false}) X-Ref |
Internal dependencies |
BlockControlsSlot({group = 'default',...props}) X-Ref |
No description |
appendSelectors(selectors, append = '') X-Ref |
Utility to generate the proper CSS selector for layout styles. return: {string} - CSS selector. param: {string} selectors CSS selector, also supports multiple comma-separated selectors. param: {string} append The string to append. |
getBlockGapCSS(selector, layoutDefinitions = LAYOUT_DEFINITIONS, layoutType, blockGapValue) X-Ref |
Get generated blockGap CSS rules based on layout definitions provided in theme.json Falsy values in the layout definition's spacingStyles rules will be swapped out with the provided `blockGapValue`. return: {string} The generated CSS rules. param: {string} selector The CSS selector to target for the generated rules. param: {Object} layoutDefinitions Layout definitions object. param: {string} layoutType The layout type (e.g. `default` or `flex`). param: {string} blockGapValue The current blockGap value to be applied. |
getAlignmentsInfo(layout) X-Ref |
Helper method to assign contextual info to clarify alignment settings. Besides checking if `contentSize` and `wideSize` have a value, we now show this information only if their values are not a `css var`. This needs to change when parsing css variables land. return: {Object} An object with contextual info per alignment. param: {Object} layout The layout object. |
isValueSpacingPreset(value) X-Ref |
Checks is given value is a spacing preset. return: {boolean} Return true if value is string in format var:preset|spacing|. param: {string} value Value to check |
getCustomValueFromPreset(value, spacingSizes) X-Ref |
Converts a spacing preset into a custom value. return: {string} Mapping of the spacing preset to its equivalent custom value. param: {string} value Value to convert param: {Array} spacingSizes Array of the current spacing preset objects |
getPresetValueFromCustomValue(value, spacingSizes) X-Ref |
Converts a custom value to preset value if one can be found. Returns value as-is if no match is found. return: {string} The preset value if it can be found. param: {string} value Value to convert param: {Array} spacingSizes Array of the current spacing preset objects |
getSpacingPresetCssVar(value) X-Ref |
Converts a spacing preset into a custom value. return: {string | undefined} CSS var string for given spacing preset value. param: {string} value Value to convert. |
getSpacingPresetSlug(value) X-Ref |
Returns the slug section of the given spacing preset string. return: {string|undefined} The int value of the slug from given spacing preset. param: {string} value Value to extract slug from. |
getSliderValueFromPreset(presetValue, spacingSizes) X-Ref |
Converts spacing preset value into a Range component value . return: {number} The int value for use in Range control. param: {string} presetValue Value to convert to Range value. param: {Array} spacingSizes Array of current spacing preset value objects. |
mode(arr) X-Ref |
Gets an items with the most occurrence within an array https://stackoverflow.com/a/20762713 return: {any} The item with the most occurrences. param: {Array<any>} arr Array of items to check. |
getAllRawValue(values = {}) X-Ref |
Gets the 'all' input value from values data. return: {string} The most common value from all sides of box. param: {Object} values Box spacing values |
isValuesMixed(values = {}, sides = ALL_SIDES) X-Ref |
Checks to determine if values are mixed. return: {boolean} Whether values are mixed. param: {Object} values Box values. param: {Array} sides Sides that values relate to. |
isValuesDefined(values) X-Ref |
Checks to determine if values are defined. return: {boolean} Whether values are defined. param: {Object} values Box values. |
hasAxisSupport(sides, axis) X-Ref |
Determines whether a particular axis has support. If no axis is specified, this function checks if either axis is supported. return: {boolean} Whether there is support for the specified axis or both axes. param: {Array} sides Supported sides. param: {string} axis Which axis to check. |
getSupportedMenuItems(sides) X-Ref |
Determines which menu options should be included in the SidePicker. return: {Object} Menu options with each option containing label & icon. param: {Array} sides Supported sides. |
hasBalancedSidesSupport(sides = []) X-Ref |
Checks if the supported sides are balanced for each axis. - Horizontal - both left and right sides are supported. - Vertical - both top and bottom are supported. return: {boolean} Whether or not the supported sides are balanced. param: {Array} sides The supported sides which may be axes as well. |
getInitialView(values = {}, sides) X-Ref |
Determines which view the SpacingSizesControl should default to on its first render; Axial, Custom, or Single side. return: {string} View to display. param: {Object} values Current side values. param: {Array} sides Supported sides. |
getGapBoxControlValueFromStyle(blockGapValue) X-Ref |
Returns a BoxControl object value from a given blockGap style value. The string check is for backwards compatibility before Gutenberg supported split gap values (row and column) and the value was a string n + unit. return: {Object|null} A value to pass to the BoxControl component. param: {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}. |
getGapCSSValue(blockGapValue, defaultValue = '0') X-Ref |
Returns a CSS value for the `gap` property from a given blockGap style. return: {string|null} The concatenated gap value (row and column). param: {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}. param: {string?} defaultValue A default gap value. |
BlockVerticalAlignmentUI({value,onChange,controls = DEFAULT_CONTROLS,isCollapsed = true,isToolbar}) X-Ref |
No description |
applyOrUnset(align) X-Ref |
No description |
JustifyContentUI({allowedControls = ['left', 'center', 'right', 'space-between'],isCollapsed = true,onChange,value,popoverProps,isToolbar}) X-Ref |
No description |
FlexLayoutVerticalAlignmentControl({layout,onChange,isToolbar = false}) X-Ref |
No description |
FlexLayoutJustifyContentControl({layout,onChange,isToolbar = false}) X-Ref |
No description |
FlexWrapControl({layout,onChange}) X-Ref |
No description |
OrientationControl({layout,onChange}) X-Ref |
No description |
Icon({icon,size = 24,...props}, ref) X-Ref |
Return an SVG icon. return: {JSX.Element} Icon component param: {IconProps} props icon is the SVG component to render param: {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element. |
GridLayoutMinimumWidthControl({layout,onChange}) X-Ref |
No description |
GridLayoutColumnsControl({layout,onChange}) X-Ref |
No description |
getLayoutType(name = 'default') X-Ref |
Retrieves a layout type by name. return: {Object} Layout type. param: {string} name - The name of the layout type. |
getLayoutTypes() X-Ref |
Retrieves the available layout types. return: {Array} Layout types. |
useLayout() X-Ref |
React hook used to retrieve the layout config. |
LayoutStyle({layout = {},css,...props}) X-Ref |
No description |
useAvailableAlignments(controls = use_available_alignments_DEFAULT_CONTROLS) X-Ref |
No description |
BlockAlignmentUI({value,onChange,controls,isToolbar,isCollapsed = true}) X-Ref |
Internal dependencies |
onChangeAlignment(align) X-Ref |
No description |
useBlockEditingMode(mode) X-Ref |
Allows a block to restrict the user interface that is displayed for editing that block and its inner blocks. return: {BlockEditingMode} The current editing mode. param: {?BlockEditingMode} mode The editing mode to apply. If undefined, the |
getValidAlignments(blockAlign, hasWideBlockSupport = true, hasWideEnabled = true) X-Ref |
Returns the valid alignments. Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not. Exported just for testing purposes, not exported outside the module. return: {string[]} Valid alignments. param: {?boolean|string[]} blockAlign Aligns supported by the block. param: {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise. param: {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise. |
addAttribute(settings) X-Ref |
Filters registered block settings, extending attributes to include `align`. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
BlockEditAlignmentToolbarControlsPure({name: blockName,align,setAttributes}) X-Ref |
No description |
useBlockProps({name,align}) X-Ref |
No description |
addAssignedAlign(props, blockType, attributes) X-Ref |
Override props assigned to save component to inject alignment class name if block supports it. return: {Object} Filtered props applied to save element. param: {Object} props Additional props applied to save element. param: {Object} blockType Block type. param: {Object} attributes Block attributes. |
lock_addAttribute(settings) X-Ref |
Filters registered block settings, extending attributes to include `lock`. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
InspectorControlsFill({children,group = 'default',__experimentalGroup,resetAllFilter}) X-Ref |
Internal dependencies |
RegisterResetAll({resetAllFilter,children}) X-Ref |
No description |
ToolsPanelInspectorControl({children,resetAllFilter,fillProps}) X-Ref |
No description |
BlockSupportToolsPanel({children,group,label}) X-Ref |
No description |
BlockSupportSlotContainer({Slot,fillProps,...props}) X-Ref |
WordPress dependencies |
InspectorControlsSlot({__experimentalGroup,group = 'default',label,fillProps,...props}) X-Ref |
No description |
anchor_addAttribute(settings) X-Ref |
Filters registered block settings, extending attributes with anchor using ID of the first node. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
BlockEditAnchorControlPure({name: blockName,anchor,setAttributes}) X-Ref |
No description |
addSaveProps(extraProps, blockType, attributes) X-Ref |
Override props assigned to save component to inject anchor ID, if block supports anchor. This is only applied if the block's save result is an element and not a markup string. return: {Object} Filtered props applied to save element. param: {Object} extraProps Additional props applied to save element. param: {Object} blockType Block type. param: {Object} attributes Current block attributes. |
aria_label_addAttribute(settings) X-Ref |
Filters registered block settings, extending attributes with ariaLabel using aria-label of the first node. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
aria_label_addSaveProps(extraProps, blockType, attributes) X-Ref |
Override props assigned to save component to inject aria-label, if block supports ariaLabel. This is only applied if the block's save result is an element and not a markup string. return: {Object} Filtered props applied to save element. param: {Object} extraProps Additional props applied to save element. param: {Object} blockType Block type. param: {Object} attributes Current block attributes. |
custom_class_name_addAttribute(settings) X-Ref |
Filters registered block settings, extending attributes to include `className`. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
CustomClassNameControlsPure({className,setAttributes}) X-Ref |
No description |
custom_class_name_addSaveProps(extraProps, blockType, attributes) X-Ref |
Override props assigned to save component to inject the className, if block supports customClassName. This is only applied if the block's save result is an element and not a markup string. return: {Object} Filtered props applied to save element. param: {Object} extraProps Additional props applied to save element. param: {Object} blockType Block type. param: {Object} attributes Current block attributes. |
addTransforms(result, source, index, results) X-Ref |
No description |
addGeneratedClassName(extraProps, blockType) X-Ref |
Override props assigned to save component to inject generated className if block supports it. This is only applied if the block's save result is an element and not a markup string. return: {Object} Filtered props applied to save element. param: {Object} extraProps Additional props applied to save element. param: {Object} blockType Block type. |
MediaUploadCheck({fallback = null,children}) X-Ref |
Internal dependencies |
LinkSettingsDrawer({children,settingsOpen,setSettingsOpen}) X-Ref |
No description |
isFunction(maybeFunc) X-Ref |
Whether the argument is a function. return: {boolean} True if the argument is a function, false otherwise. param: {*} maybeFunc The argument to check. |
SearchItemIcon({isURL,suggestion}) X-Ref |
No description |
addLeadingSlash(url) X-Ref |
Adds a leading slash to a url if it doesn't already have one. return: {string} the url with a leading slash. param: {string} url the url to add a leading slash to. |
removeTrailingSlash(url) X-Ref |
No description |
getURLForDisplay(url) X-Ref |
Prepares a URL for display in the UI. - decodes the URL. - filters it (removes protocol, www, etc.). - truncates it if necessary. - adds a leading slash. return: {string} the processed url to display. param: {string} url the url. |
getVisualTypeName(suggestion) X-Ref |
No description |
LinkControlSearchResults({instanceId,withCreateSuggestion,currentInputValue,handleSuggestionClick,suggestionsListProps,buildSuggestionItemProps,suggestions,selectedSuggestion,isLoading,isInitialSuggestions,createSuggestionButtonText,suggestionsQuery}) X-Ref |
No description |
isURLLike(val) X-Ref |
Determines whether a given value could be a URL. Note this does not guarantee the value is a URL only that it looks like it might be one. For example, just because a string has `www.` in it doesn't make it a URL, but it does make it highly likely that it will be so in the context of creating a link it makes sense to treat it like one. return: {boolean} whether or not the value is potentially a URL. param: {string} val the candidate for being URL-like (or not). |
hasPossibleTLD(url, maxLength = 6) X-Ref |
Checks if a given URL has a valid Top-Level Domain (TLD). return: {boolean} Returns true if the URL has a valid TLD, false otherwise. param: {string} url - The URL to check. param: {number} maxLength - The maximum length of the TLD. |
useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion) X-Ref |
No description |
use_rich_url_data_reducer(state, action) X-Ref |
WordPress dependencies |
useRemoteUrlData(url) X-Ref |
No description |
LinkPreview({value,onEditClick,hasRichPreviews = false,hasUnlinkControl = false,onRemove}) X-Ref |
Internal dependencies |
useCreatePage(handleCreatePage) X-Ref |
WordPress dependencies |
useInternalValue(value) X-Ref |
External dependencies |
LinkControl({searchInputPlaceholder,value,settings = DEFAULT_LINK_SETTINGS,onChange = link_control_noop,onRemove,onCancel,noDirectEntry = false,showSuggestions = true,showInitialSuggestions,forceIsEditingLink,createSuggestion,withCreateSuggestion,inputValue: propInputValue = '',suggestionsQuery = {},noURLSuggestion = false,createSuggestionButtonText,hasRichPreviews = false,hasTextControl = false,renderControlBottom = null}) X-Ref |
Renders a link control. A link control is a controlled input which maintains a value associated with a link (HTML anchor element) and relevant settings for how that link is expected to behave. param: {WPLinkControlProps} props Component props. |
hasBackgroundImageValue(style) X-Ref |
Checks if there is a current value in the background image block support attributes. return: {boolean} Whether or not the block has a background image value set. param: {Object} style Style attribute. |
hasBackgroundSizeValue(style) X-Ref |
Checks if there is a current value in the background size block support attributes. Background size values include background size as well as background position. return: {boolean} Whether or not the block has a background size value set. param: {Object} style Style attribute. |
hasBackgroundSupport(blockName, feature = 'any') X-Ref |
Determine whether there is block support for background. return: {boolean} Whether there is support. param: {string} blockName Block name. param: {string} feature Background image feature to check for. |
resetBackgroundImage(style = {}, setAttributes) X-Ref |
Resets the background image block support attributes. This can be used when disabling the background image controls for a block via a `ToolsPanel`. param: {Object} style Style attribute. param: {Function} setAttributes Function to set block's attributes. |
resetBackgroundSize(style = {}, setAttributes) X-Ref |
Resets the background size block support attributes. This can be used when disabling the background size controls for a block via a `ToolsPanel`. param: {Object} style Style attribute. param: {Function} setAttributes Function to set block's attributes. |
getBackgroundImageClasses(style) X-Ref |
Generates a CSS class name if an background image is set. return: {string} CSS class name. param: {Object} style A block's style attribute. |
InspectorImagePreview({label,filename,url: imgUrl}) X-Ref |
No description |
BackgroundImagePanelItem({clientId,isShownByDefault,setAttributes}) X-Ref |
No description |
backgroundSizeHelpText(value) X-Ref |
No description |
BackgroundSizePanelItem({clientId,isShownByDefault,setAttributes}) X-Ref |
No description |
BackgroundImagePanel(props) X-Ref |
No description |
names(e,f) X-Ref |
No description |
getColorClassName(colorContextName, colorSlug) X-Ref |
Returns a class based on the context a color is being used and its slug. return: {?string} String with the class corresponding to the color in the provided context. param: {string} colorContextName Context/place where color is being used e.g: background, text etc... param: {string} colorSlug Slug of the color. |
getMostReadableColor(colors, colorValue) X-Ref |
Given an array of color objects and a color value returns the color value of the most readable color in the array. return: {string} String with the color value of the most readable color. param: {Array} colors Array of color objects as set by the theme or by the editor defaults. param: {?string} colorValue A string containing the color value. |
useMultipleOriginColorsAndGradients() X-Ref |
Retrieves color and gradient related settings. The arrays for colors and gradients are made up of color palettes from each origin i.e. "Core", "Theme", and "User". return: {Object} Color and gradient related settings. |
utils_mode(inputArray) X-Ref |
Gets the (non-undefined) item with the highest occurrence within an array Based in part on: https://stackoverflow.com/a/20762713 Undefined values are always sorted to the end by `sort`, so this function returns the first element, to always prioritize real values over undefined values. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description return: {any} The item with the most occurrences. param: {Array<any>} inputArray Array of items to check. |
getAllUnit(selectedUnits = {}) X-Ref |
Returns the most common CSS unit from the current CSS unit selections. - If a single flat border radius is set, its unit will be used - If individual corner selections, the most common of those will be used - Failing any unit selections a default of 'px' is returned. return: {string} Most common CSS unit from current selections. Default: `px`. param: {Object} selectedUnits Unit selections for flat radius & each corner. |
getAllValue(values = {}) X-Ref |
Gets the 'all' input value and unit from values data. return: {string} A value + unit for the 'all' input. param: {Object|string} values Radius values. |
hasMixedValues(values = {}) X-Ref |
Checks to determine if values are mixed. return: {boolean} Whether values are mixed. param: {Object} values Radius values. |
hasDefinedValues(values) X-Ref |
Checks to determine if values are defined. return: {boolean} Whether values are mixed. param: {Object} values Radius values. |
AllInputControl({onChange,selectedUnits,setSelectedUnits,values,...props}) X-Ref |
Internal dependencies |
BoxInputControls({onChange,selectedUnits,setSelectedUnits,values: valuesProp,...props}) X-Ref |
No description |
LinkedButton({isLinked,...props}) X-Ref |
No description |
BorderRadiusControl({onChange,values}) X-Ref |
Control to display border radius options. return: {Element} Custom border radius control. param: {Object} props Component props. param: {Function} props.onChange Callback to handle onChange. param: {Object} props.values Border radius values. |
ShadowPopoverContainer({shadow,onShadowChange,settings}) X-Ref |
Shared reference to an empty array for cases where it is important to avoid returning a new array reference on every invocation. |
ShadowPresets({presets,activeShadow,onSelect}) X-Ref |
No description |
ShadowIndicator({type,label,isActive,onSelect,shadow}) X-Ref |
No description |
ShadowPopover({shadow,onShadowChange,settings}) X-Ref |
No description |
renderShadowToggle() X-Ref |
No description |
useShadowPresets(settings) X-Ref |
No description |
useHasBorderPanel(settings) X-Ref |
No description |
useHasBorderPanelControls(settings) X-Ref |
No description |
useHasBorderColorControl(settings) X-Ref |
No description |
useHasBorderRadiusControl(settings) X-Ref |
No description |
useHasBorderStyleControl(settings) X-Ref |
No description |
useHasBorderWidthControl(settings) X-Ref |
No description |
useHasShadowControl(settings) X-Ref |
No description |
BorderToolsPanel({resetAllFilter,onChange,value,panelId,children,label}) X-Ref |
No description |
BorderPanel({as: Wrapper = BorderToolsPanel,value,onChange,inheritedValue = value,settings,panelId,name,defaultControls = border_panel_DEFAULT_CONTROLS}) X-Ref |
No description |
getColorSlugFromVariable(value) X-Ref |
No description |
styleToAttributes(style) X-Ref |
No description |
attributesToStyle(attributes) X-Ref |
No description |
BordersInspectorControl({label,children,resetAllFilter}) X-Ref |
No description |
border_BorderPanel({clientId,name,setAttributes,settings}) X-Ref |
No description |
selector(select) X-Ref |
No description |
hasBorderSupport(blockName, feature = 'any') X-Ref |
Determine whether there is block support for border properties. return: {boolean} Whether there is support. param: {string} blockName Block name. param: {string} feature Border feature to check support for. |
hasShadowSupport(blockName) X-Ref |
Determine whether there is block support for shadow properties. return: {boolean} Whether there is support. param: {string} blockName Block name. |
useBorderPanelLabel({blockName,hasBorderControl,hasShadowControl} = {}) X-Ref |
No description |
removeBorderAttribute(style, attribute) X-Ref |
Returns a new style object where the specified border attribute has been removed. return: {Object} Style object with the specified attribute removed. param: {Object} style Styles from block attributes. param: {string} attribute The border style attribute to clear. |
addAttributes(settings) X-Ref |
Filters registered block settings, extending attributes to include `borderColor` if needed. return: {Object} Updated block settings. param: {Object} settings Original block settings. |
border_addSaveProps(props, blockNameOrType, attributes) X-Ref |
Override props assigned to save component to inject border color. return: {Object} Filtered props to apply to save element. param: {Object} props Additional props applied to save element. param: {Object|string} blockNameOrType Block type definition. param: {Object} attributes Block's attributes. |
getBorderClasses(attributes) X-Ref |
Generates a CSS class name consisting of all the applicable border color classes given the current block attributes. return: {string} CSS class name. param: {Object} attributes Block's attributes. |
border_useBlockProps({name,borderColor,style}) X-Ref |
No description |
__experimentalGetGradientClass(gradientSlug) X-Ref |
No description |
getGradientValueBySlug(gradients, slug) X-Ref |
Retrieves the gradient value per slug. return: {string} Gradient value. param: {Array} gradients Gradient Palette param: {string} slug Gradient slug |
__experimentalGetGradientObjectByGradientValue(gradients, value) X-Ref |
No description |
getGradientSlugByValue(gradients, value) X-Ref |
Retrieves the gradient slug per slug. return: {string} Gradient slug. param: {Array} gradients Gradient Palette param: {string} value Gradient value |
__experimentalUseGradient({gradientAttribute = 'gradient',customGradientAttribute = 'customGradient'} = {}) X-Ref |
No description |
ColorGradientControlInner({colors,gradients,disableCustomColors,disableCustomGradients,__experimentalIsRenderedInSidebar,className,label,onColorChange,onGradientChange,colorValue,gradientValue,clearable,showTitle = true,enableAlpha,headingLevel}) X-Ref |
No description |
ColorGradientControlSelect(props) X-Ref |
No description |
ColorGradientControl(props) X-Ref |
No description |
useHasColorPanel(settings) X-Ref |
No description |
useHasTextPanel(settings) X-Ref |
No description |
useHasLinkPanel(settings) X-Ref |
No description |
useHasCaptionPanel(settings) X-Ref |
No description |
useHasHeadingPanel(settings) X-Ref |
No description |
useHasButtonPanel(settings) X-Ref |
No description |
useHasBackgroundPanel(settings) X-Ref |
No description |
ColorToolsPanel({resetAllFilter,onChange,value,panelId,children}) X-Ref |
No description |
ColorPanelTab({isGradient,inheritedValue,userValue,setValue,colorGradientControlSettings}) X-Ref |
No description |
ColorPanelDropdown({label,hasValue,resetValue,isShownByDefault,indicators,tabs,colorGradientControlSettings,panelId}) X-Ref |
No description |
ColorPanel({as: Wrapper = ColorToolsPanel,value,onChange,inheritedValue = value,settings,panelId,defaultControls = color_panel_DEFAULT_CONTROLS,children}) X-Ref |
No description |
ContrastChecker({backgroundColor,fallbackBackgroundColor,fallbackTextColor,fallbackLinkColor,fontSize,isLargeText,textColor,linkColor,enableAlphaChecker = false}) X-Ref |
No description |
BlockRefsProvider({children}) X-Ref |
No description |
useBlockRefProvider(clientId) X-Ref |
Provides a ref to the BlockRefs context. return: {RefCallback} Ref callback. param: {string} clientId The client ID of the element ref. |
useBlockRef(clientId) X-Ref |
Gets a ref pointing to the current block element. Continues to return a stable ref even if the block client ID changes. return: {RefObject} A ref containing the element. param: {string} clientId The client ID to get a ref for. |
useBlockElement(clientId) X-Ref |
Return the element for a given client ID. Updates whenever the element changes, becomes available, or disappears. return: {Element|null} The block's wrapper element. param: {string} clientId The client ID to an element for. |
getComputedStyle(node) X-Ref |
Internal dependencies |
BlockColorContrastChecker({clientId}) X-Ref |
No description |
color_addAttributes(settings) X-Ref |
Filters registered block settings, extending attributes to include `backgroundColor` and `textColor` attribute. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
color_addSaveProps(props, blockNameOrType, attributes) X-Ref |
Override props assigned to save component to inject colors classnames. return: {Object} Filtered props applied to save element. param: {Object} props Additional props applied to save element. param: {Object|string} blockNameOrType Block type. param: {Object} attributes Block attributes. |
color_styleToAttributes(style) X-Ref |
No description |
color_attributesToStyle(attributes) X-Ref |
No description |
ColorInspectorControl({children,resetAllFilter}) X-Ref |
No description |
ColorEdit({clientId,name,setAttributes,settings}) X-Ref |
No description |
selector(select) X-Ref |
No description |
color_useBlockProps({name,backgroundColor,textColor,gradient,style}) X-Ref |
No description |
color_addTransforms(result, source, index, results) X-Ref |
No description |
FontFamilyControl({value = '',onChange,fontFamilies,...props}) X-Ref |
Internal dependencies |
FontAppearanceControl(props) X-Ref |
Control to display unified font style and weight options. return: {Element} Font appearance control. param: {Object} props Component props. |
isLineHeightDefined(lineHeight) X-Ref |
Determines if the lineHeight attribute has been properly defined. return: {boolean} Whether the lineHeight attribute is valid. param: {any} lineHeight The value to check. |
LetterSpacingControl({value,onChange,__unstableInputWidth = '60px',...otherProps}) X-Ref |
Control for letter-spacing. return: {Element} Letter-spacing control. param: {Object} props Component props. param: {string} props.value Currently selected letter-spacing. param: {Function} props.onChange Handles change in letter-spacing selection. param: {string|number|undefined} props.__unstableInputWidth Input width to pass through to inner UnitControl. Should be a valid CSS value. |
TextTransformControl({className,value,onChange}) X-Ref |
Control to facilitate text transform selections. return: {Element} Text transform control. param: {Object} props Component props. param: {string} props.className Class name to add to the control. param: {string} props.value Currently selected text transform. param: {Function} props.onChange Handles change in text transform selection. |
TextDecorationControl({value,onChange,className}) X-Ref |
Control to facilitate text decoration selections. return: {Element} Text decoration control. param: {Object} props Component props. param: {string} props.value Currently selected text decoration. param: {Function} props.onChange Handles change in text decoration selection. param: {string} [props.className] Additional class name to apply. |
WritingModeControl({className,value,onChange}) X-Ref |
Control to facilitate writing mode selections. return: {Element} Writing Mode control. param: {Object} props Component props. param: {string} props.className Class name to add to the control. param: {string} props.value Currently selected writing mode. param: {Function} props.onChange Handles change in the writing mode selection. |
useHasTypographyPanel(settings) X-Ref |
No description |
useHasFontSizeControl(settings) X-Ref |
No description |
useHasFontFamilyControl(settings) X-Ref |
No description |
useHasLineHeightControl(settings) X-Ref |
No description |
useHasAppearanceControl(settings) X-Ref |
No description |
useAppearanceControlLabel(settings) X-Ref |
No description |
useHasLetterSpacingControl(settings) X-Ref |
No description |
useHasTextTransformControl(settings) X-Ref |
No description |
useHasTextDecorationControl(settings) X-Ref |
No description |
useHasWritingModeControl(settings) X-Ref |
No description |
useHasTextColumnsControl(settings) X-Ref |
No description |
getUniqueFontSizesBySlug(settings) X-Ref |
No description |
TypographyToolsPanel({resetAllFilter,onChange,value,panelId,children}) X-Ref |
No description |
TypographyPanel({as: Wrapper = TypographyToolsPanel,value,onChange,inheritedValue = value,settings,panelId,defaultControls = typography_panel_DEFAULT_CONTROLS}) X-Ref |
No description |
LineHeightEdit(props) X-Ref |
Inspector control panel containing the line height related configuration return: {Element} Line height edit element. param: {Object} props |
useIsLineHeightDisabled({name: blockName} = {}) X-Ref |
Custom hook that checks if line-height settings have been disabled. return: {boolean} Whether setting is disabled. param: {string} name The name of the block. |
font_family_addAttributes(settings) X-Ref |
Filters registered block settings, extending attributes to include the `fontFamily` attribute. return: {Object} Filtered block settings param: {Object} settings Original block settings |
font_family_addSaveProps(props, blockType, attributes) X-Ref |
Override props assigned to save component to inject font family. return: {Object} Filtered props applied to save element param: {Object} props Additional props applied to save element param: {Object} blockType Block type param: {Object} attributes Block attributes |
font_family_useBlockProps({name,fontFamily}) X-Ref |
No description |
resetFontFamily({setAttributes}) X-Ref |
Resets the font family block support attribute. This can be used when disabling the font family support controls for a block via a progressive discovery panel. param: {Object} props Block props. param: {Object} props.setAttributes Function to set block's attributes. |
utils_getFontSizeObjectByValue(fontSizes, value) X-Ref |
Returns the corresponding font size object for a given value. return: {Object} Font size object. param: {Array} fontSizes Array of font size objects. param: {number} value Font size value. |
getFontSizeClass(fontSizeSlug) X-Ref |
Returns a class based on fontSizeName. return: {string | undefined} String with the class corresponding to the fontSize passed. param: {string} fontSizeSlug Slug of the fontSize. |
font_size_addAttributes(settings) X-Ref |
Filters registered block settings, extending attributes to include `fontSize` and `fontWeight` attributes. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
font_size_addSaveProps(props, blockNameOrType, attributes) X-Ref |
Override props assigned to save component to inject font size. return: {Object} Filtered props applied to save element. param: {Object} props Additional props applied to save element. param: {Object} blockNameOrType Block type. param: {Object} attributes Block attributes. |
FontSizeEdit(props) X-Ref |
Inspector control panel containing the font size related configuration return: {Element} Font size edit element. param: {Object} props |
useIsFontSizeDisabled({name: blockName} = {}) X-Ref |
Custom hook that checks if font-size settings have been disabled. return: {boolean} Whether setting is disabled. param: {string} name The name of the block. |
font_size_useBlockProps({name,fontSize,style}) X-Ref |
No description |
font_size_addTransforms(result, source, index, results) X-Ref |
No description |
omit(object, keys) X-Ref |
No description |
typography_styleToAttributes(style) X-Ref |
No description |
typography_attributesToStyle(attributes) X-Ref |
No description |
TypographyInspectorControl({children,resetAllFilter}) X-Ref |
No description |
typography_TypographyPanel({clientId,name,setAttributes,settings}) X-Ref |
No description |
selector(select) X-Ref |
No description |
SpacingInputControl({icon,isMixed = false,minimumCustomValue,onChange,onMouseOut,onMouseOver,showSideInLabel = true,side,spacingSizes,type,value}) X-Ref |
No description |
AxialInputControls({minimumCustomValue,onChange,onMouseOut,onMouseOver,sides,spacingSizes,type,values}) X-Ref |
No description |
SeparatedInputControls({minimumCustomValue,onChange,onMouseOut,onMouseOver,sides,spacingSizes,type,values}) X-Ref |
Internal dependencies |
SingleInputControl({minimumCustomValue,onChange,onMouseOut,onMouseOver,showSideInLabel,side,spacingSizes,type,values}) X-Ref |
Internal dependencies |
SidesDropdown({label: labelProp,onChange,sides,value}) X-Ref |
No description |
useSpacingSizes() X-Ref |
Internal dependencies |
SpacingSizesControl({inputProps,label: labelProp,minimumCustomValue = 0,onChange,onMouseOut,onMouseOver,showSideInLabel = true,sides = ALL_SIDES,useSelect,values}) X-Ref |
No description |
HeightControl({label = (0,external_wp_i18n_namespaceObject.__) X-Ref |
HeightControl renders a linked unit control and range control for adjusting the height of a block. return: {Component} The component to be rendered. param: {Object} props param: {?string} props.label A label for the control. param: {( value: string ) => void } props.onChange Called when the height changes. param: {string} props.value The current height value. |
helpText(selfStretch, parentLayout) X-Ref |
No description |
ChildLayoutControl({value: childLayout = {},onChange,parentLayout}) X-Ref |
Form to edit the child layout value. return: {Element} child layout edit element. param: {Object} props Props. param: {Object} props.value The child layout value. param: {Function} props.onChange Function to update the child layout value. param: {Object} props.parentLayout The parent layout value. |
childLayoutOrientation(parentLayout) X-Ref |
No description |
AspectRatioTool({panelId,value,onChange = () X-Ref |
useHasDimensionsPanel(settings) X-Ref |
No description |
useHasContentSize(settings) X-Ref |
No description |
useHasWideSize(settings) X-Ref |
No description |
useHasPadding(settings) X-Ref |
No description |
useHasMargin(settings) X-Ref |
No description |
useHasGap(settings) X-Ref |
No description |
useHasMinHeight(settings) X-Ref |
No description |
useHasAspectRatio(settings) X-Ref |
No description |
useHasChildLayout(settings) X-Ref |
No description |
useHasSpacingPresets(settings) X-Ref |
No description |
filterValuesBySides(values, sides) X-Ref |
No description |
splitStyleValue(value) X-Ref |
No description |
splitGapValue(value) X-Ref |
No description |
DimensionsToolsPanel({resetAllFilter,onChange,value,panelId,children}) X-Ref |
No description |
DimensionsPanel({as: Wrapper = DimensionsToolsPanel,value,onChange,inheritedValue = value,settings,panelId,defaultControls = dimensions_panel_DEFAULT_CONTROLS,onVisualize = () X-Ref |
No description |
usePopoverScroll(scrollableRef) X-Ref |
Allow scrolling "through" popovers over the canvas. This is only called for as long as the pointer is over a popover. Do not use React events because it will bubble through portals. param: {Object} scrollableRef |
onWheel(event) X-Ref |
No description |
BlockPopover({clientId,bottomClientId,children,__unstableRefreshSize,__unstableCoverTarget = false,__unstablePopoverSlot,__unstableContentRef,shift = true,...props}, ref) X-Ref |
No description |
getComputedCSS(element, property) X-Ref |
Internal dependencies |
MarginVisualizer({clientId,attributes,forceShow}) X-Ref |
No description |
padding_getComputedCSS(element, property) X-Ref |
Internal dependencies |
PaddingVisualizer({clientId,value,forceShow}) X-Ref |
No description |
useVisualizer() X-Ref |
No description |
DimensionsInspectorControl({children,resetAllFilter}) X-Ref |
No description |
dimensions_DimensionsPanel({clientId,name,setAttributes,settings}) X-Ref |
No description |
hasDimensionsSupport(blockName, feature = 'any') X-Ref |
Determine whether there is block support for dimensions. return: {boolean} Whether there is support. param: {string} blockName Block name. param: {string} feature Background image feature to check for. |
dimensions_useBlockProps({name,minHeight,style}) X-Ref |
No description |
useCustomSides() X-Ref |
getInlineStyles(styles = {}) X-Ref |
Returns the inline styles to add depending on the style object return: {Object} Flattened CSS variables declaration. param: {Object} styles Styles configuration. |
style_addAttribute(settings) X-Ref |
Filters registered block settings, extending attributes to include `style` attribute. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
omitStyle(style, paths, preserveReference = false) X-Ref |
A utility function used to remove one or more paths from a style object. Works in a way similar to Lodash's `omit()`. See unit tests and examples below. It supports a single string path: ``` omitStyle( { color: 'red' }, 'color' ); // {} ``` or an array of paths: ``` omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {} ``` It also allows you to specify paths at multiple levels in a string. ``` omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {} ``` You can remove multiple paths at the same time: ``` omitStyle( { typography: { textDecoration: 'underline', textTransform: 'uppercase', } }, [ 'typography.textDecoration', 'typography.textTransform', ] ); // {} ``` You can also specify nested paths as arrays: ``` omitStyle( { typography: { textDecoration: 'underline', textTransform: 'uppercase', } }, [ [ 'typography', 'textDecoration' ], [ 'typography', 'textTransform' ], ] ); // {} ``` With regards to nesting of styles, infinite depth is supported: ``` omitStyle( { border: { radius: { topLeft: '10px', topRight: '0.5rem', } } }, [ [ 'border', 'radius', 'topRight' ], ] ); // { border: { radius: { topLeft: '10px' } } } ``` The third argument, `preserveReference`, defines how to treat the input style object. It is mostly necessary to properly handle mutation when recursively handling the style object. Defaulting to `false`, this will always create a new object, avoiding to mutate `style`. However, when recursing, we change that value to `true` in order to work with a single copy of the original style object. return: {Object} Styles object with the specified paths removed. param: {Object} style Styles object. param: {Array|string} paths Paths to remove. param: {boolean} preserveReference True to mutate the `style` object, false otherwise. |
style_addSaveProps(props, blockNameOrType, attributes, skipPaths = skipSerializationPathsSave) X-Ref |
Override props assigned to save component to inject the CSS variables definition. return: {Object} Filtered props applied to save element. param: {Object} props Additional props applied to save element. param: {Object|string} blockNameOrType Block type. param: {Object} attributes Block attributes. param: {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization. |
BlockStyleControls({clientId,name,setAttributes,__unstableParentLayout}) X-Ref |
No description |
style_useBlockProps({name,style}) X-Ref |
No description |
settings_addAttribute(settings) X-Ref |
No description |
DuotoneControl({id: idProp,colorPalette,duotonePalette,disableCustomColors,disableCustomDuotone,value,onChange}) X-Ref |
No description |
getValuesFromColors(colors = []) X-Ref |
Convert a list of colors to an object of R, G, and B values. return: {Object} R, G, and B values. param: {string[]} colors Array of RBG color strings. |
getDuotoneUnsetStylesheet(selector) X-Ref |
Stylesheet for disabling a global styles duotone filter. return: {string} Filter none style. param: {string} selector Selector to disable the filter for. |
getDuotoneStylesheet(selector, id) X-Ref |
SVG and stylesheet needed for rendering the duotone filter. return: {string} Duotone filter style. param: {string} selector Selector to apply the filter to. param: {string} id Unique id for this duotone filter. |
getDuotoneFilter(id, colors) X-Ref |
The SVG part of the duotone filter. return: {string} Duotone SVG. param: {string} id Unique id for this duotone filter. param: {string[]} colors Color strings from dark to light. |
getBlockCSSSelector(blockType, target = 'root', options = {}) X-Ref |
Determine the CSS selector for the block type and target provided, returning it if available. return: {?string} The CSS selector or `null` if no selector available. param: {import('@wordpress/blocks').Block} blockType The block's type. param: {string|string[]} target The desired selector's target e.g. `root`, delimited string, or array path. param: {Object} options Options object. param: {boolean} options.fallback Whether or not to fallback to broader selector. |
useMultiOriginColorPresets(settings, {presetSetting,defaultSetting}) X-Ref |
No description |
useHasFiltersPanel(settings) X-Ref |
No description |
useHasDuotoneControl(settings) X-Ref |
No description |
FiltersToolsPanel({resetAllFilter,onChange,value,panelId,children}) X-Ref |
No description |
FiltersPanel({as: Wrapper = FiltersToolsPanel,value,onChange,inheritedValue = value,settings,panelId,defaultControls = filters_panel_DEFAULT_CONTROLS}) X-Ref |
No description |
useMultiOriginPresets({presetSetting,defaultSetting}) X-Ref |
No description |
getColorsFromDuotonePreset(duotone, duotonePalette) X-Ref |
No description |
getDuotonePresetFromColors(colors, duotonePalette) X-Ref |
No description |
DuotonePanelPure({style,setAttributes,name}) X-Ref |
No description |
addDuotoneAttributes(settings) X-Ref |
Filters registered block settings, extending attributes to include the `duotone` attribute. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
useDuotoneStyles({clientId,id: filterId,selector: duotoneSelector,attribute: duotoneAttr}) X-Ref |
No description |
duotone_useBlockProps({name,style}) X-Ref |
No description |
getPositionTypeLabel(attributes) X-Ref |
Get the display label for a block's position type. return: {string} The position type label. param: {Object} attributes Block attributes. |
useBlockDisplayInformation(clientId) X-Ref |
Hook used to try to find a matching block variation and return the appropriate information for display reasons. In order to to try to find a match we need to things: 1. Block's client id to extract it's current attributes. 2. A block variation should have set `isActive` prop to a proper function. If for any reason a block variation match cannot be found, the returned information come from the Block Type. If no blockType is found with the provided clientId, returns null. return: {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found. param: {string} clientId Block's client id. |
getPositionCSS({selector,style}) X-Ref |
Get calculated position CSS. return: {string} The generated CSS rules. param: {Object} props Component props. param: {string} props.selector Selector to use. param: {Object} props.style Style object. |
hasStickyPositionSupport(blockType) X-Ref |
Determines if there is sticky position support. return: {boolean} Whether there is support. param: {string|Object} blockType Block name or Block Type object. |
hasFixedPositionSupport(blockType) X-Ref |
Determines if there is fixed position support. return: {boolean} Whether there is support. param: {string|Object} blockType Block name or Block Type object. |
hasPositionSupport(blockType) X-Ref |
Determines if there is position support. return: {boolean} Whether there is support. param: {string|Object} blockType Block name or Block Type object. |
hasPositionValue(props) X-Ref |
Checks if there is a current value in the position block support attributes. return: {boolean} Whether or not the block has a position value set. param: {Object} props Block props. |
hasStickyOrFixedPositionValue(attributes) X-Ref |
Checks if the block is currently set to a sticky or fixed position. This check is helpful for determining how to position block toolbars or other elements. return: {boolean} Whether or not the block is set to a sticky or fixed position. param: {Object} attributes Block attributes. |
resetPosition({attributes = {},setAttributes}) X-Ref |
Resets the position block support attributes. This can be used when disabling the position support controls for a block via a `ToolsPanel`. param: {Object} props Block props. param: {Object} props.attributes Block's attributes. param: {Object} props.setAttributes Function to set block's attributes. |
useIsPositionDisabled({name: blockName} = {}) X-Ref |
Custom hook that checks if position settings have been disabled. return: {boolean} Whether padding setting is disabled. param: {string} name The name of the block. |
PositionPanelPure({style = {},clientId,name: blockName,setAttributes}) X-Ref |
No description |
position_useBlockProps({name,style}) X-Ref |
No description |
hasLayoutBlockSupport(blockName) X-Ref |
No description |
useLayoutClasses(blockAttributes = {}, blockName = '') X-Ref |
Generates the utility classnames for the given block's layout attributes. return: { Array } Array of CSS classname strings. param: { Object } blockAttributes Block attributes. param: { string } blockName Block name. |
useLayoutStyles(blockAttributes = {}, blockName, selector) X-Ref |
Generates a CSS rule with the given block's layout styles. return: { string } CSS rule. param: { Object } blockAttributes Block attributes. param: { string } blockName Block name. param: { string } selector A selector to use in generating the CSS rule. |
LayoutPanelPure({layout,setAttributes,name: blockName}) X-Ref |
No description |
LayoutTypeSwitcher({type,onChange}) X-Ref |
No description |
layout_addAttribute(settings) X-Ref |
Filters registered block settings, extending attributes to include `layout`. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
BlockWithLayoutStyles({block: BlockListBlock,props}) X-Ref |
No description |
useBlockPropsChildLayoutStyles({style}) X-Ref |
Internal dependencies |
useConvertToGroupButtonProps(selectedClientIds) X-Ref |
Returns the properties `ConvertToGroupButton` component needs to work properly. It is used in `BlockSettingsMenuControls` to know if `ConvertToGroupButton` should be rendered, to avoid ending up with an empty MenuGroup. return: {ConvertToGroupButtonProps} Returns the properties needed by `ConvertToGroupButton`. param: {?string[]} selectedClientIds An optional array of clientIds to group. The selected blocks |
ConvertToGroupButton({clientIds,isGroupable,isUngroupable,onUngroup,blocksSelection,groupingBlockName,onClose = () X-Ref |
No description |
useBlockLock(clientId) X-Ref |
Return details about the block lock status. return: {Object} Block lock status param: {string} clientId The block client Id. |
getTemplateLockValue(lock) X-Ref |
No description |
BlockLockModal({clientId,onClose}) X-Ref |
No description |
BlockLockMenuItem({clientId}) X-Ref |
Internal dependencies |
BlockModeToggle({blockType,mode,onToggleMode,small = false,isCodeEditingEnabled = true}) X-Ref |
Internal dependencies |
useBlockRename(name) X-Ref |
WordPress dependencies |
isEmptyString(testString) X-Ref |
No description |
BlockRenameModal({blockName,originalBlockName,onClose,onSave}) X-Ref |
Internal dependencies |
BlockRenameControl({clientId}) X-Ref |
No description |
onChange(newName) X-Ref |
No description |
BlockSettingsMenuControls({...props}) X-Ref |
return: {Element} Element. param: {Object} props Fill props. |
ContentLockControlsPure({clientId,isSelected}) X-Ref |
No description |
addMetaAttribute(blockTypeSettings) X-Ref |
Filters registered block settings, extending attributes to include `metadata`. see: https://github.com/WordPress/gutenberg/pull/40393/files#r864632012 return: {Object} Filtered block settings. param: {Object} blockTypeSettings Original block settings. |
BlockIcon({icon,showColors = false,className,context}) X-Ref |
No description |
BlockHooksControlPure({name,clientId,metadata: {ignoredHookedBlocks = []} = {}}) X-Ref |
No description |
addLabelCallback(settings) X-Ref |
Filters registered block settings, adding an `__experimentalLabel` callback if one does not already exist. return: {Object} Filtered block settings. param: {Object} settings Original block settings. |
BlockRenameControlPure({metadata,setAttributes}) X-Ref |
No description |
canBindBlock(blockName) X-Ref |
Based on the given block name, check if it is possible to bind the block. return: {boolean} Whether it is possible to bind the block to sources. param: {string} blockName - The block name. |
canBindAttribute(blockName, attributeName) X-Ref |
Based on the given block name and attribute name, check if it is possible to bind the block attribute. return: {boolean} Whether it is possible to bind the block attribute. param: {string} blockName - The block name. param: {string} attributeName - The attribute name. |
BlockBindingBridge({blockProps,bindings,onPropValueChange}) X-Ref |
BlockBindingBridge acts like a component wrapper that connects the bound attributes of a block to the source handlers. For this, it creates a BindingConnector for each bound attribute. return: {null} Data-handling component. Render nothing. param: {Object} props - The component props. param: {Object} props.blockProps - The BlockEdit props object. param: {Object} props.bindings - The block bindings settings. param: {Function} props.onPropValueChange - The function to call when the attribute value changes. |
shimAttributeSource(settings, name) X-Ref |
Filters a registered block's settings to enhance a block's `edit` component to upgrade bound attributes. return: {WPBlockSettings} Filtered block settings. param: {WPBlockSettings} settings - Registered block settings. param: {string} name - Block name. |
getBorderClassesAndStyles(attributes) X-Ref |
Provides the CSS class names and inline styles for a block's border support attributes. return: {Object} Border block support derived CSS classes & styles. param: {Object} attributes Block attributes. |
useBorderProps(attributes) X-Ref |
Derives the border related props for a block from its border block support attributes. Inline styles are forced for named colors to ensure these selections are reflected when themes do not load their color stylesheets in the editor. return: {Object} ClassName & style props from border block support. param: {Object} attributes Block attributes. |
getShadowClassesAndStyles(attributes) X-Ref |
Provides the CSS class names and inline styles for a block's shadow support attributes. return: {Object} Shadow block support derived CSS classes & styles. param: {Object} attributes Block attributes. |
getColorClassesAndStyles(attributes) X-Ref |
Provides the CSS class names and inline styles for a block's color support attributes. return: {Object} Color block support derived CSS classes & styles. param: {Object} attributes Block attributes. |
useColorProps(attributes) X-Ref |
Determines the color related props for a block derived from its color block support attributes. Inline styles are forced for named colors to ensure these selections are reflected when themes do not load their color stylesheets in the editor. return: {Object} ClassName & style props from colors block support. param: {Object} attributes Block attributes. |
getSpacingClassesAndStyles(attributes) X-Ref |
Provides the CSS class names and inline styles for a block's spacing support attributes. return: {Object} Spacing block support derived CSS classes & styles. param: {Object} attributes Block attributes. |
getTypographyClassesAndStyles(attributes, settings) X-Ref |
Provides the CSS class names and inline styles for a block's typography support attributes. return: {Object} Typography block support derived CSS classes & styles. param: {Object} attributes Block attributes. param: {Object|boolean} settings Merged theme.json settings |
useCachedTruthy(value) X-Ref |
Keeps an up-to-date copy of the passed value and returns it. If value becomes falsy, it will return the last truthy copy. return: {any} value param: {any} value |
createColorHOC(colorTypes, withColorPalette) X-Ref |
Helper function used with `createHigherOrderComponent` to create higher order components for managing color logic. return: {Component} The component that can be used as a HOC. param: {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor). param: {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent. |
createCustomColorsHOC(colorsArray) X-Ref |
A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic for class generation color value, retrieval and color attribute setting. Use this higher-order component to work with a custom set of colors. return: {Function} Higher-order component. param: {Array} colorsArray The array of color objects (name, slug, color, etc... ). |
withColors(...colorTypes) X-Ref |
A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting. For use with the default editor/theme color palette. return: {Function} Higher-order component. param: {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object, |
font_size_picker_FontSizePicker(props) X-Ref |
Internal dependencies |
AlignmentUI({value,onChange,alignmentControls = DEFAULT_ALIGNMENT_CONTROLS,label = (0,external_wp_i18n_namespaceObject.__) X-Ref |
No description |
applyOrUnset(align) X-Ref |
No description |
setIcon() X-Ref |
No description |
localeLowerCase(str, locale) X-Ref |
Localized lower case. |
lowerCase(str) X-Ref |
Lower case as a function. |
noCase(input, options) X-Ref |
Normalize the string into something other libraries can manipulate easier. |
dist_es2015_replace(input, re, value) X-Ref |
Replace `re` in the input string with the replacement value. |
extractWords(input = '') X-Ref |
Extracts words from an input string. return: {Array} Words, extracted from the input string. param: {string} input The input string. |
normalizeSearchInput(input = '') X-Ref |
Sanitizes the search input string. return: {string} The normalized search input. param: {string} input The search input to normalize. |
getItemSearchRank(item, searchTerm, config = {}) X-Ref |
Get the search rank for a given item and a specific search term. The better the match, the higher the rank. If the rank equals 0, it should be excluded from the results. return: {number} Search Rank. param: {Object} item Item to filter. param: {string} searchTerm Search term. param: {Object} config Search Config. |
createBlockCompleter() X-Ref |
Creates a blocks repeater for replacing the current block with a selected block type. return: {WPCompleter} A blocks completer. |
createLinkCompleter() X-Ref |
Creates a suggestion list for links to posts or pages. return: {WPCompleter} A links completer. |
useCompleters({completers = autocomplete_EMPTY_ARRAY}) X-Ref |
Shared reference to an empty array for cases where it is important to avoid returning a new array reference on every invocation. |
useBlockEditorAutocompleteProps(props) X-Ref |
No description |
BlockEditorAutocomplete(props) X-Ref |
Wrap the default Autocomplete component with one that supports a filter hook for customizing its list of autocompleters. |
BlockFullHeightAlignmentControl({isActive,label = (0,external_wp_i18n_namespaceObject.__) X-Ref |
No description |
BlockAlignmentMatrixControl(props) X-Ref |
No description |
useBlockDisplayTitle({clientId,maximumLength,context}) X-Ref |
Returns the block's configured title as a string, or empty if the title cannot be determined. return: {?string} Block title. param: {Object} props param: {string} props.clientId Client ID of block. param: {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated. param: {string|undefined} props.context The context to pass to `getBlockLabel`. |
BlockTitle({clientId,maximumLength,context}) X-Ref |
Renders the block's configured title as a string, or empty if the title cannot be determined. return: {JSX.Element} Block title. param: {Object} props param: {string} props.clientId Client ID of block. param: {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated. param: {string|undefined} props.context The context to pass to `getBlockLabel`. |
BlockBreadcrumb({rootLabelText}) X-Ref |
Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb. return: {Element} Block Breadcrumb. param: {Object} props Component props. param: {string} props.rootLabelText Translated label for the root element of the breadcrumb trail. |
useBlockOverlayActive(clientId) X-Ref |
Internal dependencies |
BlockContextProvider({value,children}) X-Ref |
Component which merges passed value with current consumed block context. param: {BlockContextProviderProps} props |
BlockEdit({mayDisplayControls,mayDisplayParentControls,blockEditingMode,...props}) X-Ref |
The `useBlockEditContext` hook provides information about the block this hook is being used in. It returns an object with the `name`, `isSelected` state, and the `clientId` of the block. It is useful if you want to create custom hooks that need access to the current blocks clientId but don't want to rely on the data getting passed in as a parameter. return: {Object} Block edit context |
Warning({className,actions,children,secondaryActions}) X-Ref |
No description |
BlockView({title,rawContent,renderedContent,action,actionText,className}) X-Ref |
No description |
BlockCompare({block,onKeep,onConvert,convertor,convertButtonText}) X-Ref |
Internal dependencies |
getDifference(originalContent, newContent) X-Ref |
No description |
getConvertedContent(convertedBlock) X-Ref |
No description |
BlockInvalidWarning({clientId}) X-Ref |
No description |
Class: BlockCrashBoundary - X-Ref
WordPress dependenciesBlockHTML({clientId}) X-Ref |
Internal dependencies |
dist_esm_I(t,...e) X-Ref |
No description |
getAbsolutePosition(element) X-Ref |
If the block count exceeds the threshold, we disable the reordering animation to avoid laginess. |
useMovingAnimation({triggerAnimationOnChange,clientId}) X-Ref |
Hook used to compute the styles required to move a div into a new position. The way this animation works is the following: - It first renders the element as if there was no animation. - It takes a snapshot of the position of the block to use it as a destination point for the animation. - It restores the element to the previous position using a CSS transform - It uses the "resetAnimation" flag to reset the animation from the beginning in order to animate to the new destination point. param: {Object} $1 Options param: {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes. param: {string} $1.clientId |
preserveScrollPosition() X-Ref |
No description |
isInSameBlock(a, b) X-Ref |
Returns true if two elements are contained within the same block. return: {boolean} Whether elements are in the same block. param: {Element} a First element. param: {Element} b Second element. |
isInsideRootBlock(blockElement, element) X-Ref |
Returns true if an element is considered part of the block and not its inner blocks or appender. return: {boolean} Whether an element is considered part of the block and not param: {Element} blockElement Block container element. param: {Element} element Element. |
getBlockClientId(node) X-Ref |
Finds the block client ID given any DOM node inside the block. return: {string|undefined} Client ID or undefined if the node is not part of param: {Node?} node DOM node. |
useFocusFirstElement({clientId,initialPosition}) X-Ref |
Transitions focus to the block or inner tabbable when the block becomes selected and an initial position is set. return: {RefObject} React ref with the block element. param: {string} clientId Block client ID. |
listener(event) X-Ref |
WordPress dependencies |
useIsHovered({isEnabled}) X-Ref |
No description |
useFocusHandler(clientId) X-Ref |
Selects the block if it receives focus. param: {string} clientId Block client ID. |
onFocus(event) X-Ref |
Marks the block as selected when focused and not already selected. This specifically handles the case where block does not set focus on its own (via `setFocus`), typically if there is no focusable input in the block. param: {FocusEvent} event Focus event. |
useEventHandlers({clientId,isSelected}) X-Ref |
Adds block behaviour: - Removes the block on BACKSPACE. - Inserts a default block on ENTER. - Disables dragging of block contents. param: {string} clientId Block client ID. |
onKeyDown(event) X-Ref |
Interprets keydown event intent to remove or insert after block if key event occurs on wrapper node. This can occur when the block has no text fields of its own, particularly after initial insertion, to allow for easy deletion and continuous writing flow to add additional content. param: {KeyboardEvent} event Keydown event. |
onDragStart(event) X-Ref |
Prevents default dragging behavior within a block. To do: we must handle this in the future and clean up the drag target. param: {DragEvent} event Drag event. |
useNavModeExit(clientId) X-Ref |
Allows navigation mode to be exited by clicking in the selected block. param: {string} clientId Block client ID. |
onMouseDown(event) X-Ref |
No description |
useIntersectionObserver() X-Ref |
Internal dependencies |
useFlashEditableBlocks({clientId = '',isEnabled = true} = {}) X-Ref |
Internal dependencies |
use_block_props_useBlockProps(props = {}, {__unstableIsHtml} = {}) X-Ref |
This hook is used to lightly mark an element as a block element. The element should be the outermost element of a block. Call this hook and pass the returned props to the element to mark as a block. If you define a ref for the element, it is important to pass the ref to this hook, which the hook in turn will pass to the component through the props it returns. Optionally, you can also pass any other props through this hook, and they will be merged and returned. Use of this hook on the outermost element of a block is required if using API >= v2. return: {Object} Props to pass to the element to mark as a block. param: {Object} props Optional. Props to pass to the element. Must contain param: {Object} options Options for internal use only. param: {boolean} options.__unstableIsHtml |
mergeWrapperProps(propsA, propsB) X-Ref |
Merges wrapper props with special handling for classNames and styles. return: {Object} Merged props. param: {Object} propsA param: {Object} propsB |
Block({children,isHtml,...props}) X-Ref |
No description |
BlockListBlock({block: {__unstableBlockSource},mode,isLocked,canRemove,clientId,isSelected,isSelectionEnabled,className,__unstableLayoutClassNames: layoutClassNames,name,isValid,attributes,wrapperProps,setAttributes,onReplace,onInsertBlocksAfter,onMerge,toggleSelection}) X-Ref |
No description |
moveFirstItemUp(_clientId, changeSelection = true) X-Ref |
Moves the block with clientId up one level. If the block type cannot be inserted at the new location, it will be attempted to convert to the default block type. param: {string} _clientId The block to move. param: {boolean} changeSelection Whether to change the selection |
BlockListBlockProvider(props) X-Ref |
No description |
Tips() X-Ref |
No description |
BlockCard({title,icon,description,blockType,className}) X-Ref |
Internal dependencies |
useBlockSync({clientId = null,value: controlledBlocks,selection: controlledSelection,onChange = use_block_sync_noop,onInput = use_block_sync_noop}) X-Ref |
useBlockSync is a side effect which handles bidirectional sync between the block-editor store and a controlling data source which provides blocks. This is most commonly used by the BlockEditorProvider to synchronize the contents of the block-editor store with the root entity, like a post. Another example would be the template part block, which provides blocks from a separate entity data source than a root entity. This hook syncs edits to the template part in the block editor back to the entity and vice-versa. Here are some of its basic functions: - Initalizes the block-editor store for the given clientID to the blocks given via props. - Adds incoming changes (like undo) to the block-editor store. - Adds outgoing changes (like editing content) to the controlling entity, determining if a change should be considered persistent or not. - Handles edge cases and race conditions which occur in those operations. - Ignores changes which happen to other entities (like nested inner block controllers. - Passes selection state from the block-editor store to the controlling entity. param: {Object} props Props for the block sync hook param: {string} props.clientId The client ID of the inner block controller. param: {Object[]} props.value The control value for the blocks. This value param: {Object} props.selection The selection state responsible to restore the selection on undo/redo. param: {onBlockUpdate} props.onChange Function to call when a persistent param: {onBlockUpdate} props.onInput Function to call when a non-persistent |
KeyboardShortcuts() X-Ref |
No description |
KeyboardShortcutsRegister() X-Ref |
No description |
useBlockSelectionClearer() X-Ref |
Pass the returned ref callback to an element that should clear block selection. Selection will only be cleared if the element is clicked directly, not if a child element is clicked. return: {import('react').RefCallback} Ref callback. |
onMouseDown(event) X-Ref |
No description |
BlockSelectionClearer(props) X-Ref |
No description |
selector(select) X-Ref |
Internal dependencies |
useMultiSelection() X-Ref |
No description |
useTabNav() X-Ref |
No description |
onFocusCapture(event) X-Ref |
No description |
onKeyDown(event) X-Ref |
No description |
onFocusOut(event) X-Ref |
No description |
preventScrollOnTab(event) X-Ref |
No description |
isNavigationCandidate(element, keyCode, hasModifier) X-Ref |
Returns true if the element should consider edge navigation upon a keyboard event of the given directional key code, or false otherwise. return: {boolean} Whether element should consider edge navigation. param: {Element} element HTML element to test. param: {number} keyCode KeyboardEvent keyCode to test. param: {boolean} hasModifier Whether a modifier is pressed. |
getClosestTabbable(target, isReverse, containerElement, onlyVertical) X-Ref |
Returns the optimal tab target from the given focused element in the desired direction. A preference is made toward text fields, falling back to the block focus stop if no other candidates exist for the block. return: {?Element} Optimal tab target, if one exists. param: {Element} target Currently focused text field. param: {boolean} isReverse True if considering as the first field. param: {Element} containerElement Element containing all blocks. param: {boolean} onlyVertical Whether to only consider tabbable elements |
isTabCandidate(node) X-Ref |
No description |
useArrowNav() X-Ref |
No description |
onMouseDown() X-Ref |
No description |
isClosestTabbableABlock(target, isReverse) X-Ref |
No description |
onKeyDown(event) X-Ref |
No description |
useSelectAll() X-Ref |
Internal dependencies |
onKeyDown(event) X-Ref |
No description |
setContentEditableWrapper(node, value) X-Ref |
Sets the `contenteditable` wrapper element to `value`. param: {HTMLElement} node Block element. param: {boolean} value `contentEditable` value (true or false) |
useDragSelection() X-Ref |
Sets a multi-selection based on the native selection across blocks. |
onMouseUp() X-Ref |
No description |
onMouseLeave({buttons,target,relatedTarget}) X-Ref |
No description |
extractSelectionStartNode(selection) X-Ref |
Extract the selection start node from the selection. When the anchor node is not a text node, the selection offset is the index of a child node. return: {Element} The selection start node. param: {Selection} selection The selection. |
extractSelectionEndNode(selection) X-Ref |
Extract the selection end node from the selection. When the focus node is not a text node, the selection offset is the index of a child node. The selection reaches up to but excluding that child node. return: {Element} The selection start node. param: {Selection} selection The selection. |
findDepth(a, b) X-Ref |
No description |
use_selection_observer_setContentEditableWrapper(node, value) X-Ref |
Sets the `contenteditable` wrapper element to `value`. param: {HTMLElement} node Block element. param: {boolean} value `contentEditable` value (true or false) |
getRichTextElement(node) X-Ref |
No description |
useSelectionObserver() X-Ref |
Sets a multi-selection based on the native selection across blocks. |
onSelectionChange(event) X-Ref |
No description |
useClickSelection() X-Ref |
Internal dependencies |
onMouseDown(event) X-Ref |
No description |
useInput() X-Ref |
Handles input for selections across blocks. |
onBeforeInput(event) X-Ref |
No description |
onKeyDown(event) X-Ref |
No description |
onCompositionStart(event) X-Ref |
No description |
useNotifyCopy() X-Ref |
Internal dependencies |
removeWindowsFragments(html) X-Ref |
Normalizes a given string of HTML to remove the Windows-specific "Fragment" comments and any preceding and trailing content. return: {string} the normalized html param: {string} html the html to be normalized |
removeCharsetMetaTag(html) X-Ref |
Removes the charset meta tag inserted by Chromium. See: - https://github.com/WordPress/gutenberg/issues/33585 - https://bugs.chromium.org/p/chromium/issues/detail?id=1264616#c4 return: {string} the cleaned html param: {string} html the html to be stripped of the meta tag. |
getPasteEventData({clipboardData}) X-Ref |
No description |
shouldDismissPastedFiles(files, html ) X-Ref |
Given a collection of DataTransfer files and HTML and plain text strings, determine whether the files are to be dismissed in favor of the HTML. Certain office-type programs, like Microsoft Word or Apple Numbers, will, upon copy, generate a screenshot of the content being copied and attach it to the clipboard alongside the actual rich text that the user sought to copy. In those cases, we should let Gutenberg handle the rich text content and not the screenshot, since this allows Gutenberg to insert meaningful blocks, like paragraphs, lists or even tables. return: {boolean} True if the files should be dismissed param: {File[]} files File objects obtained from a paste event param: {string} html HTML content obtained from a paste event |
setClipboardBlocks(event, blocks, registry) X-Ref |
Sets the clipboard data for the provided blocks, with both HTML and plain text representations. param: {ClipboardEvent} event Clipboard event. param: {WPBlock[]} blocks Blocks to set as clipboard data. param: {Object} registry The registry to select from. |
getPasteBlocks(event, canUserUseUnfilteredHTML) X-Ref |
Returns the blocks to be pasted from the clipboard event. return: {Array|string} A list of blocks or a string, depending on `handlerMode`. param: {ClipboardEvent} event The clipboard event. param: {boolean} canUserUseUnfilteredHTML Whether the user can or can't post unfiltered HTML. |
toPlainText(html) X-Ref |
Given a string of HTML representing serialized blocks, returns the plain text extracted after stripping the HTML of any tags and fixing line breaks. return: {string} The plain-text content with any html removed. param: {string} html Serialized blocks. |
useClipboardHandler() X-Ref |
No description |
handler(event) X-Ref |
No description |
useWritingFlow() X-Ref |
No description |
WritingFlow({children,...props}, forwardedRef) X-Ref |
No description |
getCompatibilityStyles() X-Ref |
Returns a list of stylesheets that target the editor canvas. A stylesheet is considered targetting the editor a canvas if it contains the `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors. Ideally, this hook should be removed in the future and styles should be added explicitly as editor styles. |
matchFromRules(_cssRules) X-Ref |
No description |
bubbleEvent(event, Constructor, frame) X-Ref |
No description |
useBubbleEvents(iframeDocument) X-Ref |
Bubbles some event types (keydown, keypress, and dragover) to parent document document to ensure that the keyboard shortcuts and drag and drop work. Ideally, we should remove event bubbling in the future. Keyboard shortcuts should be context dependent, e.g. actions on blocks like Cmd+A should not work globally outside the block editor. param: {Document} iframeDocument Document to attach listeners to. |
Iframe({contentRef,children,tabIndex = 0,scale = 1,frameSize = 0,expand = false,readonly,forwardedRef: ref,...props}) X-Ref |
No description |
preventFileDropDefault(event) X-Ref |
No description |
onLoad() X-Ref |
No description |
IframeIfReady(props, ref) X-Ref |
No description |
transformStyle({css,ignoredSelectors = [],baseURL}, wrapperSelector = '') X-Ref |
No description |
useDarkThemeBodyClassName(styles, scope) X-Ref |
No description |
EditorStyles({styles,scope}) X-Ref |
No description |
ScaledBlockPreview({viewportWidth,containerWidth,minHeight,additionalStyles = EMPTY_ADDITIONAL_STYLES}) X-Ref |
No description |
AutoBlockPreview(props) X-Ref |
No description |
BlockPreview({blocks,viewportWidth = 1200,minHeight,additionalStyles = [],__experimentalMinHeight,__experimentalPadding}) X-Ref |
No description |
useBlockPreview({blocks,props = {},layout}) X-Ref |
This hook is used to lightly mark an element as a block preview wrapper element. Call this hook and pass the returned props to the element to mark as a block preview wrapper, automatically rendering inner blocks as children. If you define a ref for the element, it is important to pass the ref to this hook, which the hook in turn will pass to the component through the props it returns. Optionally, you can also pass any other props through this hook, and they will be merged and returned. param: {Object} options Preview options. param: {WPBlock[]} options.blocks Block objects. param: {Object} options.props Optional. Props to pass to the element. Must contain param: {Object} options.layout Layout settings to be used in the preview. |
InserterPreviewPanel({item}) X-Ref |
Internal dependencies |
InserterListboxItem({isFirst,as: Component,children,...props}, ref) X-Ref |
No description |
BlockDraggableChip({count,icon,isPattern,fadeWhenDisabled}) X-Ref |
Internal dependencies |
InserterListItem({className,isFirst,item,onSelect,onHover,isDraggable,...props}) X-Ref |
No description |
InserterListboxGroup(props, ref) X-Ref |
No description |
InserterListboxRow(props, ref) X-Ref |
No description |
chunk(array, size) X-Ref |
Internal dependencies |
BlockTypesList({items = [],onSelect,onHover = () X-Ref |
No description |
InserterPanel({title,icon,children}) X-Ref |
WordPress dependencies |
InserterListbox({children}) X-Ref |
No description |
BlockTypesTab({rootClientId,onInsert,onHover,showMostUsedBlocks}) X-Ref |
Shared reference to an empty array for cases where it is important to avoid returning a new array reference on every invocation and rerendering the component. |
PatternCategoriesList({selectedCategory,patternCategories,onClickCategory}) X-Ref |
WordPress dependencies |
PatternsExplorerSearch({searchValue,setSearchValue}) X-Ref |
No description |
PatternExplorerSidebar({selectedCategory,patternCategories,onClickCategory,searchValue,setSearchValue}) X-Ref |
No description |
Pagination({currentPage,numPages,changePage,totalItems}) X-Ref |
WordPress dependencies |
BlockPattern({id,isDraggable,pattern,onClick,onHover,showTooltip}) X-Ref |
No description |
BlockPatternPlaceholder() X-Ref |
No description |
BlockPatternsList({isDraggable,blockPatterns,shownPatterns,onHover,onClickPattern,orientation,label = (0,external_wp_i18n_namespaceObject.__) X-Ref |
No description |
useInsertionPoint({rootClientId = '',insertionIndex,clientId,isAppender,onSelect,shouldFocusBlock = true,selectBlockOnInsert = true}) X-Ref |
Returns the insertion point state given the inserter config. return: {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle). param: {WPInserterConfig} config Inserter Config. |
usePatternsPaging(currentCategoryPatterns, currentCategory, scrollContainerRef, currentFilter = '') X-Ref |
Supplies values needed to page the patterns list client side. return: {Object} Returns the relevant paging values. (totalItems, categoryPatternsList, numPages, changePage, currentPage) param: {Array} currentCategoryPatterns An array of the current patterns to display. param: {string} currentCategory The currently selected category. param: {Object} scrollContainerRef Ref of container to to find scroll container for when moving between pages. param: {string} currentFilter The currently search filter. |
PatternsListHeader({filterValue,filteredBlockPatternsLength}) X-Ref |
No description |
PatternList({searchValue,selectedCategory,patternCategories,rootClientId}) X-Ref |
No description |
hasRegisteredCategory(pattern, allCategories) X-Ref |
Internal dependencies |
usePatternCategories(rootClientId, sourceFilter = 'all') X-Ref |
No description |
PatternsExplorer({initialCategory,rootClientId}) X-Ref |
No description |
PatternsExplorerModal({onModalClose,...restProps}) X-Ref |
No description |
ScreenHeader({title}) X-Ref |
No description |
MobileTabNavigation({categories,children}) X-Ref |
No description |
PatternsFilter({setPatternSyncFilter,setPatternSourceFilter,patternSyncFilter,patternSourceFilter,scrollContainerRef,category}) X-Ref |
No description |
handleSetSourceFilterChange(newSourceFilter) X-Ref |
No description |
PatternCategoryPreviews({rootClientId,onInsert,onHover = pattern_category_previews_noop,category,showTitlesAsTooltip}) X-Ref |
No description |
BlockPatternsTab({onSelectCategory,selectedCategory,onInsert,rootClientId}) X-Ref |
No description |
PatternCategoryPreviewPanel({rootClientId,onInsert,onHover,category,showTitlesAsTooltip,patternFilter}) X-Ref |
Internal dependencies |
useMediaResults(category, query = {}) X-Ref |
Fetches media items based on the provided category. Each media category is responsible for providing a `fetch` function. return: {InserterMediaItem[]} The media results. param: {Object} category The media category to fetch results for. param: {InserterMediaRequest} query The query args to use for the request. |
useMediaCategories(rootClientId) X-Ref |
No description |
getBlockAndPreviewFromMedia(media, mediaType) X-Ref |
Creates a block and a preview element from a media object. return: {[WPBlock, JSX.Element]} An array containing the block and the preview element. param: {InserterMediaItem} media The media object to create the block from. param: {('image'|'audio'|'video')} mediaType The media type to create the block for. |
MediaPreviewOptions({category,media}) X-Ref |
No description |
InsertExternalImageModal({onClose,onSubmit}) X-Ref |
No description |
MediaPreview({media,onClick,category}) X-Ref |
No description |
MediaList({mediaList,category,onClick,label = (0,external_wp_i18n_namespaceObject.__) X-Ref |
No description |
InserterNoResults() X-Ref |
WordPress dependencies |
MediaCategoryDialog({rootClientId,onInsert,category}) X-Ref |
No description |
MediaCategoryPanel({rootClientId,onInsert,category}) X-Ref |
No description |
MediaTab({rootClientId,selectedCategory,onSelectCategory,onInsert}) X-Ref |
No description |
InserterSearchResults({filterValue,onSelect,onHover,onHoverPattern,rootClientId,clientId,isAppender,__experimentalInsertionIndex,maxBlockPatterns,maxBlockTypes,showBlockDirectory = false,isDraggable = true,shouldFocusBlock = true,prioritizePatterns,selectBlockOnInsert}) X-Ref |
Shared reference to an empty array for cases where it is important to avoid returning a new array reference on every invocation and rerendering the component. |
InserterTabs({showPatterns = false,showMedia = false,onSelect,tabsContents}) X-Ref |
No description |
InserterMenu({rootClientId,clientId,isAppender,__experimentalInsertionIndex,onSelect,showInserterHelpPanel,showMostUsedBlocks,__experimentalFilterValue = '',shouldFocusBlock = true}, ref) X-Ref |
No description |
QuickInserter({onSelect,rootClientId,clientId,isAppender,prioritizePatterns,selectBlockOnInsert,hasSearch = true}) X-Ref |
No description |
handleClick(event) X-Ref |
No description |
Class: PrivateInserter - X-Ref
getAdjacentBlockAttributes(attributesToCopy) X-Ref |
No description |
getInsertionIndex() X-Ref |
No description |
DefaultBlockAppender({rootClientId}) X-Ref |
Zero width non-breaking space, used as padding for the paragraph when it is empty. |
ButtonBlockAppender({rootClientId,className,onFocus,tabIndex}, ref) X-Ref |
Internal dependencies |
DefaultAppender({rootClientId}) X-Ref |
No description |
BlockListAppender({rootClientId,CustomAppender,className,tagName: TagName = 'div'}) X-Ref |
No description |
BlockPopoverInbetween({previousClientId,nextClientId,children,__unstablePopoverSlot,__unstableContentRef,operation = 'insert',nearestSide = 'right',...props}) X-Ref |
No description |
BlockDropZonePopover({__unstablePopoverSlot,__unstableContentRef}) X-Ref |
No description |
InbetweenInsertionPointPopover({__unstablePopoverSlot,__unstableContentRef,operation = 'insert',nearestSide = 'right'}) X-Ref |
No description |
onClick(event) X-Ref |
No description |
maybeHideInserterPoint(event) X-Ref |
No description |
onFocus(event) X-Ref |
No description |
InsertionPoint(props) X-Ref |
No description |
useInBetweenInserter() X-Ref |
Internal dependencies |
onMouseMove(event) X-Ref |
No description |
useShallowMemo(value) X-Ref |
No description |
useNestedSettingsUpdate(clientId, parentLock, allowedBlocks, prioritizedInserterBlocks, defaultBlock, directInsert, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout) X-Ref |
This hook is a side effect which updates the block-editor store when changes happen to inner block settings. The given props are transformed into a settings object, and if that is different from the current settings object in the block-editor store, then the store is updated with the new settings which came from props. param: {string} clientId The client ID of the block to update. param: {string} parentLock param: {string[]} allowedBlocks An array of block names which are permitted param: {string[]} prioritizedInserterBlocks Block names and/or block variations to be prioritized in the inserter, in the format {blockName}/{variationName}. param: {?WPDirectInsertBlock} defaultBlock The default block to insert: [ blockName, { blockAttributes } ]. param: {?Function|boolean} directInsert If a default block should be inserted directly by the appender. param: {?WPDirectInsertBlock} __experimentalDefaultBlock A deprecated prop for the default block to insert: [ blockName, { blockAttributes } ]. Use `defaultBlock` instead. param: {?Function|boolean} __experimentalDirectInsert A deprecated prop for whether a default block should be inserted directly by the appender. Use `directInsert` instead. param: {string} [templateLock] The template lock specified for the inner param: {boolean} captureToolbars Whether or children toolbars should be shown param: {string} orientation The direction in which the block param: {Object} layout The layout object for the block container. |
useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection) X-Ref |
This hook makes sure that a block's inner blocks stay in sync with the given block "template". The template is a block hierarchy to which inner blocks must conform. If the blocks get "out of sync" with the template and the template is meant to be locked (e.g. templateLock = "all" or templateLock = "contentOnly"), then we replace the inner blocks with the correct value after synchronizing it with the template. param: {string} clientId The block client ID. param: {Object} template The template to match. param: {string} templateLock The template lock state for the inner blocks. For param: {boolean} templateInsertUpdatesSelection Whether or not to update the |
useBlockContext(clientId) X-Ref |
Returns a context object for a given block. return: {Record<string,*>} Context value. param: {string} clientId The block client ID. |
parseDropEvent(event) X-Ref |
Retrieve the data for a block drop event. return: {Object} An object with block drag and drop data. param: {SyntheticEvent} event The drop event. |
onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocks, insertOrReplaceBlocks, clearSelectedBlock, operation, getBlock) X-Ref |
A function that returns an event handler function for block drop events. return: {Function} The event handler for a block drop event. param: {string} targetRootClientId The root client id where the block(s) will be inserted. param: {number} targetBlockIndex The index where the block(s) will be inserted. param: {Function} getBlockIndex A function that gets the index of a block. param: {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks. param: {Function} moveBlocks A function that moves blocks. param: {Function} insertOrReplaceBlocks A function that inserts or replaces blocks. param: {Function} clearSelectedBlock A function that clears block selection. param: {string} operation The type of operation to perform on drop. Could be `insert` or `replace` or `group`. param: {Function} getBlock A function that returns a block given its client id. |
onFilesDrop(targetRootClientId, getSettings, updateBlockAttributes, canInsertBlockType, insertOrReplaceBlocks) X-Ref |
A function that returns an event handler function for block-related file drop events. return: {Function} The event handler for a block-related file drop event. param: {string} targetRootClientId The root client id where the block(s) will be inserted. param: {Function} getSettings A function that gets the block editor settings. param: {Function} updateBlockAttributes A function that updates a block's attributes. param: {Function} canInsertBlockType A function that returns checks whether a block type can be inserted. param: {Function} insertOrReplaceBlocks A function that inserts or replaces blocks. |
onHTMLDrop(insertOrReplaceBlocks) X-Ref |
A function that returns an event handler function for block-related HTML drop events. return: {Function} The event handler for a block-related HTML drop event. param: {Function} insertOrReplaceBlocks A function that inserts or replaces blocks. |
useOnBlockDrop(targetRootClientId, targetBlockIndex, options = {}) X-Ref |
A React hook for handling block drop events. return: {Function} A function to be passed to the onDrop handler. param: {string} targetRootClientId The root client id where the block(s) will be inserted. param: {number} targetBlockIndex The index where the block(s) will be inserted. param: {Object} options The optional options. param: {WPDropOperation} [options.operation] The type of operation to perform on drop. Could be `insert` or `replace` for now. |
getDistanceFromPointToEdge(point, rect, edge) X-Ref |
Given a point, a DOMRect and the name of an edge, returns the distance to that edge of the rect. This function works for edges that are horizontal or vertical (e.g. not rotated), the following terms are used so that the function works in both orientations: - Forward, meaning the axis running horizontally when an edge is vertical and vertically when an edge is horizontal. - Lateral, meaning the axis running vertically when an edge is vertical and horizontally when an edge is horizontal. param: {WPPoint} point The point to measure distance from. param: {DOMRect} rect A DOM Rect containing edge positions. param: {WPEdgeName} edge The edge to measure to. |
getDistanceToNearestEdge(point, rect, allowedEdges = ['top', 'bottom', 'left', 'right']) X-Ref |
Given a point, a DOMRect and a list of allowed edges returns the name of and distance to the nearest edge. return: {[number, string]} An array where the first value is the distance param: {WPPoint} point The point to measure distance from. param: {DOMRect} rect A DOM Rect containing edge positions. param: {WPEdgeName[]} allowedEdges A list of the edges included in the |
isPointContainedByRect(point, rect) X-Ref |
Is the point contained by the rectangle. return: {boolean} True if the point is contained by the rectangle, false otherwise. param: {WPPoint} point The point. param: {DOMRect} rect The rectangle. |
isPointWithinTopAndBottomBoundariesOfRect(point, rect) X-Ref |
Is the point within the top and bottom boundaries of the rectangle. return: {boolean} True if the point is within top and bottom of rectangle, false otherwise. param: {WPPoint} point The point. param: {DOMRect} rect The rectangle. |
getDropTargetPosition(blocksData, position, orientation = 'vertical', options = {}) X-Ref |
Get the drop target position from a given drop point and the orientation. return: {[number, WPDropOperation]} The drop target position. param: {WPBlockData[]} blocksData The block data list. param: {WPPoint} position The position of the item being dragged. param: {WPBlockListOrientation} orientation The orientation of the block list. param: {Object} options Additional options. |
isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName) X-Ref |
Check if the dragged blocks can be dropped on the target. return: {boolean} Whether the dragged blocks can be dropped on the target. param: {Function} getBlockType param: {Object[]} allowedBlocks param: {string[]} draggedBlockNames param: {string} targetBlockName |
useBlockDropZone({dropZoneElement,rootClientId: targetRootClientId = '',parentClientId: parentBlockClientId = '',isDisabled = false} = {}) X-Ref |
A React hook that can be used to make a block list handle drag and drop. param: {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone. |
BlockContext({children,clientId}) X-Ref |
No description |
UncontrolledInnerBlocks(props) X-Ref |
InnerBlocks is a component which allows a single block to have multiple blocks as children. The UncontrolledInnerBlocks component is used whenever the inner blocks are not controlled by another entity. In other words, it is normally used for inner blocks in the post editor param: {Object} props The component props. |
ControlledInnerBlocks(props) X-Ref |
The controlled inner blocks component wraps the uncontrolled inner blocks component with the blockSync hook. This keeps the innerBlocks of the block in the block-editor store in sync with the blocks of the controlling entity. An example of an inner block controller is a template part block, which provides its own blocks from the template part entity data source. param: {Object} props The component props. |
useInnerBlocksProps(props = {}, options = {}) X-Ref |
This hook is used to lightly mark an element as an inner blocks wrapper element. Call this hook and pass the returned props to the element to mark as an inner blocks wrapper, automatically rendering inner blocks as children. If you define a ref for the element, it is important to pass the ref to this hook, which the hook in turn will pass to the component through the props it returns. Optionally, you can also pass any other props through this hook, and they will be merged and returned. param: {Object} props Optional. Props to pass to the element. Must contain param: {Object} options Optional. Inner blocks options. |
isKeyDownEligibleForStartTyping(event) X-Ref |
Returns true if a given keydown event can be inferred as intent to start typing, or false otherwise. A keydown is considered eligible if it is a text navigation without shift active. return: {boolean} Whether event is eligible to start typing. param: {KeyboardEvent} event Keydown event to test. |
useMouseMoveTypingReset() X-Ref |
Removes the `isTyping` flag when the mouse moves in the document of the given element. |
stopTypingOnMouseMove(event) X-Ref |
On mouse move, unset typing flag if user has moved cursor. param: {MouseEvent} event Mousemove event. |
useTypingObserver() X-Ref |
Sets and removes the `isTyping` flag based on user actions: - Sets the flag if the user types within the given element. - Removes the flag when the user selects some text, focusses a non-text field, presses ESC or TAB, or moves the mouse in the document. |
stopTypingOnNonTextField(event) X-Ref |
Stops typing when focus transitions to a non-text field element. param: {FocusEvent} event Focus event. |
stopTypingOnEscapeKey(event) X-Ref |
Unsets typing flag if user presses Escape while typing flag is active. param: {KeyboardEvent} event Keypress or keydown event to |
stopTypingOnSelectionUncollapse() X-Ref |
On selection change, unset typing flag if user has made an uncollapsed (shift) selection. |
startTypingInTextField(event) X-Ref |
Handles a keypress or keydown event to infer intention to start typing. param: {KeyboardEvent} event Keypress or keydown event to interpret. |
ObserveTyping({children}) X-Ref |
No description |
block_list_Root({className,...settings}) X-Ref |
No description |
StopEditingAsBlocksOnOutsideSelect({clientId}) X-Ref |
No description |
BlockList(settings) X-Ref |
No description |
Items({placeholder,rootClientId,renderAppender: CustomAppender,__experimentalAppenderTagName,layout = defaultLayout}) X-Ref |
No description |
BlockListItems(props) X-Ref |
No description |
getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky) X-Ref |
Get the popover props for the block toolbar, determined by the space at the top of the canvas and the toolbar height. return: {Object} The popover props used to determine the position of the toolbar. param: {Element} contentElement The DOM element that represents the editor content or canvas. param: {Element} selectedBlockElement The outer DOM element of the first selected block. param: {Element} scrollContainer The scrollable container for the contentElement. param: {number} toolbarHeight The height of the toolbar in pixels. param: {boolean} isSticky Whether or not the selected block is sticky or fixed. |
useBlockToolbarPopoverProps({contentElement,clientId}) X-Ref |
Determines the desired popover positioning behavior, returning a set of appropriate props. return: {Object} The popover props used to determine the position of the toolbar. param: {Object} elements param: {Element} elements.contentElement The DOM element that represents the editor content or canvas. param: {string} elements.clientId The clientId of the first selected block. |
useSelectedBlockToolProps(clientId) X-Ref |
Returns props for the selected block tools and empty block inserter. param: {string} clientId Selected block client ID. |
EmptyBlockInserter({clientId,__unstableContentRef}) X-Ref |
No description |
useScrollWhenDragging() X-Ref |
React hook that scrolls the scroll container when a block is being dragged. return: {Function[]} `startScrolling`, `scrollOnDragOver`, `stopScrolling` |
getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLast, dir, orientation) X-Ref |
Return a label for the block movement controls depending on block position. return: {string | undefined} Label for the block movement controls. param: {number} selectedCount Number of blocks selected. param: {string} type Block type - in the case of a single block, should param: {number} firstIndex The index (position - 1) of the first block selected. param: {boolean} isFirst This is the first block. param: {boolean} isLast This is the last block. param: {number} dir Direction of movement (> 0 is considered to be going param: {string} orientation The orientation of the block movers, vertical or |
getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir, orientation) X-Ref |
Return a label for the block movement controls depending on block position. return: {string | undefined} Label for the block movement controls. param: {number} selectedCount Number of blocks selected. param: {number} firstIndex The index (position - 1) of the first block selected. param: {boolean} isFirst This is the first block. param: {boolean} isLast This is the last block. param: {number} dir Direction of movement (> 0 is considered to be going param: {string} orientation The orientation of the block movers, vertical or |
BlockMover({clientIds,hideDragHandle}) X-Ref |
No description |
useDebouncedShowGestures({ref,isFocused,highlightParent,debounceTimeout = DEBOUNCE_TIMEOUT}) X-Ref |
Hook that creates debounced callbacks when the node is hovered or focused. param: {Object} props Component props. param: {Object} props.ref Element reference. param: {boolean} props.isFocused Whether the component has current focus. param: {number} props.highlightParent Whether to highlight the parent block. It defaults in highlighting the selected block. param: {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. |
useShowHoveredOrFocusedGestures({ref,highlightParent = false,debounceTimeout = DEBOUNCE_TIMEOUT}) X-Ref |
Hook that provides gesture events for DOM elements that interact with the isFocused state. param: {Object} props Component props. param: {Object} props.ref Element reference. param: {number} [props.highlightParent=false] Whether to highlight the parent block. It defaults to highlighting the selected block. param: {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. |
BlockParentSelector() X-Ref |
Block parent selector component, displaying the hierarchy of the current block selection as a single icon to "go up" a level. return: {Component} Parent block selector. |
PreviewBlockPopover({blocks}) X-Ref |
Internal dependencies |
useBlockVariationTransforms({clientIds,blocks}) X-Ref |
No description |
BlockVariationTranformationItem({item,onSelect,setHoveredTransformItemName}) X-Ref |
No description |
useGroupedTransforms(possibleBlockTransformations) X-Ref |
Helper hook to group transformations to display them in a specific order in the UI. For now we group only priority content driven transformations(ex. paragraph -> heading). Later on we could also group 'layout' transformations(ex. paragraph -> group) and display them in different sections. return: {Record<string, Object[]>} The grouped block transformations. param: {Object[]} possibleBlockTransformations The available block transformations. |
RestTransformationItems({restTransformations,onSelect,setHoveredTransformItemName}) X-Ref |
No description |
BlockTranformationItem({item,onSelect,setHoveredTransformItemName}) X-Ref |
No description |
getActiveStyle(styles, className) X-Ref |
Returns the active style from the given className. return: {Object?} The active style. param: {Array} styles Block styles. param: {string} className Class name |
replaceActiveStyle(className, activeStyle, newStyle) X-Ref |
Replaces the active style in the block's className. return: {string} The updated className. param: {string} className Class name. param: {Object?} activeStyle The replaced style. param: {Object} newStyle The replacing style. |
getRenderedStyles(styles) X-Ref |
Returns a collection of styles that can be represented on the frontend. The function checks a style collection for a default style. If none is found, it adds one to act as a fallback for when there is no active style applied to a block. The default item also serves as a switch on the frontend to deactivate non-default styles. return: {Array<Object?>} The style collection. param: {Array} styles Block styles. |
getDefaultStyle(styles) X-Ref |
Returns a style object from a collection of styles where that style object is the default block style. return: {Object?} The default style object, if found. param: {Array} styles Block styles. |
useGenericPreviewBlock(block, type) X-Ref |
return: {WPBlock} A generic block ready for styles preview. param: {WPBlock} block Block object. param: {WPBlockType} type Block type settings. |
useStylesForBlocks({clientId,onSwitch}) X-Ref |
return: {Object} Results of the select methods. param: {useStylesForBlocksArguments} useStylesForBlocks arguments. |
BlockStylesMenuItems({clientId,onSwitch = menu_items_noop}) X-Ref |
Internal dependencies |
BlockStylesMenu({hoveredBlock,onSwitch}) X-Ref |
Internal dependencies |
PatternTransformationsMenu({blocks,patterns: statePatterns,onSelect}) X-Ref |
No description |
PreviewPatternsPopover({patterns,onSelect}) X-Ref |
No description |
pattern_transformations_menu_BlockPatternsList({patterns,onSelect}) X-Ref |
No description |
pattern_transformations_menu_BlockPattern({pattern,onSelect}) X-Ref |
No description |
BlockSwitcherDropdownMenuContents({onClose,clientIds,hasBlockStyles,canRemove}) X-Ref |
No description |
selectForMultipleBlocks(insertedBlocks) X-Ref |
No description |
onBlockTransform(name) X-Ref |
No description |
onBlockVariationTransform(name) X-Ref |
No description |
onPatternTransform(transformedBlocks) X-Ref |
No description |
supports_hasBorderSupport(nameOrType, feature = 'any') X-Ref |
Determine whether there is block support for border properties. return: {boolean} Whether there is support. param: {string|Object} nameOrType Block name or type object. param: {string} feature Border feature to check support for. |
hasSerializedBlocks(text) X-Ref |
Determine if the copied text looks like serialized blocks or not. Since plain text will always get parsed into a freeform block, we check that if the parsed blocks is anything other than that. return: {boolean} True if the text looks like serialized blocks, false otherwise. param: {string} text The copied text. |
getStyleAttributes(sourceBlock, targetBlock) X-Ref |
Get the "style attributes" from a given block to a target block. return: {Object} the filtered attributes object. param: {WPBlock} sourceBlock The source block. param: {WPBlock} targetBlock The target block. |
recursivelyUpdateBlockAttributes(targetBlocks, sourceBlocks, updateBlockAttributes) X-Ref |
Update the target blocks with style attributes recursively. param: {WPBlock[]} targetBlocks The target blocks to be updated. param: {WPBlock[]} sourceBlocks The source blocks to get th style attributes from. param: {Function} updateBlockAttributes The function to update the attributes. |
usePasteStyles() X-Ref |
A hook to return a pasteStyles event function for handling pasting styles to blocks. return: {Function} A function to update the styles to the blocks. |
BlockActions({clientIds,children,__experimentalUpdateSelection: updateSelection}) X-Ref |
No description |
BlockHTMLConvertButton({clientId}) X-Ref |
Internal dependencies |
CopyMenuItem({clientIds,onCopy,label}) X-Ref |
No description |
ParentSelectorMenuItem({parentClientId,parentBlockType}) X-Ref |
No description |
BlockSettingsDropdown({block,clientIds,__experimentalSelectBlock,children,__unstableDisplayLocation,...props}) X-Ref |
No description |
BlockSettingsMenu({clientIds,...props}) X-Ref |
Internal dependencies |
BlockLockToolbar({clientId}) X-Ref |
Internal dependencies |
BlockGroupToolbar() X-Ref |
No description |
BlockEditVisuallyButton({clientIds}) X-Ref |
Internal dependencies |
hasOnlyToolbarItem(elements) X-Ref |
Internal dependencies |
getAllFocusableToolbarItemsIn(container) X-Ref |
No description |
hasFocusWithin(container) X-Ref |
No description |
focusFirstTabbableIn(container) X-Ref |
No description |
useIsAccessibleToolbar(toolbarRef) X-Ref |
No description |
useToolbarFocus({toolbarRef,focusOnMount,isAccessibleToolbar,defaultIndex,onIndexChange,shouldUseKeyboardFocusShortcut,focusEditorOnEscape}) X-Ref |
No description |
NavigableToolbar({children,focusOnMount,focusEditorOnEscape = false,shouldUseKeyboardFocusShortcut = true,__experimentalInitialIndex: initialIndex,__experimentalOnIndexChange: onIndexChange,...props}) X-Ref |
No description |
useHasAnyBlockControls() X-Ref |
Internal dependencies |
useHasBlockControls(group = 'default') X-Ref |
No description |
BlockBindingsToolbarIndicator() X-Ref |
No description |
PrivateBlockToolbar({hideDragHandle,focusOnMount,__experimentalInitialIndex,__experimentalOnIndexChange,variant = 'unstyled'}) X-Ref |
Renders the block toolbar. param: {Object} props Components props. param: {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality. param: {boolean} props.focusOnMount Focus the toolbar when mounted. param: {number} props.__experimentalInitialIndex The initial index of the toolbar item to focus. param: {Function} props.__experimentalOnIndexChange Callback function to be called when the index of the focused toolbar item changes. param: {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons. |
BlockToolbar({hideDragHandle,variant}) X-Ref |
Renders the block toolbar. param: {Object} props Components props. param: {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality. param: {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons. |
BlockToolbarPopover({clientId,isTyping,__unstableContentRef}) X-Ref |
No description |
BlockSelectionButton({clientId,rootClientId}) X-Ref |
Block selection button component, displaying the label of the block. If the block descends from a root block, a button is displayed enabling the user to select the root block. return: {Component} The component to be rendered. param: {string} props Component props. param: {string} props.clientId Client ID of block. |
onKeyDown(event) X-Ref |
No description |
BlockToolbarBreadcrumb({clientId,__unstableContentRef}) X-Ref |
No description |
ZoomOutModeInserters({__unstableContentRef}) X-Ref |
No description |
block_tools_selector(select) X-Ref |
No description |
BlockTools({children,__unstableContentRef,...props}) X-Ref |
Renders block tools (the block toolbar, select/navigation mode toolbar, the insertion point and a slot for the inline rich text toolbar). Must be wrapped around the block content and editor styles wrapper or iframe. param: {Object} $0 Props. param: {Object} $0.children The block content and style container. param: {Object} $0.__unstableContentRef Ref holding the content scroll container. |
onKeyDown(event) X-Ref |
No description |
ExperimentalBlockCanvas({shouldIframe = true,height = '300px',children = (0,external_React_.createElement) X-Ref |
No description |
BlockCanvas({children,height,styles}) X-Ref |
BlockCanvas component is a component used to display the canvas of the block editor. What we call the canvas is an iframe containing the block list that you can manipulate. The component is also responsible of wiring up all the necessary hooks to enable the keyboard navigation across blocks in the editor and inject content styles into the iframe. return: {Element} Block Breadcrumb. param: {Object} props Component props. param: {string} props.height Canvas height, defaults to 300px. param: {Array} props.styles Content styles to inject into the iframe. param: {Element} props.children Content of the canvas, defaults to the BlockList component. |
AriaReferencedText({children,...props}) X-Ref |
A component specifically designed to be used as an element referenced by ARIA attributes such as `aria-labelledby` or `aria-describedby`. param: {Object} props Props. param: {import('react').ReactNode} props.children |
useListViewScrollIntoView({isSelected,selectedClientIds,rowItemRef}) X-Ref |
WordPress dependencies |
ListViewExpander({onClick}) X-Ref |
WordPress dependencies |
getImage(block) X-Ref |
No description |
getImagesFromGallery(block) X-Ref |
No description |
getImagesFromBlock(block, isExpanded) X-Ref |
No description |
useListViewImages({clientId,isExpanded}) X-Ref |
Get a block's preview images for display within a list view row. TODO: Currently only supports images from the core/image and core/gallery blocks. This should be expanded to support other blocks that have images, potentially via an API that blocks can opt into / provide their own logic. return: {Array} Images. param: {Object} props Hook properties. param: {string} props.clientId The block's clientId. param: {boolean} props.isExpanded Whether or not the block is expanded in the list view. |
ListViewBlockSelectButton({className,block: {clientId,name: blockName},onClick,onContextMenu,onMouseDown,onToggleExpanded,tabIndex,onFocus,onDragStart,onDragEnd,draggable,isExpanded,ariaLabel,ariaDescribedBy,updateFocusAndSelection}, ref) X-Ref |
No description |
getBlocksToUpdate() X-Ref |
No description |
getCommonDepthClientIds(startId, endId, startParents, endParents) X-Ref |
From a start and end clientId of potentially different nesting levels, return the nearest-depth ids that have a common level of depth in the nesting hierarchy. For multiple block selection, this ensure that the selection is always at the same nesting level, and not split across separate levels. return: {Object} An object containing the start and end ids. param: {string} startId The first id of a selection. param: {string} endId The end id of a selection, usually one that has been clicked on. param: {string[]} startParents An array of ancestor ids for the start id, in descending order. param: {string[]} endParents An array of ancestor ids for the end id, in descending order. |
focusListItem(focusClientId, treeGridElement) X-Ref |
Shift focus to the list view item associated with a particular clientId. param: {string} focusClientId The client ID of the block to focus. param: {?HTMLElement} treeGridElement The container element to search within. |
getDragDisplacementValues({blockIndexes,blockDropTargetIndex,blockDropPosition,clientId,firstDraggedBlockIndex,isDragged}) X-Ref |
Get values for the block that flag whether the block should be displaced up or down, whether the block is being nested, and whether the block appears after the dragged blocks. These values are used to determine the class names to apply to the block. The list view rows are displaced visually via CSS rules. Displacement rules: - `normal`: no displacement — used to apply a translateY of `0` so that the block appears in its original position, and moves to that position smoothly when dragging outside of the list view area. - `up`: the block should be displaced up, creating room beneath the block for the drop indicator. - `down`: the block should be displaced down, creating room above the block for the drop indicator. return: {Object} An object containing the `displacement`, `isAfterDraggedBlocks` and `isNesting` values. param: {Object} props param: {Object} props.blockIndexes The indexes of all the blocks in the list view, keyed by clientId. param: {number|null|undefined} props.blockDropTargetIndex The index of the block that the user is dropping to. param: {?string} props.blockDropPosition The position relative to the block that the user is dropping to. param: {string} props.clientId The client id for the current block. param: {?number} props.firstDraggedBlockIndex The index of the first dragged block. param: {?boolean} props.isDragged Whether the current block is being dragged. Dragged blocks skip displacement. |
ListViewBlock({block: {clientId},displacement,isAfterDraggedBlocks,isDragged,isNesting,isSelected,isBranchSelected,selectBlock,position,level,rowCount,siblingBlockCount,showBlockMovers,path,isExpanded,selectedClientIds,isSyncedBranch}) X-Ref |
No description |
countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault) X-Ref |
Given a block, returns the total number of blocks in that subtree. This is used to help determine the list position of a block. When a block is collapsed, we do not count their children as part of that total. In the current drag implementation dragged blocks and their children are not counted. return: {number} block count param: {Object} block block tree param: {Object} expandedState state that notes which branches are collapsed param: {Array} draggedClientIds a list of dragged client ids param: {boolean} isExpandedByDefault flag to determine the default fallback expanded state. |
ListViewBranch(props) X-Ref |
No description |
ListViewDropIndicatorPreview({draggedBlockClientId,listViewRef,blockDropTarget}) X-Ref |
No description |
useBlockSelection() X-Ref |
Internal dependencies |
useListViewBlockIndexes(blocks) X-Ref |
WordPress dependencies |
useListViewClientIds({blocks,rootClientId}) X-Ref |
Internal dependencies |
isUpGesture(point, rect, nestingLevel = 1, rtl = false) X-Ref |
Determines whether the user is positioning the dragged block to be moved up to a parent level. Determined based on nesting level indentation of the current block. return: {boolean} Whether the gesture is an upward gesture. param: {WPPoint} point The point representing the cursor position when dragging. param: {DOMRect} rect The rectangle. param: {number} nestingLevel The nesting level of the block. param: {boolean} rtl Whether the editor is in RTL mode. |
getDesiredRelativeParentLevel(point, rect, nestingLevel = 1, rtl = false) X-Ref |
Returns how many nesting levels up the user is attempting to drag to. The relative parent level is calculated based on how far the cursor is from the provided nesting level (e.g. of a candidate block that the user is hovering over). The nesting level is considered "desired" because it is not guaranteed that the user will be able to drag to the desired level. The returned integer can be used to access an ascending array of parent blocks, where the first item is the block the user is hovering over, and the last item is the root block. return: {number} The desired relative parent level. param: {WPPoint} point The point representing the cursor position when dragging. param: {DOMRect} rect The rectangle. param: {number} nestingLevel The nesting level of the block. param: {boolean} rtl Whether the editor is in RTL mode. |
getCandidateBlockParents(candidateBlockData, blocksData) X-Ref |
Returns an array of the parent blocks of the block the user is dropping to. return: {WPListViewDropZoneBlocks} An array of block parents, including the block the user is dropping to. param: {WPListViewDropZoneBlock} candidateBlockData The block the user is dropping to. param: {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. |
getNextNonDraggedBlock(blocksData, index) X-Ref |
Given a list of blocks data and a block index, return the next non-dragged block. This is used to determine the block that the user is dropping to, while ignoring the dragged block. return: {WPListViewDropZoneBlock | undefined} The next non-dragged block. param: {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. param: {number} index The index to begin searching from. |
isNestingGesture(point, rect, nestingLevel = 1, rtl = false) X-Ref |
Determines whether the user positioning the dragged block to nest as an inner block. Determined based on nesting level indentation of the current block, plus the indentation of the next level of nesting. The vertical position of the cursor must also be within the block. param: {WPPoint} point The point representing the cursor position when dragging. param: {DOMRect} rect The rectangle. param: {number} nestingLevel The nesting level of the block. param: {boolean} rtl Whether the editor is in RTL mode. |
getListViewDropTarget(blocksData, position, rtl = false) X-Ref |
Given blocks data and the cursor position, compute the drop target. return: {WPListViewDropZoneTarget | undefined} An object containing data about the drop target. param: {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. param: {WPPoint} position The point representing the cursor position when dragging. param: {boolean} rtl Whether the editor is in RTL mode. |
useListViewDropZone({dropZoneElement,expandedState,setExpandedState}) X-Ref |
A react hook for implementing a drop zone in list view. return: {WPListViewDropZoneTarget} The drop target. param: {Object} props Named parameters. param: {?HTMLElement} [props.dropZoneElement] Optional element to be used as the drop zone. param: {Object} [props.expandedState] The expanded state of the blocks in the list view. param: {Function} [props.setExpandedState] Function to set the expanded state of a list of block clientIds. |
useListViewExpandSelectedItem({firstSelectedBlockClientId,setExpandedState}) X-Ref |
Internal dependencies |
use_clipboard_handler_useClipboardHandler({selectBlock}) X-Ref |
No description |
updateFocusAndSelection(focusClientId, shouldSelectBlock) X-Ref |
No description |
getBlocksToUpdate(clientId) X-Ref |
No description |
handler(event) X-Ref |
No description |
ListViewComponent({id,blocks,dropZoneElement,showBlockMovers = false,isExpanded = false,showAppender = false,blockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,rootClientId,description,onSelect,additionalBlockContent: AdditionalBlockContent}, ref) X-Ref |
Show a hierarchical list of blocks. param: {Object} props Components props. param: {string} props.id An HTML element id for the root element of ListView. param: {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy. param: {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone. param: {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`. param: {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`. param: {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`. param: {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component. param: {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list. param: {string} props.description Optional accessible description for the tree grid component. param: {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected. param: {?ComponentType} props.additionalBlockContent Component that renders additional block content UI. param: {Ref} ref Forwarded ref |
BlockNavigationDropdownToggle({isEnabled,onToggle,isOpen,innerRef,...props}) X-Ref |
Internal dependencies |
BlockNavigationDropdown({isDisabled,...props}, ref) X-Ref |
No description |
BlockStylesPreviewPanel({genericPreviewBlock,style,className,activeStyle}) X-Ref |
Internal dependencies |
BlockStyles({clientId,onSwitch = block_styles_noop,onHoverClassName = block_styles_noop}) X-Ref |
No description |
HeadingLevelIcon({level}) X-Ref |
Heading level icon. return: {?ComponentType} The icon. param: {WPHeadingLevelIconProps} props Component props. |
HeadingLevelDropdown({options = HEADING_LEVELS,value,onChange}) X-Ref |
Dropdown for selecting a heading level (1 through 6) or paragraph (0). return: {ComponentType} The toolbar. param: {WPHeadingLevelDropdownProps} props Component props. |
BlockVariationPicker({icon = library_layout,label = (0,external_wp_i18n_namespaceObject.__) X-Ref |
No description |
usePatternsSetup(clientId, blockName, filterPatternsFn) X-Ref |
Internal dependencies |
block_pattern_setup_BlockPattern({pattern,onSelect,showTitles}) X-Ref |
No description |
BlockPatternSlide({active,className,pattern,minHeight}) X-Ref |
No description |
VariationsButtons({className,onSelectVariation,selectedValue,variations}) X-Ref |
Internal dependencies |
VariationsDropdown({className,onSelectVariation,selectedValue,variations}) X-Ref |
No description |
VariationsToggleGroupControl({className,onSelectVariation,selectedValue,variations}) X-Ref |
No description |
__experimentalBlockVariationTransforms({blockClientId}) X-Ref |
No description |
ColorPaletteControl({onChange,value,...otherProps}) X-Ref |
Internal dependencies |
DateFormatPicker({format,defaultFormat,onChange}) X-Ref |
The `DateFormatPicker` component renders controls that let the user choose a _date format_. That is, how they want their dates to be formatted. param: {Object} props param: {string|null} props.format The selected date param: {string} props.defaultFormat The date format that param: {( format: string|null ) => void} props.onChange Called when a |
NonDefaultControls({format,onChange}) X-Ref |
No description |
ColorGradientSettingsDropdown({colors,disableCustomColors,disableCustomGradients,enableAlpha,gradients,settings,__experimentalIsRenderedInSidebar,...props}) X-Ref |
No description |
useSaveImage({crop,rotation,url,id,onSaveImage,onFinishEditing}) X-Ref |
No description |
useTransformImage({url,naturalWidth,naturalHeight}) X-Ref |
WordPress dependencies |
editImage(event) X-Ref |
No description |
ImageEditingProvider({id,url,naturalWidth,naturalHeight,onFinishEditing,onSaveImage,children}) X-Ref |
No description |
__extends(d, b) X-Ref |
No description |
__() X-Ref |
No description |
__rest(s, e) X-Ref |
No description |
__decorate(decorators, target, key, desc) X-Ref |
No description |
__param(paramIndex, decorator) X-Ref |
No description |
__metadata(metadataKey, metadataValue) X-Ref |
No description |
__awaiter(thisArg, _arguments, P, generator) X-Ref |
No description |
adopt(value) X-Ref |
No description |
fulfilled(value) X-Ref |
No description |
rejected(value) X-Ref |
No description |
step(result) X-Ref |
No description |
__generator(thisArg, body) X-Ref |
No description |
verb(n) X-Ref |
No description |
step(op) X-Ref |
No description |
__exportStar(m, o) X-Ref |
No description |
__values(o) X-Ref |
No description |
__read(o, n) X-Ref |
No description |
__spread() X-Ref |
No description |
__spreadArrays() X-Ref |
No description |
__await(v) X-Ref |
No description |
__asyncGenerator(thisArg, _arguments, generator) X-Ref |
No description |
verb(n) X-Ref |
No description |
resume(n, v) X-Ref |
No description |
step(r) X-Ref |
No description |
fulfill(value) X-Ref |
No description |
reject(value) X-Ref |
No description |
settle(f, v) X-Ref |
No description |
__asyncDelegator(o) X-Ref |
No description |
verb(n, f) X-Ref |
No description |
__asyncValues(o) X-Ref |
No description |
verb(n) X-Ref |
No description |
settle(resolve, reject, d, v) X-Ref |
No description |
__makeTemplateObject(cooked, raw) X-Ref |
No description |
__importStar(mod) X-Ref |
No description |
__importDefault(mod) X-Ref |
No description |
__classPrivateFieldGet(receiver, privateMap) X-Ref |
No description |
__classPrivateFieldSet(receiver, privateMap, value) X-Ref |
No description |
getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) X-Ref |
Compute the dimension of the crop area based on media size, aspect ratio and optionally rotation |
getMediaZoom(mediaSize) X-Ref |
Compute media zoom. We fit the media into the container with "max-width: 100%; max-height: 100%;" |
restrictPosition(position, mediaSize, cropSize, zoom, rotation) X-Ref |
Ensure a new media position stays in the crop area. |
restrictPositionCoord(position, mediaSize, cropSize, zoom) X-Ref |
No description |
getDistanceBetweenPoints(pointA, pointB) X-Ref |
No description |
getRotationBetweenPoints(pointA, pointB) X-Ref |
No description |
computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) X-Ref |
Compute the output cropped area of the media in percentages and pixels. x/y are the top-left coordinates on the src media |
limitArea(max, value) X-Ref |
Ensure the returned value is between 0 and max |
noOp(_max, value) X-Ref |
No description |
getInitialCropFromCroppedAreaPercentages(croppedAreaPercentages, mediaSize, rotation, cropSize, minZoom, maxZoom) X-Ref |
Compute crop and zoom from the croppedAreaPercentages. |
getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) X-Ref |
Compute zoom from the croppedAreaPixels |
getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, rotation, cropSize, minZoom, maxZoom) X-Ref |
Compute crop and zoom from the croppedAreaPixels |
getCenter(a, b) X-Ref |
Return the point that is the center of point a and b |
getRadianAngle(degreeValue) X-Ref |
No description |
rotateSize(width, height, rotation) X-Ref |
Returns the new bounding area of a rotated rectangle. |
clamp(value, min, max) X-Ref |
Clamp value between min and max |
classNames() X-Ref |
Combine multiple class names into a single string. |
Cropper() X-Ref |
No description |
ImageCropper({url,width,height,clientWidth,naturalHeight,naturalWidth,borderProps}) X-Ref |
Internal dependencies |
ZoomDropdown() X-Ref |
Internal dependencies |
AspectGroup({aspectRatios,isDisabled,label,onClick,value}) X-Ref |
Internal dependencies |
AspectRatioDropdown({toggleProps}) X-Ref |
No description |
RotationButton() X-Ref |
Internal dependencies |
FormControls() X-Ref |
Internal dependencies |
ImageEditor({id,url,width,height,clientWidth,naturalHeight,naturalWidth,onSaveImage,onFinishEditing,borderProps}) X-Ref |
No description |
useDimensionHandler(customHeight, customWidth, defaultHeight, defaultWidth, onChange) X-Ref |
WordPress dependencies |
ImageSizeControl({imageSizeHelp,imageWidth,imageHeight,imageSizeOptions = [],isResizable = true,slug,width,height,onChange,onChangeImage = image_size_control_noop}) X-Ref |
No description |
LinkViewerURL({url,urlLabel,className}) X-Ref |
WordPress dependencies |
LinkViewer({className,linkClassName,onEditLinkClick,url,urlLabel,...props}) X-Ref |
Internal dependencies |
LinkEditor({autocompleteRef,className,onChangeInputValue,value,...props}) X-Ref |
Internal dependencies |
MediaPlaceholder({value = {},allowedTypes,className,icon,labels = {},mediaPreview,notices,isAppender,accept,addToGallery,multiple = false,handleUpload = true,disableDropZone,disableMediaButtons,onError,onSelect,onCancel,onSelectURL,onToggleFeaturedImage,onDoubleClick,onFilesPreUpload = media_placeholder_noop,onHTMLDrop: deprecatedOnHTMLDrop,children,mediaLibraryButton,placeholder,style}) X-Ref |
No description |
recursivelyFindMediaFromBlocks(_blocks) X-Ref |
No description |
InlineSelectionToolbar({editableContentElement,activeFormats}) X-Ref |
No description |
InlineToolbar({popoverAnchor}) X-Ref |
No description |
useUndoAutomaticChange() X-Ref |
Internal dependencies |
onKeyDown(event) X-Ref |
No description |
useMarkPersistent({html,value}) X-Ref |
Internal dependencies |
addActiveFormats(value, activeFormats) X-Ref |
WordPress dependencies |
getMultilineTag(multiline) X-Ref |
Get the multiline tag based on the multiline prop. return: {string | undefined} The multiline tag. param: {?(string|boolean)} multiline The multiline prop. |
getAllowedFormats({allowedFormats,disableFormats}) X-Ref |
No description |
createLinkInParagraph(url, onReplace) X-Ref |
Creates a link from pasted URL. Creates a paragraph block containing a link to the URL, and calls `onReplace`. param: {string} url The URL that could not be embedded. param: {Function} onReplace Function to call with the created fallback block. |
splitValue({value,pastedBlocks = [],onReplace,onSplit}) X-Ref |
No description |
usePasteHandler(props) X-Ref |
No description |
_onPaste(event) X-Ref |
No description |
pasteInline(content) X-Ref |
No description |
useBeforeInputRules(props) X-Ref |
When typing over a selection, the selection will we wrapped by a matching character pair. The second character is optional, it defaults to the first character. |
onInput(event) X-Ref |
No description |
preventEventDiscovery(value) X-Ref |
WordPress dependencies |
findSelection(blocks) X-Ref |
No description |
useInputRules(props) X-Ref |
No description |
inputRule() X-Ref |
No description |
onInput(event) X-Ref |
No description |
useDelete(props) X-Ref |
No description |
onKeyDown(event) X-Ref |
No description |
useEnter(props) X-Ref |
Internal dependencies |
onKeyDown(event) X-Ref |
No description |
formatTypesSelector(select) X-Ref |
No description |
prefixSelectKeys(selected, prefix) X-Ref |
Set of all interactive content tags. |
getPrefixedSelectKeys(selected, prefix) X-Ref |
No description |
useFormatTypes({clientId,identifier,withoutInteractiveFormatting,allowedFormats}) X-Ref |
This hook provides RichText with the `formatTypes` and its derived props from experimental format type settings. param: {Object} $0 Options param: {string} $0.clientId Block client ID. param: {string} $0.identifier Block attribute. param: {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not. param: {Array} $0.allowedFormats Allowed formats |
useRemoveBrowserShortcuts() X-Ref |
Hook to prevent default behaviors for key combinations otherwise handled internally by RichText. return: {import('react').RefObject} The component to be rendered. |
onKeydown(event) X-Ref |
No description |
useShortcuts(keyboardShortcuts) X-Ref |
WordPress dependencies |
onKeyDown(event) X-Ref |
No description |
useInputEvents(inputEvents) X-Ref |
WordPress dependencies |
onInput(event) X-Ref |
No description |
useInsertReplacementText() X-Ref |
When the browser is about to auto correct, add an undo level so the user can revert the change. |
onInput(event) X-Ref |
No description |
useFirefoxCompat() X-Ref |
Internal dependencies |
onFocus() X-Ref |
No description |
format_edit_Edit({onChange,onFocus,value,forwardedRef,settings}) X-Ref |
No description |
FormatEdit({formatTypes,...props}) X-Ref |
No description |
Content({value,tagName: Tag,multiline,format,...props}) X-Ref |
Internal dependencies |
RichTextMultiline({children,identifier,tagName: TagName = 'div',value = '',onChange,multiline,...props}, forwardedRef) X-Ref |
No description |
_onChange(newValues) X-Ref |
No description |
withDeprecations(Component) X-Ref |
Internal dependencies |
removeNativeProps(props) X-Ref |
Removes props used for the native version of RichText so that they are not passed to the DOM element and log warnings. return: {Object} Filtered props. param: {Object} props Props to filter. |
RichTextWrapper({children,tagName = 'div',value: adjustedValue = '',onChange: adjustedOnChange,isSelected: originalIsSelected,multiline,inlineToolbar,wrapperClassName,autocompleters,onReplace,placeholder,allowedFormats,withoutInteractiveFormatting,onRemove,onMerge,onSplit,__unstableOnSplitAtEnd: onSplitAtEnd,__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,identifier,preserveWhiteSpace,__unstablePastePlainText: pastePlainText,__unstableEmbedURLOnPaste,__unstableDisableFormats: disableFormats,disableLineBreaks,__unstableAllowPrefixTransformations,disableEditing,...props}, forwardedRef) X-Ref |
No description |
addEditorOnlyFormats(value) X-Ref |
No description |
removeEditorOnlyFormats(value) X-Ref |
No description |
addInvisibleFormats(value) X-Ref |
No description |
onFocus() X-Ref |
No description |
ResponsiveBlockControlLabel({property,viewport,desc}) X-Ref |
No description |
ResponsiveBlockControl(props) X-Ref |
Internal dependencies |
RichTextShortcut({character,type,onUse}) X-Ref |
Internal dependencies |
callback(event) X-Ref |
No description |
RichTextToolbarButton({name,shortcutType,shortcutCharacter,...props}) X-Ref |
WordPress dependencies |
__unstableRichTextInputEvent({inputType,onInput}) X-Ref |
Internal dependencies |
callback(event) X-Ref |
No description |
ToolSelector(props, ref) X-Ref |
No description |
UnitControl({units: unitsProp,...props}) X-Ref |
Internal dependencies |
Class: URLInputButton - X-Ref
Internal dependenciesPreviewOptions() X-Ref |
WordPress dependencies |
useResizeCanvas(deviceType) X-Ref |
Function to resize the editor window. return: {Object} Inline styles to be added to resizable container. param: {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile) |
MultiSelectionInspector({blocks}) X-Ref |
Internal dependencies |
DefaultStylePicker({blockName}) X-Ref |
Internal dependencies |
InspectorControlsTabsHint() X-Ref |
No description |
InspectorControlsTabs({blockName,clientId,hasBlockStyles,tabs}) X-Ref |
No description |
getShowTabs(blockName, tabSettings = {}) X-Ref |
No description |
useInspectorControlsTabs(blockName) X-Ref |
No description |
useBlockInspectorAnimationSettings(blockType, selectedBlockClientId) X-Ref |
Internal dependencies |
BlockQuickNavigation({clientIds}) X-Ref |
Internal dependencies |
BlockQuickNavigationItem({clientId}) X-Ref |
No description |
BlockInspectorLockedBlocks({topLevelLockedBlock}) X-Ref |
No description |
CopyHandler(props) X-Ref |
param: {Object} props |
InserterLibrary({rootClientId,clientId,isAppender,showInserterHelpPanel,showMostUsedBlocks = false,__experimentalInsertionIndex,__experimentalFilterValue,onSelect = library_noop,shouldFocusBlock = false}, ref) X-Ref |
No description |
MultiSelectScrollIntoView() X-Ref |
Scrolls the multi block selection end into view if not in view already. This is important to do after selection by keyboard. |
useTypewriter() X-Ref |
No description |
onScrollResize() X-Ref |
No description |
onKeyDown(event) X-Ref |
No description |
maintainCaretPosition({keyCode}) X-Ref |
Maintains the scroll position after a selection change caused by a keyboard event. param: {KeyboardEvent} event Keyboard event. |
addSelectionChangeListener() X-Ref |
Adds a `selectionchange` listener to reset the scroll position to be maintained. |
computeCaretRectOnSelectionChange() X-Ref |
Resets the scroll position to be maintained during a `selectionchange` event. Also removes the listener, so it acts as a one-time listener. |
computeCaretRectangle() X-Ref |
Resets the scroll position to be maintained. |
isSelectionEligibleForScroll() X-Ref |
Checks if the current situation is elegible for scroll: - There should be one and only one block selected. - The component must contain the selection. - The active element must be contenteditable. |
isLastEditableNode() X-Ref |
No description |
Typewriter({children}) X-Ref |
No description |
addToBlockType(renderedBlocks, blockName, uniqueId) X-Ref |
Immutably adds an unique identifier to a set scoped for a given block type. return: {Object} The list of rendered blocks grouped by block name. param: {Object} renderedBlocks Rendered blocks grouped by block name param: {string} blockName Name of the block. param: {*} uniqueId Any value that acts as a unique identifier for a block instance. |
RecursionProvider({children,uniqueId,blockName = ''}) X-Ref |
A React context provider for use with the `useHasRecursion` hook to prevent recursive renders. Wrap block content with this provider and provide the same `uniqueId` prop as used with `useHasRecursion`. return: {JSX.Element} A React element. param: {Object} props param: {*} props.uniqueId Any value that acts as a unique identifier for a block instance. param: {string} props.blockName Optional block name. param: {JSX.Element} props.children React children. |
useHasRecursion(uniqueId, blockName = '') X-Ref |
A React hook for keeping track of blocks previously rendered up in the block tree. Blocks susceptible to recursion can use this hook in their `Edit` function to prevent said recursion. Use this with the `RecursionProvider` component, using the same `uniqueId` value for both the hook and the provider. return: {boolean} A boolean describing whether the provided id has already been rendered. param: {*} uniqueId Any value that acts as a unique identifier for a block instance. param: {string} blockName Optional block name. |
InspectorPopoverHeader({title,help,actions = [],onClose}) X-Ref |
No description |
PublishDateTimePicker({onClose,onChange,...additionalProps}, ref) X-Ref |
Internal dependencies |
selectForMultipleBlocks(insertedBlocks) X-Ref |
No description |
onBlockTransform(name) X-Ref |
No description |
useReusableBlocksRenameHint() X-Ref |
No description |
ReusableBlocksRenameHint() X-Ref |
No description |
compileStyleValue(uncompiledValue) X-Ref |
No description |
getPresetsDeclarations(blockPresets = {}, mergedSettings) X-Ref |
Transform given preset tree into a set of style declarations. return: {Array<Object>} An array of style declarations. param: {Object} blockPresets param: {Object} mergedSettings Merged theme.json settings. |
getPresetsClasses(blockSelector = '*', blockPresets = {}) X-Ref |
Transform given preset tree into a set of preset class declarations. return: {string} CSS declarations for the preset classes. param: {?string} blockSelector param: {Object} blockPresets |
getPresetsSvgFilters(blockPresets = {}) X-Ref |
No description |
flattenTree(input = {}, prefix, token) X-Ref |
No description |
concatFeatureVariationSelectorString(featureSelector, styleVariationSelector) X-Ref |
Gets variation selector string from feature selector. return: {string} Combined selector string. param: {string} featureSelector The feature selector. param: {string} styleVariationSelector The style variation selector. |
getStylesDeclarations(blockStyles = {}, selector = '', useRootPaddingAlign, tree = {}, isTemplate = true) X-Ref |
Transform given style tree into a set of style declarations. return: {Array} An array of style declarations. param: {Object} blockStyles Block styles. param: {string} selector The selector these declarations should attach to. param: {boolean} useRootPaddingAlign Whether to use CSS custom properties in root selector. param: {Object} tree A theme.json tree containing layout definitions. param: {boolean} isTemplate Whether the entity being edited is a full template or a pattern. |
getLayoutStyles({layoutDefinitions = LAYOUT_DEFINITIONS,style,selector,hasBlockGapSupport,hasFallbackGapSupport,fallbackGapValue}) X-Ref |
Get generated CSS for layout styles by looking up layout definitions provided in theme.json, and outputting common layout styles, and specific blockGap values. return: {string} Generated CSS rules for the layout styles. param: {Object} props param: {Object} props.layoutDefinitions Layout definitions, keyed by layout type. param: {Object} props.style A style object containing spacing values. param: {string} props.selector Selector used to group together layout styling rules. param: {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support. param: {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles. param: {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available. |
pickStyleKeys(treeToPickFrom) X-Ref |
No description |
toSvgFilters(tree, blockSelectors) X-Ref |
No description |
updateConfigWithSeparator(config) X-Ref |
If there is a separator block whose color is defined in theme.json via background, update the separator color to the same value by using border color. return: {Object} configTheme.json configuration file object updated. param: {Object} config Theme.json configuration file object. |
processCSSNesting(css, blockSelector) X-Ref |
No description |
useGlobalStylesOutputWithConfig(mergedConfig = {}) X-Ref |
Returns the global styles output using a global styles configuration. If wishing to generate global styles and settings based on the global styles config loaded in the editor context, use `useGlobalStylesOutput()`. The use case for a custom config is to generate bespoke styles and settings for previews, or other out-of-editor experiences. return: {Array} Array of stylesheets and settings. param: {Object} mergedConfig Global styles configuration. |
useGlobalStylesOutput() X-Ref |
Returns the global styles output based on the current state of global styles config loaded in the editor context. return: {Array} Array of stylesheets and settings. |
useHasImageSettingsPanel(name, value, inheritedValue) X-Ref |
Internal dependencies |
ImageSettingsPanel({onChange,value,inheritedValue,panelId}) X-Ref |
No description |
AdvancedPanel({value,onChange,inheritedValue = value}) X-Ref |
Internal dependencies |
handleOnChange(newValue) X-Ref |
No description |
handleOnBlur(event) X-Ref |
No description |
memize(fn, options) X-Ref |
Accepts a function to be memoized, and returns a new memoized function, with optional options. return: {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function. param: {F} fn Function to memoize. param: {MemizeOptions} [options] Options object. |
memoized() X-Ref |
No description |
getTranslation(key) X-Ref |
Get the translation for a given global styles key. return: {string|undefined} A translated key or undefined if no translation exists. param: {string} key A key representing a path to a global style property or setting. |
deepCompare(changedObject, originalObject, parentPath = '') X-Ref |
A deep comparison of two objects, optimized for comparing global styles. return: {string[]} An array of paths whose values have changed. param: {Object} changedObject The changed object to compare. param: {Object} originalObject The original object to compare against. param: {string} parentPath A key/value pair object of block names and their rendered titles. |
getGlobalStylesChangelist(next, previous) X-Ref |
Returns an array of translated summarized global styles changes. Results are cached using a Map() key of `JSON.stringify( { next, previous } )`. return: {Array[]} A 2-dimensional array of tuples: [ "group", "translated change" ]. param: {Object} next The changed object to compare. param: {Object} previous The original object to compare against. |
getGlobalStylesChanges(next, previous, options = {}) X-Ref |
From a getGlobalStylesChangelist() result, returns an array of translated global styles changes, grouped by type. The types are 'blocks', 'elements', 'settings', and 'styles'. return: {string[]} An array of translated changes. param: {Object} next The changed object to compare. param: {Object} previous The original object to compare against. param: {{maxResults:number}} options Options. maxResults: results to return before truncating. |
addValuesForElement(element, values, innerBlocks) X-Ref |
No description |
addValuesForElements(children, ...args) X-Ref |
No description |
addValuesForBlocks(values, blocks) X-Ref |
No description |
getRichTextValues(blocks = []) X-Ref |
No description |
ResizableBoxPopover({clientId,resizableBoxProps,...props}) X-Ref |
Internal dependencies |
useCanBlockToolbarBeFocused() X-Ref |
Returns true if the block toolbar should be able to receive focus. return: {boolean} Whether the block toolbar should be able to receive focus |
BlockRemovalWarningModal({rules}) X-Ref |
Internal dependencies |
ScaleTool({panelId,value,onChange,options = DEFAULT_SCALE_OPTIONS,defaultValue = DEFAULT_SCALE_OPTIONS[0].value,isShownByDefault = true}) X-Ref |
A tool to select the CSS object-fit property for the image. return: {import('react').ReactElement} The scale tool. param: {ScaleToolProps} props |
extends_extends() X-Ref |
No description |
memoize(fn) X-Ref |
No description |
sheetForTag(tag) X-Ref |
No description |
createStyleElement(options) X-Ref |
No description |
StyleSheet(options) X-Ref |
No description |
hash(value, length) X-Ref |
return: {number} param: {string} value param: {number} length |
trim(value) X-Ref |
return: {string} param: {string} value |
Utility_match(value, pattern) X-Ref |
return: {string?} param: {string} value param: {RegExp} pattern |
Utility_replace(value, pattern, replacement) X-Ref |
return: {string} param: {string} value param: {(string|RegExp)} pattern param: {string} replacement |
indexof(value, search) X-Ref |
return: {number} param: {string} value param: {string} search |
Utility_charat(value, index) X-Ref |
return: {number} param: {string} value param: {number} index |
Utility_substr(value, begin, end) X-Ref |
return: {string} param: {string} value param: {number} begin param: {number} end |
Utility_strlen(value) X-Ref |
return: {number} param: {string} value |
Utility_sizeof(value) X-Ref |
return: {number} param: {any[]} value |
Utility_append(value, array) X-Ref |
return: {any} param: {any} value param: {any[]} array |
Utility_combine(array, callback) X-Ref |
return: {string} param: {string[]} array param: {function} callback |
node(value, root, parent, type, props, children, length) X-Ref |
param: {string} value param: {object | null} root param: {object | null} parent param: {string} type param: {string[] | string} props param: {object[] | string} children param: {number} length |
Tokenizer_copy(root, props) X-Ref |
return: {object} param: {object} root param: {object} props |
Tokenizer_char() X-Ref |
return: {number} |
prev() X-Ref |
return: {number} |
next() X-Ref |
return: {number} |
peek() X-Ref |
return: {number} |
caret() X-Ref |
return: {number} |
slice(begin, end) X-Ref |
return: {string} param: {number} begin param: {number} end |
token(type) X-Ref |
return: {number} param: {number} type |
alloc(value) X-Ref |
return: {any[]} param: {string} value |
dealloc(value) X-Ref |
return: {any} param: {any} value |
delimit(type) X-Ref |
return: {string} param: {number} type |
Tokenizer_tokenize(value) X-Ref |
return: {string[]} param: {string} value |
whitespace(type) X-Ref |
return: {string} param: {number} type |
tokenizer(children) X-Ref |
return: {string[]} param: {string[]} children |
escaping(index, count) X-Ref |
return: {string} param: {number} index param: {number} count |
delimiter(type) X-Ref |
return: {number} param: {number} type |
commenter(type, index) X-Ref |
return: {number} param: {number} type param: {number} index |
identifier(index) X-Ref |
No description |
Serializer_serialize(children, callback) X-Ref |
return: {string} param: {object[]} children param: {function} callback |
Serializer_stringify(element, index, children, callback) X-Ref |
return: {string} param: {object} element param: {number} index param: {object[]} children param: {function} callback |
middleware(collection) X-Ref |
return: {function} param: {function[]} collection |
rulesheet(callback) X-Ref |
return: {function} param: {function} callback |
prefixer(element, index, children, callback) X-Ref |
param: {object} element param: {number} index param: {object[]} children param: {function} callback |
namespace(element) X-Ref |
param: {object} element param: {number} index param: {object[]} children |
compile(value) X-Ref |
return: {object[]} param: {string} value |
Parser_parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) X-Ref |
return: {object} param: {string} value param: {object} root param: {object?} parent param: {string[]} rule param: {string[]} rules param: {string[]} rulesets param: {number[]} pseudo param: {number[]} points param: {string[]} declarations |
ruleset(value, root, parent, index, offset, rules, points, type, props, children, length) X-Ref |
return: {object} param: {string} value param: {object} root param: {object?} parent param: {number} index param: {number} offset param: {string[]} rules param: {number[]} points param: {string} type param: {string[]} props param: {string[]} children param: {number} length |
Parser_comment(value, root, parent) X-Ref |
return: {object} param: {number} value param: {object} root param: {object?} parent |
declaration(value, root, parent, length) X-Ref |
return: {object} param: {string} value param: {object} root param: {object?} parent param: {number} length |
emotion_cache_browser_esm_prefix(value, length) X-Ref |
No description |
murmur2(str) X-Ref |
No description |
emotion_memoize_esm_memoize(fn) X-Ref |
No description |
handleInterpolation(mergedProps, registered, interpolation) X-Ref |
No description |
createStringFromObject(mergedProps, registered, obj) X-Ref |
No description |
withTheme(Component) X-Ref |
No description |
emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) X-Ref |
No description |
_EMOTION_STRINGIFIED_CSS_ERROR__() X-Ref |
No description |
WidthHeightTool({panelId,value = {},onChange = () X-Ref |
Component that renders controls to edit the dimensions of an image or container. return: {import('react').ReactElement} The width and height tool. param: {WidthHeightToolProps} props The component props. |
DimensionsTool({panelId,value = {},onChange = () X-Ref |
Component that renders controls to edit the dimensions of an image or container. return: {Element} The dimensions controls. param: {DimensionsControlsProps} props The component props. |
ResolutionTool({panelId,value,onChange,options = DEFAULT_SIZE_OPTIONS,defaultValue = DEFAULT_SIZE_OPTIONS[0].value,isShownByDefault = true}) X-Ref |
No description |
assign(ta) X-Ref |
No description |
init() X-Ref |
No description |
changeOverflow(value) X-Ref |
No description |
getParentOverflows(el) X-Ref |
No description |
resize() X-Ref |
No description |
update() X-Ref |
No description |
destroy(ta) X-Ref |
No description |
update(ta) X-Ref |
No description |
classNames() X-Ref |
No description |
Diff() X-Ref |
No description |
done(value) X-Ref |
No description |
execEditLength() X-Ref |
No description |
buildValues(diff, components, newString, oldString, useLongestToken) X-Ref |
No description |
clonePath(path) X-Ref |
No description |
_interopRequireDefault(obj) X-Ref |
No description |
diffChars(oldStr, newStr, options) X-Ref |
No description |
scrollIntoView(elem, container, config) X-Ref |
No description |
getClientPosition(elem) X-Ref |
No description |
getScroll(w, top) X-Ref |
No description |
getScrollLeft(w) X-Ref |
No description |
getScrollTop(w) X-Ref |
No description |
getOffset(el) X-Ref |
No description |
_getComputedStyle(elem, name, computedStyle_) X-Ref |
No description |
_getComputedStyleIE(elem, name) X-Ref |
No description |
each(arr, fn) X-Ref |
No description |
isBorderBoxFn(elem) X-Ref |
No description |
swap(elem, options, callback) X-Ref |
No description |
getPBMWidth(elem, props, which) X-Ref |
No description |
isWindow(obj) X-Ref |
A crude way of determining if an object is a window |
getWH(elem, name, extra) X-Ref |
No description |
getWHIgnoreDisplay(elem) X-Ref |
No description |
css(el, name, v) X-Ref |
No description |
setOffset(elem, offset) X-Ref |
No description |
lineHeight(node) X-Ref |
Calculate the `line-height` of a given node param: {HTMLElement} node Element to calculate line height of. Must be in the DOM. returns: {Number} `line-height` of the element in pixels |
_populate() X-Ref |
No description |
isEventSupported(eventNameSuffix, capture) X-Ref |
Checks if an event is supported in the current execution environment. NOTE: This will not work correctly for non-generic events such as `change`, `reset`, `load`, `error`, and `select`. Borrows from Modernizr. return: {boolean} True if the event is supported. param: {string} eventNameSuffix Event name, e.g. "click". param: {?boolean} capture Check if the capture phase is supported. |
normalizeWheel( event) X-Ref |
Mouse wheel (and 2-finger trackpad) support on the web sucks. It is complicated, thus this doc is long and (hopefully) detailed enough to answer your questions. If you need to react to the mouse wheel in a predictable way, this code is like your bestest friend. * hugs * As of today, there are 4 DOM event types you can listen to: 'wheel' -- Chrome(31+), FF(17+), IE(9+) 'mousewheel' -- Chrome, IE(6+), Opera, Safari 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! 'DOMMouseScroll' -- FF(0.9.7+) since 2003 So what to do? The is the best: normalizeWheel.getEventType(); In your event callback, use this code to get sane interpretation of the deltas. This code will return an object with properties: spinX -- normalized spin speed (use for zoom) - x plane spinY -- " - y plane pixelX -- normalized distance (to pixels) - x plane pixelY -- " - y plane Wheel values are provided by the browser assuming you are using the wheel to scroll a web page by a number of lines or pixels (or pages). Values can vary significantly on different platforms and browsers, forgetting that you can scroll at different speeds. Some devices (like trackpads) emit more events at smaller increments with fine granularity, and some emit massive jumps with linear speed or acceleration. This code does its best to normalize the deltas for you: - spin is trying to normalize how far the wheel was spun (or trackpad dragged). This is super useful for zoom support where you want to throw away the chunky scroll steps on the PC and make those equal to the slow and smooth tiny steps on the Mac. Key data: This code tries to resolve a single slow step on a wheel to 1. - pixel is normalizing the desired scroll delta in pixel units. You'll get the crazy differences between browsers, but at least it'll be in pixels! - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This should translate to positive value zooming IN, negative zooming OUT. This matches the newer 'wheel' event. Why are there spinX, spinY (or pixels)? - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn with a mouse. It results in side-scrolling in the browser by default. - spinY is what you expect -- it's the classic axis of a mouse wheel. - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and probably is by browsers in conjunction with fancy 3D controllers .. but you know. Implementation info: Examples of 'wheel' event if you scroll slowly (down) by one step with an average mouse: OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) On the trackpad: OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) On other/older browsers.. it's more complicated as there can be multiple and also missing delta values. The 'wheel' event is more standard: http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents The basics is that it includes a unit, deltaMode (pixels, lines, pages), and deltaX, deltaY and deltaZ. Some browsers provide other values to maintain backward compatibility with older events. Those other values help us better normalize spin speed. Example of what the browsers provide: | event.wheelDelta | event.detail ------------------+------------------+-------------- Safari v5/OS X | -120 | 0 Safari v5/Win7 | -120 | 0 Chrome v17/OS X | -120 | 0 Chrome v17/Win7 | -120 | 0 IE9/Win7 | -120 | undefined Firefox v4/OS X | undefined | 1 Firefox v4/Win7 | undefined | 3 |
Generated : Thu May 9 08:20:02 2024 | Cross-referenced by PHPXref |