@bison-lab/payload-core 3.17.0 → 3.18.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/README.md CHANGED
@@ -265,9 +265,11 @@ implicit — every catalogue feature, including ones not released. That
265
265
  row is visible only to a Developer, with every tick on and locked.
266
266
  Defaults ship in the package (Theme
267
267
  screens on Designer; Designer also has Users and Roles; Admin + Designer
268
- both store). A site may pass `extras` into `createRoles` each extra
269
- is a slug, a display label, and default `grants` and an Admin can add
270
- further custom rows and edit any row’s name. Seed slugs stay read-only.
268
+ both store). An Admin may remove Admin, Designer, or Author after first
269
+ run; only Developer stays. A site may pass `extras` into `createRoles`
270
+ each extra is a slug, a display label, and default `grants` — and an
271
+ Admin can add further custom rows and edit any row’s name. Remaining
272
+ seed slugs stay read-only.
271
273
  `canManageBrand` and the other predicates read the saved Global and fall
272
274
  back to that seed (plus extras). The package never writes `developer`
273
275
  onto a user row.
package/dist/admin.d.mts CHANGED
@@ -104,9 +104,9 @@ declare const LookField: TextFieldClientComponent;
104
104
  //#endregion
105
105
  //#region src/admin/roles-matrix-field.d.ts
106
106
  /**
107
- * Payload's array field: drag rank stays, add is for custom rows, seed
108
- * rows have no remove. Developer stays in the saved array and is shown
109
- * only to a Developer. Reset restores seed ticks and package labels.
107
+ * Payload's array field: drag rank stays, add is for custom rows.
108
+ * Developer has no remove, stays in the saved array, and is shown only
109
+ * to a Developer. Reset restores the package four and leaves extras.
110
110
  */
111
111
  declare const RolesMatrixField: ArrayFieldClientComponent;
112
112
  //#endregion
@@ -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/identity-fallback.tsx","../src/admin/look-field.tsx","../src/admin/roles-matrix-field.tsx","../src/admin/roles-row-label.tsx","../src/admin/role-slug-field.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/admin/document-title-actions.tsx","../src/admin/document-create-new.tsx"],"mappings":";;;;;;;;;;;cAWa,UAAA,EAAY,wBAAA;;;;;;;cCsBZ,eAAA,EAAiB,yBAAA;;;;;;;;;cCNjB,YAAA,EAAc,yBAAA;;;;;;;;;cCTd,SAAA,EAAW,0BAAA;;;;;;;cCNX,YAAA,EAAc,sBAAA;;;;;;;cCCd,eAAA,EAAiB,yBAAA;;;ALF9B;;;;AAAA,cMyDa,cAAA,EAAgB,0BAAA;;;;;;;cChDhB,cAAA,EAAgB,sBAAA;;;;;;cCbhB,cAAA,EAAgB,sBAAA;;;cCgJhB,YAAA,EAAc,sBAAA;;;;;;;;iBC3IX,qBAAA,CAAA,GAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;;AVDrC;;;iBUgBgB,eAAA,CAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;iBA0Bf,gBAAA,CAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;cC7CnB,gBAAA,EAAkB,sBAAA;;;;;;;cCIlB,SAAA,EAAW,wBAAA;;;;;;;;cCsBX,gBAAA,EAAkB,yBAAA;;;;;;iBC3Bf,aAAA,CAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;cCChB,aAAA,EAAe,wBAAA;;;;;;;cCCf,aAAA,EAAe,wBAAA;;;;;;;;cC8Cf,UAAA,EAAY,0BAAA;;;;;;;;cChCZ,gBAAA,EAAkB,wBAAA;;;;;;;;;AlBZ/B;;cmB0Ca,mBAAA,EAAqB,yBAAA;;;iBCjBlB,oBAAA,CAAA;EAAuB;AAAA;EAAc,QAAA,GAAW,SAAA;AAAA,IAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCtB3D,iBAAA,CAAA;EAAoB;AAAA;EAAU,IAAA;AAAA,IAAc,kBAAA,CAAA,GAAA,CAAA,OAAA"}
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/identity-fallback.tsx","../src/admin/look-field.tsx","../src/admin/roles-matrix-field.tsx","../src/admin/roles-row-label.tsx","../src/admin/role-slug-field.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/admin/document-title-actions.tsx","../src/admin/document-create-new.tsx"],"mappings":";;;;;;;;;;;cAWa,UAAA,EAAY,wBAAA;;;;;;;cCsBZ,eAAA,EAAiB,yBAAA;;;;;;;;;cCNjB,YAAA,EAAc,yBAAA;;;;;;;;;cCTd,SAAA,EAAW,0BAAA;;;;;;;cCNX,YAAA,EAAc,sBAAA;;;;;;;cCCd,eAAA,EAAiB,yBAAA;;;ALF9B;;;;AAAA,cMyDa,cAAA,EAAgB,0BAAA;;;;;;;cChDhB,cAAA,EAAgB,sBAAA;;;;;;cCbhB,cAAA,EAAgB,sBAAA;;;cCgJhB,YAAA,EAAc,sBAAA;;;;;;;;iBC3IX,qBAAA,CAAA,GAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;;AVDrC;;;iBUgBgB,eAAA,CAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;iBA0Bf,gBAAA,CAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;cC7CnB,gBAAA,EAAkB,sBAAA;;;;;;;cCIlB,SAAA,EAAW,wBAAA;;;;;;;;cCqBX,gBAAA,EAAkB,yBAAA;;;;;;iBC1Bf,aAAA,CAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;cCChB,aAAA,EAAe,wBAAA;;;;;;;cCCf,aAAA,EAAe,wBAAA;;;;;;;;cC8Cf,UAAA,EAAY,0BAAA;;;;;;;;cChCZ,gBAAA,EAAkB,wBAAA;;;;;;;;;AlBZ/B;;cmB0Ca,mBAAA,EAAqB,yBAAA;;;iBCjBlB,oBAAA,CAAA;EAAuB;AAAA;EAAc,QAAA,GAAW,SAAA;AAAA,IAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCtB3D,iBAAA,CAAA;EAAoB;AAAA;EAAU,IAAA;AAAA,IAAc,kBAAA,CAAA,GAAA,CAAA,OAAA"}
package/dist/admin.mjs CHANGED
@@ -2737,7 +2737,7 @@ const DEFAULT_ROLE_MATRIX = ROLES.map((role) => ({
2737
2737
  grants: defaultGrantsForRole(role)
2738
2738
  }));
