[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> preferences.js (summary)

WordPress dependencies

File Size: 739 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions

  defaults()
  withPersistenceLayer()
  toggle()
  set()
  setDefaults()
  PreferenceToggleMenuItem()
  BaseOption()
  PreferenceToggleControl()
  PreferencesModal()
  Icon()
  PreferencesModalTabs()

Functions
Functions that are not part of a class:

defaults(state = {}, action)   X-Ref
Reducer returning the defaults for user preferences.

This is kept intentionally separate from the preferences
themselves so that defaults are not persisted.

return: {Object} Updated state.
param: {Object} state  Current state.
param: {Object} action Dispatched action.

withPersistenceLayer(reducer)   X-Ref
Higher order reducer that does the following:
- Merges any data from the persistence layer into the state when the
`SET_PERSISTENCE_LAYER` action is received.
- Passes any preferences changes to the persistence layer.

return: {Function} The enhanced reducer.
param: {Function} reducer The preferences reducer.

toggle(scope, name)   X-Ref
Returns an action object used in signalling that a preference should be
toggled.

param: {string} scope The preference scope (e.g. core/edit-post).
param: {string} name  The preference name.

set(scope, name, value)   X-Ref
Returns an action object used in signalling that a preference should be set
to a value

return: {Object} Action object.
param: {string} scope The preference scope (e.g. core/edit-post).
param: {string} name  The preference name.
param: {*}      value The value to set.

setDefaults(scope, defaults)   X-Ref
Returns an action object used in signalling that preference defaults should
be set.

return: {Object} Action object.
param: {string}            scope    The preference scope (e.g. core/edit-post).
param: {Object<string, *>} defaults A key/value map of preference names to values.

PreferenceToggleMenuItem({scope,name,label,info,messageActivated,messageDeactivated,shortcut,handleToggling = true,onToggle = ()   X-Ref
Internal dependencies


BaseOption({help,label,isChecked,onChange,children})   X-Ref
WordPress dependencies


PreferenceToggleControl(props)   X-Ref
Internal dependencies


PreferencesModal({closeModal,children})   X-Ref
WordPress dependencies


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.

PreferencesModalTabs({sections})   X-Ref
No description



Generated : Thu Apr 18 08:20:02 2024 Cross-referenced by PHPXref