UNPKG

@wordpress/components

Version:
29 lines (28 loc) 990 B
// packages/components/src/slot-fill/bubbles-virtually/slot-fill-context.ts import { createContext } from "@wordpress/element"; import warning from "@wordpress/warning"; import { observableMap } from "@wordpress/compose"; var 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 }; var SlotFillContext = createContext(initialContextValue); SlotFillContext.displayName = "SlotFillContext"; var slot_fill_context_default = SlotFillContext; export { slot_fill_context_default as default }; //# sourceMappingURL=slot-fill-context.js.map