2739
2739
  const DEVELOPER_DESCRIPTION = "Everything, including features not released for assignment.";
2740
- const MISSING_SEED_ROLES_MESSAGE = "Roles must include Developer, Admin, Designer, and Author.";
2740
+ const MISSING_SEED_ROLES_MESSAGE = "Roles must include Developer.";
2741
2741
  const DUPLICATE_ROLE_SLUG_MESSAGE = "Each role needs a unique slug.";
2742
2742
  function uniqueSlugs(values) {
2743
2743
  const slugs = [];
@@ -2805,7 +2805,7 @@ function parseRolesMatrix(value) {
2805
2805
  seen.add(parsed.role);
2806
2806
  rows.push(parsed);
2807
2807
  }
2808
- if (ROLES.some((role) => !seen.has(role))) return {
2808
+ if (!seen.has("developer")) return {
2809
2809
  ok: false,
2810
2810
  message: MISSING_SEED_ROLES_MESSAGE
2811
2811
  };
@@ -2847,7 +2847,7 @@ function seedRoleFromTrigger(trigger) {
2847
2847
  let node = trigger.parentElement;
2848
2848
  while (node) {
2849
2849
  const slugs = node.querySelectorAll("[data-role-slug]");
2850
- if (slugs.length === 1) return isRole(slugs[0]?.getAttribute("data-role-seed") || slugs[0]?.getAttribute("data-role-slug"));
2850
+ if (slugs.length === 1) return (slugs[0]?.getAttribute("data-role-seed") || slugs[0]?.getAttribute("data-role-slug")) === "developer";
2851
2851
  if (slugs.length > 1) return false;
2852
2852
  node = node.parentElement;
2853
2853
  }
@@ -2859,9 +2859,9 @@ function viewerIsDeveloper(user) {
2859
2859
  return Array.isArray(roles) && roles.includes("developer");
2860
2860
  }
2861
2861
  /**
2862
- * Payload's array field: drag rank stays, add is for custom rows, seed
2863
- * rows have no remove. Developer stays in the saved array and is shown
2864
- * only to a Developer. Reset restores seed ticks and package labels.
2862
+ * Payload's array field: drag rank stays, add is for custom rows.
2863
+ * Developer has no remove, stays in the saved array, and is shown only
2864
+ * to a Developer. Reset restores the package four and leaves extras.
2865
2865
  */
2866
2866
  const RolesMatrixField = (props) => {
2867
2867
  const { setValue, value } = useField({ path: props.path });