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
41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
'use client';
|
|
|
|
import { c as _c } from "react/compiler-runtime";
|
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
import React, { createContext, use, useState } from 'react';
|
|
const Context = /*#__PURE__*/createContext({
|
|
mostRecentUpdate: null,
|
|
reportUpdate: () => null
|
|
});
|
|
export const DocumentEventsProvider = t0 => {
|
|
const $ = _c(3);
|
|
const {
|
|
children
|
|
} = t0;
|
|
const [mostRecentUpdate, reportUpdate] = useState(null);
|
|
let t1;
|
|
if ($[0] !== children || $[1] !== mostRecentUpdate) {
|
|
t1 = _jsx(Context, {
|
|
value: {
|
|
mostRecentUpdate,
|
|
reportUpdate
|
|
},
|
|
children
|
|
});
|
|
$[0] = children;
|
|
$[1] = mostRecentUpdate;
|
|
$[2] = t1;
|
|
} else {
|
|
t1 = $[2];
|
|
}
|
|
return t1;
|
|
};
|
|
/**
|
|
* The useDocumentEvents hook provides a way of subscribing to cross-document events,
|
|
* such as updates made to nested documents within a drawer.
|
|
* This hook will report document events that are outside the scope of the document currently being edited.
|
|
*
|
|
* @link https://payloadcms.com/docs/admin/react-hooks#usedocumentevents
|
|
*/
|
|
export const useDocumentEvents = () => use(Context);
|
|
//# sourceMappingURL=index.js.map |