Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
1.8 KiB
Plaintext
1 line
1.8 KiB
Plaintext
{"version":3,"file":"index.js","names":["c","_c","React","createContext","use","useState","Context","mostRecentUpdate","reportUpdate","DocumentEventsProvider","t0","$","children","t1","_jsx","value","useDocumentEvents"],"sources":["../../../src/providers/DocumentEvents/index.tsx"],"sourcesContent":["'use client'\nimport type { DocumentEvent } from 'payload'\n\nimport React, { createContext, use, useState } from 'react'\n\nconst Context = createContext<{\n mostRecentUpdate: DocumentEvent | null\n reportUpdate: (event: DocumentEvent) => void\n}>({\n mostRecentUpdate: null,\n reportUpdate: () => null,\n})\n\nexport const DocumentEventsProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const [mostRecentUpdate, reportUpdate] = useState<DocumentEvent>(null)\n\n return <Context value={{ mostRecentUpdate, reportUpdate }}>{children}</Context>\n}\n\n/**\n * The useDocumentEvents hook provides a way of subscribing to cross-document events,\n * such as updates made to nested documents within a drawer.\n * This hook will report document events that are outside the scope of the document currently being edited.\n *\n * @link https://payloadcms.com/docs/admin/react-hooks#usedocumentevents\n */\nexport const useDocumentEvents = () => use(Context)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,QAAQ,QAAQ;AAEpD,MAAMC,OAAA,gBAAUH,aAAA,CAGb;EACDI,gBAAA,EAAkB;EAClBC,YAAA,EAAcA,CAAA,KAAM;AACtB;AAEA,OAAO,MAAMC,sBAAA,GAAkEC,EAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EAAC;IAAAW;EAAA,IAAAF,EAAY;EAC1F,OAAAH,gBAAA,EAAAC,YAAA,IAAyCH,QAAA,KAAwB;EAAA,IAAAQ,EAAA;EAAA,IAAAF,CAAA,QAAAC,QAAA,IAAAD,CAAA,QAAAJ,gBAAA;IAE1DM,EAAA,GAAAC,IAAA,CAAAR,OAAA;MAAAS,KAAA;QAAAR,gBAAA;QAAAC;MAAA;MAAAI;IAAA,C;;;;;;;SAAAC,E;CACT;AAEA;;;;;;;AAOA,OAAO,MAAMG,iBAAA,GAAoBA,CAAA,KAAMZ,GAAA,CAAIE,OAAA","ignoreList":[]} |