@wordpress/components
Version:
UI components for WordPress.
27 lines (25 loc) • 862 B
JavaScript
/**
* WordPress dependencies
*/
import { createContext } from '@wordpress/element';
import warning from '@wordpress/warning';
import { observableMap } from '@wordpress/compose';
/**
* Internal dependencies
*/
const initialContextValue = {
slots: observableMap(),
fills: observableMap(),
registerSlot: () => {
globalThis.SCRIPT_DEBUG === true ? warning('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0;
},
updateSlot: () => {},
unregisterSlot: () => {},
registerFill: () => {},
unregisterFill: () => {},
// This helps the provider know if it's using the default context value or not.
isDefault: true
};
const SlotFillContext = createContext(initialContextValue);
export default SlotFillContext;
//# sourceMappingURL=slot-fill-context.js.map