@bison-lab/payload-core 5.10.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +85 -2
- package/dist/admin.mjs.map +1 -1
- package/package.json +4 -4
package/dist/admin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.mts","names":[],"sources":["../src/admin/color-field.tsx","../src/admin/color-scale-field.tsx","../src/admin/library-field.tsx","../src/admin/font-field.tsx","../src/admin/pairing-field.tsx","../src/admin/appearance-field.tsx","../src/admin/grey-scale-field.tsx","../src/admin/contrast-report.tsx","../src/admin/section-heading.tsx","../src/admin/publish-child.tsx","../src/admin/save-button.tsx","../src/admin/preview-mode.tsx","../src/admin/identity-fallback.tsx","../src/admin/look-field.tsx","../src/admin/roles-cell.tsx","../src/admin/roles-matrix-field.tsx","../src/admin/roles-row-label.tsx","../src/admin/role-slug-field.tsx","../src/admin/slug-field.tsx","../src/admin/page-title-cell.tsx","../src/admin/page-slug-cell.tsx","../src/admin/required-page-cell.tsx","../src/admin/role-name-field.tsx","../src/admin/roles-field.tsx","../src/admin/roles-grants-field.tsx","../src/admin/features-matrix-field.tsx","../src/features/types.ts","../src/admin/block-library-field.tsx","../src/admin/document-title-actions.tsx","../src/admin/refused-submit.tsx","../src/admin/list-align-styles.tsx","../src/admin/block-drawer-styles.tsx","../src/admin/rich-text-editor-font-styles.tsx","../src/admin/document-create-new.tsx","../src/admin-nav/types.ts","../src/admin/admin-nav.tsx","../src/admin/admin-nav-row-label.tsx","../src/admin/admin-nav-item-row-label.tsx","../src/admin/admin-nav-entity-field.tsx","../src/taxonomy/facet-field.ts","../src/questions/types.ts","../src/admin/questions-list.tsx","../src/admin/media-alt-autofill.tsx","../src/admin/media-list-view.tsx","../src/admin/translate-now.tsx","../src/admin/translation-key-panel.tsx","../src/admin/translation-activity-panel.tsx","../src/admin/translation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yBAAA,GAAyB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;cCA1D,aAAA,EAAe,wBAAA;;;;;;;;cCqBf,UAAA,EAAY,0BAAA;;;;;;;;;cCkBZ,gBAAA,EAAkB,wBAAA;;;;;;;;;AxBrC/B;;;cyBqDa,mBAAA,EAAqB,yBAAA;;;;cCQrB,iBAAA;;;;;;;;;A1B7Db;;;;;;;c2B8Ua,iBAAA,EAAmB,yBAAA;;;
|
|
1
|
+
{"version":3,"file":"admin.d.mts","names":[],"sources":["../src/admin/color-field.tsx","../src/admin/color-scale-field.tsx","../src/admin/library-field.tsx","../src/admin/font-field.tsx","../src/admin/pairing-field.tsx","../src/admin/appearance-field.tsx","../src/admin/grey-scale-field.tsx","../src/admin/contrast-report.tsx","../src/admin/section-heading.tsx","../src/admin/publish-child.tsx","../src/admin/save-button.tsx","../src/admin/preview-mode.tsx","../src/admin/identity-fallback.tsx","../src/admin/look-field.tsx","../src/admin/roles-cell.tsx","../src/admin/roles-matrix-field.tsx","../src/admin/roles-row-label.tsx","../src/admin/role-slug-field.tsx","../src/admin/slug-field.tsx","../src/admin/page-title-cell.tsx","../src/admin/page-slug-cell.tsx","../src/admin/required-page-cell.tsx","../src/admin/role-name-field.tsx","../src/admin/roles-field.tsx","../src/admin/roles-grants-field.tsx","../src/admin/features-matrix-field.tsx","../src/features/types.ts","../src/admin/block-library-field.tsx","../src/admin/document-title-actions.tsx","../src/admin/refused-submit.tsx","../src/admin/list-align-styles.tsx","../src/admin/block-drawer-styles.tsx","../src/admin/rich-text-editor-font-styles.tsx","../src/admin/document-create-new.tsx","../src/admin-nav/types.ts","../src/admin/admin-nav.tsx","../src/admin/admin-nav-row-label.tsx","../src/admin/admin-nav-item-row-label.tsx","../src/admin/admin-nav-entity-field.tsx","../src/taxonomy/facet-field.ts","../src/questions/types.ts","../src/admin/questions-list.tsx","../src/admin/media-alt-autofill.tsx","../src/admin/media-list-view.tsx","../src/admin/translate-now.tsx","../src/admin/translation-key-pan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ationObserver re-applies
|
|
4838
4838
|
* after Payload redraws the controls.
|
|
4839
4839
|
*
|
|
4840
|
+
* The lifted nodes still belong to Payload's React tree, which keeps
|
|
4841
|
+
* updating them in place. React also expects them under the parent it
|
|
4842
|
+
* rendered them into: inserting a sibling before one, or removing one,
|
|
4843
|
+
* would throw `NotFoundError` and unmount the controls, leaving a frozen
|
|
4844
|
+
* copy on the title row (#354). So each lift leaves a comment where the
|
|
4845
|
+
* node was and guards that one parent (see `guardParent`), never
|
|
4846
|
+
* `Node.prototype`. A comment does not stop `.doc-controls__meta:empty`
|
|
4847
|
+
* matching, so the empty band still collapses.
|
|
4848
|
+
*
|
|
4840
4849
|
* It also carries `RefusedSubmitProvider`, so a refused publish keeps its
|
|
4841
4850
|
* field errors and stays publishable (#357).
|
|
4842
4851
|
*/
|
|
@@ -4856,6 +4865,77 @@ const TITLE_ACTIONS_CSS = `
|
|
|
4856
4865
|
const TITLE_ROW_CLASS = "bl-doc-title-row";
|
|
4857
4866
|
const STATUS = ".doc-controls__status";
|
|
4858
4867
|
const ACTIONS = ".doc-controls__controls-wrapper";
|
|
4868
|
+
/** The comment a lift leaves at a lifted node's place in React's parent. */
|
|
4869
|
+
const placeholders = /* @__PURE__ */ new WeakMap();
|
|
4870
|
+
const guardedParents = /* @__PURE__ */ new WeakSet();
|
|
4871
|
+
/** The placeholder of `node` when it was lifted out of `parent`. */
|
|
4872
|
+
function placeholderIn(parent, node) {
|
|
4873
|
+
const mark = node ? placeholders.get(node) : void 0;
|
|
4874
|
+
return mark && mark.parentNode === parent && node?.parentNode !== parent ? mark : null;
|
|
4875
|
+
}
|
|
4876
|
+
/**
|
|
4877
|
+
* Teaches one parent the lift moved a node out of to answer React as if
|
|
4878
|
+
* the node were still there: an insert before it lands at its
|
|
4879
|
+
* placeholder, moving it moves the placeholder (the node stays on the
|
|
4880
|
+
* title row), and removing it removes both, wherever the node now sits.
|
|
4881
|
+
* Every other call goes through untouched. `moveBefore` is not guarded:
|
|
4882
|
+
* react-dom 19.2 never calls it.
|
|
4883
|
+
*/
|
|
4884
|
+
function guardParent(parent) {
|
|
4885
|
+
if (guardedParents.has(parent)) return;
|
|
4886
|
+
guardedParents.add(parent);
|
|
4887
|
+
const insertBefore = parent.insertBefore;
|
|
4888
|
+
const appendChild = parent.appendChild;
|
|
4889
|
+
const removeChild = parent.removeChild;
|
|
4890
|
+
parent.insertBefore = function(node, child) {
|
|
4891
|
+
const ref = placeholderIn(parent, child) ?? child;
|
|
4892
|
+
const mark = placeholderIn(parent, node);
|
|
4893
|
+
if (mark) {
|
|
4894
|
+
if (mark !== ref) insertBefore.call(parent, mark, ref);
|
|
4895
|
+
return node;
|
|
4896
|
+
}
|
|
4897
|
+
return insertBefore.call(parent, node, ref);
|
|
4898
|
+
};
|
|
4899
|
+
parent.appendChild = function(node) {
|
|
4900
|
+
const mark = placeholderIn(parent, node);
|
|
4901
|
+
if (mark) {
|
|
4902
|
+
appendChild.call(parent, mark);
|
|
4903
|
+
return node;
|
|
4904
|
+
}
|
|
4905
|
+
return appendChild.call(parent, node);
|
|
4906
|
+
};
|
|
4907
|
+
parent.removeChild = function(child) {
|
|
4908
|
+
const mark = placeholderIn(parent, child);
|
|
4909
|
+
if (mark) {
|
|
4910
|
+
removeChild.call(parent, mark);
|
|
4911
|
+
placeholders.delete(child);
|
|
4912
|
+
child.parentNode?.removeChild(child);
|
|
4913
|
+
return child;
|
|
4914
|
+
}
|
|
4915
|
+
return removeChild.call(parent, child);
|
|
4916
|
+
};
|
|
4917
|
+
}
|
|
4918
|
+
/** Moves `node` into `group`, leaving a guarded placeholder where it was. */
|
|
4919
|
+
function lift(group, node, before) {
|
|
4920
|
+
const parent = node.parentNode;
|
|
4921
|
+
if (parent) {
|
|
4922
|
+
guardParent(parent);
|
|
4923
|
+
placeholders.get(node)?.remove();
|
|
4924
|
+
const mark = node.ownerDocument.createComment(TITLE_ROW_CLASS);
|
|
4925
|
+
parent.insertBefore(mark, node);
|
|
4926
|
+
placeholders.set(node, mark);
|
|
4927
|
+
}
|
|
4928
|
+
group.insertBefore(node, before);
|
|
4929
|
+
}
|
|
4930
|
+
/**
|
|
4931
|
+
* A lifted node whose placeholder left the group's tree belongs to a
|
|
4932
|
+
* controls band React unmounted: React removed the band, not the node,
|
|
4933
|
+
* so the copy on the title row is frozen.
|
|
4934
|
+
*/
|
|
4935
|
+
function isOrphaned(group, node) {
|
|
4936
|
+
const mark = placeholders.get(node);
|
|
4937
|
+
return !!mark && mark.getRootNode() !== group.getRootNode();
|
|
4938
|
+
}
|
|
4859
4939
|
/**
|
|
4860
4940
|
* Moves a node Payload just rendered into the group. A lifted node of
|
|
4861
4941
|
* the same kind is dropped first: when Payload remounts its controls
|
|
@@ -4865,7 +4945,7 @@ const ACTIONS = ".doc-controls__controls-wrapper";
|
|
|
4865
4945
|
function place(group, node, selector, before) {
|
|
4866
4946
|
if (!node) return;
|
|
4867
4947
|
for (const stale of Array.from(group.querySelectorAll(`:scope > ${selector}`))) stale.remove();
|
|
4868
|
-
group
|
|
4948
|
+
lift(group, node, before);
|
|
4869
4949
|
}
|
|
4870
4950
|
/**
|
|
4871
4951
|
* The element that bounds one document view. Payload's `Drawer` renders
|
|
@@ -4896,10 +4976,13 @@ function ownControl(root, view, selector) {
|
|
|
4896
4976
|
function liftTitleActions(root = document) {
|
|
4897
4977
|
for (const header of Array.from(root.querySelectorAll(".doc-header__header"))) {
|
|
4898
4978
|
const view = viewOf(header);
|
|
4979
|
+
let group = header.querySelector(`:scope > .${TITLE_ROW_CLASS}`);
|
|
4980
|
+
if (group) {
|
|
4981
|
+
for (const lifted of Array.from(group.children)) if (isOrphaned(group, lifted)) lifted.remove();
|
|
4982
|
+
}
|
|
4899
4983
|
const status = ownControl(root, view, STATUS);
|
|
4900
4984
|
const actions = ownControl(root, view, ACTIONS);
|
|
4901
4985
|
if (!status && !actions) continue;
|
|
4902
|
-
let group = header.querySelector(`:scope > .${TITLE_ROW_CLASS}`);
|
|
4903
4986
|
if (!group) {
|
|
4904
4987
|
group = header.ownerDocument.createElement("div");
|
|
4905
4988
|
group.className = TITLE_ROW_CLASS;
|