UNPKG

@wordpress/components

Version:
8 lines (7 loc) 1.46 kB
{ "version": 3, "sources": ["../../src/slot-fill/context.ts"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { observableMap } from '@wordpress/compose';\nimport { createContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\n\nconst initialValue = {\n slots: observableMap(),\n fills: observableMap(),\n registerSlot: () => {\n globalThis.SCRIPT_DEBUG === true ? warning('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0;\n },\n unregisterSlot: () => {},\n updateSlot: () => {},\n registerFill: () => {},\n unregisterFill: () => {},\n updateFill: () => {},\n // This helps the provider know if it's using the default context value or not.\n isDefault: true\n};\nconst SlotFillContext = createContext(initialValue);\nSlotFillContext.displayName = 'SlotFillContext';\nexport default SlotFillContext;"], "mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,OAAO,aAAa;AAMpB,IAAM,eAAe;AAAA,EACnB,OAAO,cAAc;AAAA,EACrB,OAAO,cAAc;AAAA,EACrB,cAAc,MAAM;AAClB,eAAW,iBAAiB,OAAO,QAAQ,8HAAmI,IAAI;AAAA,EACpL;AAAA,EACA,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,YAAY,MAAM;AAAA,EAAC;AAAA,EACnB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,YAAY,MAAM;AAAA,EAAC;AAAA;AAAA,EAEnB,WAAW;AACb;AACA,IAAM,kBAAkB,cAAc,YAAY;AAClD,gBAAgB,cAAc;AAC9B,IAAO,kBAAQ;", "names": [] }