@bison-lab/payload-core 5.9.3 → 5.10.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 +43 -0
- package/dist/admin.d.mts +9 -3
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +30 -9
- package/dist/admin.mjs.map +1 -1
- package/dist/{capability-B3Mk0KRh.mjs → capability-Kd5LgQpm.mjs} +80 -9
- package/dist/capability-Kd5LgQpm.mjs.map +1 -0
- package/dist/index.d.mts +63 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +116 -79
- package/dist/index.mjs.map +1 -1
- package/dist/translate.mjs +1 -1
- package/package.json +1 -1
- package/dist/capability-B3Mk0KRh.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -402,6 +402,49 @@ document. Nav hiding follows `user.allowedFeatures` on the JWT
|
|
|
402
402
|
(computed at user read from the live Features and Roles Globals) so
|
|
403
403
|
Payload's `admin.hidden({ user })` matches the API.
|
|
404
404
|
|
|
405
|
+
### Release-only rows
|
|
406
|
+
|
|
407
|
+
A **release-only row** is a site extra passed with `releaseOnly: true`: a
|
|
408
|
+
launch switch, not a permission. It stays on Settings → Features as a
|
|
409
|
+
release switch, with the copy `RELEASE_ONLY_NOTE` ("Releasing turns this
|
|
410
|
+
on for everyone."), but it is never a tick on Settings → Roles, for any
|
|
411
|
+
role, Developer included, released or not. A Roles save drops any grant
|
|
412
|
+
on its slug and keeps every other grant. Released, `hasFeature` /
|
|
413
|
+
`canUseFeature` on it is true for every login; off, only for a Developer.
|
|
414
|
+
It does not count toward its group slug (`pages`).
|
|
415
|
+
|
|
416
|
+
```ts
|
|
417
|
+
createFeatures({
|
|
418
|
+
extras: [
|
|
419
|
+
{ slug: "doctors", label: "Doctors", group: "pages" },
|
|
420
|
+
{ slug: "find-a-doctor", label: "Find a Doctor", group: "pages", releaseOnly: true },
|
|
421
|
+
],
|
|
422
|
+
});
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
The mark lives in the code catalogue, never in a column, so adding one
|
|
426
|
+
needs no migration and leaves generated types alone. `createFeatures`
|
|
427
|
+
stamps `releaseOnly: true` onto that row when the Global is read (an
|
|
428
|
+
`afterRead` hook, added only when a site passes a release-only extra) and
|
|
429
|
+
lists the slugs in the Global's `custom` for the Roles save
|
|
430
|
+
(`releaseOnlySlugsFromConfig`). A site that passes none gets the same
|
|
431
|
+
config, rows and access results as before. A site's own Features matrix
|
|
432
|
+
field reads `row.releaseOnly` from the fetched Global and shows
|
|
433
|
+
`RELEASE_ONLY_NOTE` (also exported from `./admin`).
|
|
434
|
+
|
|
435
|
+
Whether a row is released, for every visitor rather than one login, is
|
|
436
|
+
`readFeatureReleased(payload, slug, req?)`: it reads the saved Global with
|
|
437
|
+
override access, matches the slug exactly, and answers `false` for a
|
|
438
|
+
missing row, an empty or unreadable Global, or a read that throws (no
|
|
439
|
+
table yet). `featureReleased(rows, slug)` is the same answer from rows
|
|
440
|
+
already in hand.
|
|
441
|
+
|
|
442
|
+
```ts
|
|
443
|
+
import { readFeatureReleased } from "@bison-lab/payload-core";
|
|
444
|
+
|
|
445
|
+
const launched = await readFeatureReleased(payload, "find-a-doctor");
|
|
446
|
+
```
|
|
447
|
+
|
|
405
448
|
## Block library
|
|
406
449
|
|
|
407
450
|
Settings → Block library is one card per installed option. Editors browse
|
package/dist/admin.d.mts
CHANGED
|
@@ -191,14 +191,16 @@ declare const RolesField: SelectFieldClientComponent;
|
|
|
191
191
|
/**
|
|
192
192
|
* Released catalogue rows as ticks, plus the Theme grant. Unreleased
|
|
193
193
|
* features do not appear. Theme always does — Features cannot hide it.
|
|
194
|
-
* On Developer every row is shown granted and locked.
|
|
194
|
+
* On Developer every row is shown granted and locked. A release-only
|
|
195
|
+
* row never appears, released or not, on any role.
|
|
195
196
|
*/
|
|
196
197
|
declare const RolesGrantsField: JSONFieldClientComponent;
|
|
197
198
|
//#endregion
|
|
198
199
|
//#region src/admin/features-matrix-field.d.ts
|
|
199
200
|
/**
|
|
200
201
|
* One release switch per catalogue row, grouped. Off hides the tick on
|
|
201
|
-
* Roles; Developer still has the feature.
|
|
202
|
+
* Roles; Developer still has the feature. A release-only row says that
|
|
203
|
+
* releasing it turns it on for everyone.
|
|
202
204
|
*
|
|
203
205
|
* Writes both the array value and each row's `released` checkbox path.
|
|
204
206
|
* Payload still registers those child fields; toggling only the parent
|
|
@@ -206,6 +208,10 @@ declare const RolesGrantsField: JSONFieldClientComponent;
|
|
|
206
208
|
*/
|
|
207
209
|
declare const FeaturesMatrixField: ArrayFieldClientComponent;
|
|
208
210
|
//#endregion
|
|
211
|
+
//#region src/features/types.d.ts
|
|
212
|
+
/** Settings → Features copy beside a release-only row's switch. */
|
|
213
|
+
declare const RELEASE_ONLY_NOTE = "Releasing turns this on for everyone.";
|
|
214
|
+
//#endregion
|
|
209
215
|
//#region src/admin/block-library-field.d.ts
|
|
210
216
|
/**
|
|
211
217
|
* Category rail and a gallery of live islands. Each island is the sample
|
|
@@ -452,5 +458,5 @@ declare function TranslationActivityPanel(): react_jsx_runtime0.JSX.Element;
|
|
|
452
458
|
*/
|
|
453
459
|
declare function TranslationStatusBar(): react_jsx_runtime0.JSX.Element | null;
|
|
454
460
|
//#endregion
|
|
455
|
-
export { AdminNav, AdminNavEntityField, AdminNavItemRowLabel, AdminNavRowLabel, AppearanceField, BlockDrawerStyles, BlockLibraryField, ColorField, ColorScaleField, ContrastReport, DocumentCreateNew, DocumentTitleActions, FeaturesMatrixField, FontField, GreyScaleField, HiddenSaveButton, IdentityFallback, LibraryField, ListAlignStyles, LookField, MediaAltAutofill, MediaListView, PageSlugCell, PageTitleCell, PairingField, PublishChild, QuestionsList, RefusedSubmitGuard, RefusedSubmitProvider, RequiredPageCell, RequiredPageField, RichTextEditorFontStyles, RoleNameField, RoleSlugField, RolesCell, RolesField, RolesGrantsField, RolesMatrixField, RolesRowLabel, SectionHeading, SlugField, ThemeDocumentControls, ThemeSaveButton, TranslateNowMenuItem, TranslationActivityPanel, TranslationKeyPanel, TranslationStatusBar, setThemePreviewMode };
|
|
461
|
+
export { AdminNav, AdminNavEntityField, AdminNavItemRowLabel, AdminNavRowLabel, AppearanceField, BlockDrawerStyles, BlockLibraryField, ColorField, ColorScaleField, ContrastReport, DocumentCreateNew, DocumentTitleActions, FeaturesMatrixField, FontField, GreyScaleField, HiddenSaveButton, IdentityFallback, LibraryField, ListAlignStyles, LookField, MediaAltAutofill, MediaListView, PageSlugCell, PageTitleCell, PairingField, PublishChild, QuestionsList, RELEASE_ONLY_NOTE, RefusedSubmitGuard, RefusedSubmitProvider, RequiredPageCell, RequiredPageField, RichTextEditorFontStyles, RoleNameField, RoleSlugField, RolesCell, RolesField, RolesGrantsField, RolesMatrixField, RolesRowLabel, SectionHeading, SlugField, ThemeDocumentControls, ThemeSaveButton, TranslateNowMenuItem, TranslationActivityPanel, TranslationKeyPanel, TranslationStatusBar, setThemePreviewMode };
|
|
456
462
|
//# sourceMappingURL=admin.d.mts.map
|
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/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-status-bar.tsx"],"mappings":";;;;;;;;;;;cAWa,UAAA,EAAY,wBAAA;;;;;;;;cCuBZ,eAAA,EAAiB,yBAAA;;;;;;;;;cCMjB,YAAA,EAAc,yBAAA;;;;;;;;;cCtBd,SAAA,EAAW,0BAAA;;;;;;;cCNX,YAAA,EAAc,sBAAA;;;;;;;cCCd,eAAA,EAAiB,yBAAA;;;ALF9B;;;;AAAA,cM4Da,cAAA,EAAgB,0BAAA;;;;;;;cCnDhB,cAAA,EAAgB,sBAAA;;;;;;cCbhB,cAAA,EAAgB,sBAAA;;;cC0IhB,YAAA,EAAc,sBAAA;;;;;;;;iBCtIX,qBAAA,CAAA;;AVAhB;;;iBUQgB,eAAA,CAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;iBA0Bf,gBAAA,CAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;KCpCpB,gBAAA;AAAA,iBAgDI,mBAAA,CAAoB,IAAA,EAAM,gBAAA;;;;;;;cCjD7B,gBAAA,EAAkB,sBAAA;;;;;;;cCIlB,SAAA,EAAW,wBAAA;;;;;;;;;iBCOR,SAAA,CAAA;EAAY,QAAA;EAAU;AAAA,GAAS,yBAAA,GAAyB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;cCc3D,gBAAA,EAAkB,yBAAA;;;;;;iBC1Bf,aAAA,CAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;cCChB,aAAA,EAAe,wBAAA;;;;;;;;;cC8Bf,SAAA,EAAW,wBAAA;;;;;;;;;AlB3BxB;iBmBCgB,aAAA,CAAc,KAAA,EAAO,yBAAA,GAAyB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBCP9C,YAAA,CAAA;EAAe,QAAA;EAAU;AAAA,GAAW,yBAAA,GAAyB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;cCEhE,iBAAA,EAAmB,wBAAA;AAAA,iBAEhB,gBAAA,CAAA;EAAmB;AAAA,GAAW,yBAAA,GAAyB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;cCA1D,aAAA,EAAe,wBAAA;;;;;;;;cCqBf,UAAA,EAAY,0BAAA
|
|
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-status-bar.tsx"],"mappings":";;;;;;;;;;;cAWa,UAAA,EAAY,wBAAA;;;;;;;;cCuBZ,eAAA,EAAiB,yBAAA;;;;;;;;;cCMjB,YAAA,EAAc,yBAAA;;;;;;;;;cCtBd,SAAA,EAAW,0BAAA;;;;;;;cCNX,YAAA,EAAc,sBAAA;;;;;;;cCCd,eAAA,EAAiB,yBAAA;;;ALF9B;;;;AAAA,cM4Da,cAAA,EAAgB,0BAAA;;;;;;;cCnDhB,cAAA,EAAgB,sBAAA;;;;;;cCbhB,cAAA,EAAgB,sBAAA;;;cC0IhB,YAAA,EAAc,sBAAA;;;;;;;;iBCtIX,qBAAA,CAAA;;AVAhB;;;iBUQgB,eAAA,CAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;iBA0Bf,gBAAA,CAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;KCpCpB,gBAAA;AAAA,iBAgDI,mBAAA,CAAoB,IAAA,EAAM,gBAAA;;;;;;;cCjD7B,gBAAA,EAAkB,sBAAA;;;;;;;cCIlB,SAAA,EAAW,wBAAA;;;;;;;;;iBCOR,SAAA,CAAA;EAAY,QAAA;EAAU;AAAA,GAAS,yBAAA,GAAyB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;cCc3D,gBAAA,EAAkB,yBAAA;;;;;;iBC1Bf,aAAA,CAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;cCChB,aAAA,EAAe,wBAAA;;;;;;;;;cC8Bf,SAAA,EAAW,wBAAA;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wBAAA,CAAA,GAAwB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;A9C/BxC;;;;;iB+CuBgB,oBAAA,CAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/admin.mjs
CHANGED
|
@@ -2683,6 +2683,8 @@ const PACKAGE_FEATURES = [
|
|
|
2683
2683
|
defaultReleased: true
|
|
2684
2684
|
}
|
|
2685
2685
|
];
|
|
2686
|
+
/** Settings → Features copy beside a release-only row's switch. */
|
|
2687
|
+
const RELEASE_ONLY_NOTE = "Releasing turns this on for everyone.";
|
|
2686
2688
|
function isFeatureGroupId(value) {
|
|
2687
2689
|
return typeof value === "string" && FEATURE_GROUPS.includes(value);
|
|
2688
2690
|
}
|
|
@@ -2771,12 +2773,17 @@ function defaultGrantsForRole(role, extraGrants) {
|
|
|
2771
2773
|
//#endregion
|
|
2772
2774
|
//#region src/features/matrix.ts
|
|
2773
2775
|
const MISSING_PACKAGE_FEATURES_MESSAGE = "Features must include Content, Publish, Media, Users, and Roles.";
|
|
2776
|
+
/** `{ releaseOnly: true }` for a release-only row, nothing otherwise, so other rows keep their shape. */
|
|
2777
|
+
function releaseOnlyMark(releaseOnly) {
|
|
2778
|
+
return releaseOnly === true ? { releaseOnly: true } : {};
|
|
2779
|
+
}
|
|
2774
2780
|
function featureCatalogue(extras = []) {
|
|
2775
2781
|
return [...PACKAGE_FEATURES.map((feature) => ({ ...feature })), ...extras.map((extra) => ({
|
|
2776
2782
|
slug: extra.slug,
|
|
2777
2783
|
label: extra.label,
|
|
2778
2784
|
group: extra.group ?? "users",
|
|
2779
|
-
defaultReleased: extra.defaultReleased ?? false
|
|
2785
|
+
defaultReleased: extra.defaultReleased ?? false,
|
|
2786
|
+
...releaseOnlyMark(extra.releaseOnly)
|
|
2780
2787
|
}))];
|
|
2781
2788
|
}
|
|
2782
2789
|
function defaultFeaturesFieldValue(extras = []) {
|
|
@@ -2785,7 +2792,8 @@ function defaultFeaturesFieldValue(extras = []) {
|
|
|
2785
2792
|
slug: feature.slug,
|
|
2786
2793
|
label: feature.label,
|
|
2787
2794
|
group: feature.group,
|
|
2788
|
-
released: feature.defaultReleased
|
|
2795
|
+
released: feature.defaultReleased,
|
|
2796
|
+
...releaseOnlyMark(feature.releaseOnly)
|
|
2789
2797
|
}));
|
|
2790
2798
|
}
|
|
2791
2799
|
function parseFeaturesMatrix(value) {
|
|
@@ -2808,7 +2816,8 @@ function parseFeaturesMatrix(value) {
|
|
|
2808
2816
|
slug,
|
|
2809
2817
|
label,
|
|
2810
2818
|
group,
|
|
2811
|
-
released: Boolean("released" in item && item.released)
|
|
2819
|
+
released: Boolean("released" in item && item.released),
|
|
2820
|
+
...releaseOnlyMark("releaseOnly" in item && item.releaseOnly === true)
|
|
2812
2821
|
});
|
|
2813
2822
|
}
|
|
2814
2823
|
if (PACKAGE_FEATURES.some((feature) => !seen.has(feature.slug))) return {
|
|
@@ -3777,7 +3786,8 @@ function rolePathFromGrants(path) {
|
|
|
3777
3786
|
/**
|
|
3778
3787
|
* Released catalogue rows as ticks, plus the Theme grant. Unreleased
|
|
3779
3788
|
* features do not appear. Theme always does — Features cannot hide it.
|
|
3780
|
-
* On Developer every row is shown granted and locked.
|
|
3789
|
+
* On Developer every row is shown granted and locked. A release-only
|
|
3790
|
+
* row never appears, released or not, on any role.
|
|
3781
3791
|
*/
|
|
3782
3792
|
const RolesGrantsField = (props) => {
|
|
3783
3793
|
const { setValue, value } = useField({ path: props.path });
|
|
@@ -3800,7 +3810,8 @@ const RolesGrantsField = (props) => {
|
|
|
3800
3810
|
};
|
|
3801
3811
|
}, [api, serverURL]);
|
|
3802
3812
|
const grants = asGrants(value);
|
|
3803
|
-
const
|
|
3813
|
+
const ticks = catalogue.filter((row) => !row.releaseOnly);
|
|
3814
|
+
const shown = implicitAll ? ticks : ticks.filter((row) => row.released);
|
|
3804
3815
|
const alwaysTranslation = typeof role === "string" && ALWAYS_TRANSLATION_ROLES.includes(role);
|
|
3805
3816
|
function locked(slug) {
|
|
3806
3817
|
return implicitAll || slug === "translation" && alwaysTranslation;
|
|
@@ -3857,17 +3868,26 @@ const RolesGrantsField = (props) => {
|
|
|
3857
3868
|
};
|
|
3858
3869
|
//#endregion
|
|
3859
3870
|
//#region src/admin/features-matrix-field.tsx
|
|
3860
|
-
const LIST_CSS$2 = `.bl-features{margin-block:.35rem 0;font-size:16px}.bl-features__group{margin-block:1rem 0}.bl-features__group-title{font-size:14px;letter-spacing:.02em;color:var(--theme-elevation-400,#94a3b8);font-weight:650;margin-block-end:.35rem}.bl-features__row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.55rem 0;border-bottom:1px solid var(--theme-elevation-150,#e2e8f0)}.bl-features__row:last-child{border-bottom:0}.bl-features input{inline-size:1.15rem;block-size:1.15rem}`;
|
|
3871
|
+
const LIST_CSS$2 = `.bl-features{margin-block:.35rem 0;font-size:16px}.bl-features__group{margin-block:1rem 0}.bl-features__group-title{font-size:14px;letter-spacing:.02em;color:var(--theme-elevation-400,#94a3b8);font-weight:650;margin-block-end:.35rem}.bl-features__row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.55rem 0;border-bottom:1px solid var(--theme-elevation-150,#e2e8f0)}.bl-features__row:last-child{border-bottom:0}.bl-features input{inline-size:1.15rem;block-size:1.15rem}.bl-features__name{display:flex;flex-direction:column;gap:.15rem}.bl-features__note{font-size:13px;color:var(--theme-elevation-500,#64748b)}`;
|
|
3861
3872
|
function asRows$1(value) {
|
|
3862
3873
|
return Array.isArray(value) ? value : [];
|
|
3863
3874
|
}
|
|
3864
3875
|
function FeatureReleaseRow({ path, index, row, rows, setRows }) {
|
|
3865
3876
|
const { setValue: setReleased } = useField({ path: `${path}.${index}.released` });
|
|
3877
|
+
const noteId = row.releaseOnly ? `bl-features-note-${row.slug}` : void 0;
|
|
3866
3878
|
return /* @__PURE__ */ jsxs("div", {
|
|
3867
3879
|
className: "bl-features__row",
|
|
3868
|
-
children: [/* @__PURE__ */
|
|
3880
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
3881
|
+
className: "bl-features__name",
|
|
3882
|
+
children: [/* @__PURE__ */ jsx("span", { children: row.label || row.slug }), noteId ? /* @__PURE__ */ jsx("span", {
|
|
3883
|
+
id: noteId,
|
|
3884
|
+
className: "bl-features__note",
|
|
3885
|
+
children: RELEASE_ONLY_NOTE
|
|
3886
|
+
}) : null]
|
|
3887
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
3869
3888
|
type: "checkbox",
|
|
3870
3889
|
"aria-label": `Release ${row.label || row.slug}`,
|
|
3890
|
+
"aria-describedby": noteId,
|
|
3871
3891
|
checked: Boolean(row.released),
|
|
3872
3892
|
onChange: (event) => {
|
|
3873
3893
|
const released = event.target.checked;
|
|
@@ -3882,7 +3902,8 @@ function FeatureReleaseRow({ path, index, row, rows, setRows }) {
|
|
|
3882
3902
|
}
|
|
3883
3903
|
/**
|
|
3884
3904
|
* One release switch per catalogue row, grouped. Off hides the tick on
|
|
3885
|
-
* Roles; Developer still has the feature.
|
|
3905
|
+
* Roles; Developer still has the feature. A release-only row says that
|
|
3906
|
+
* releasing it turns it on for everyone.
|
|
3886
3907
|
*
|
|
3887
3908
|
* Writes both the array value and each row's `released` checkbox path.
|
|
3888
3909
|
* Payload still registers those child fields; toggling only the parent
|
|
@@ -7763,6 +7784,6 @@ function TranslationActivityPanel() {
|
|
|
7763
7784
|
] });
|
|
7764
7785
|
}
|
|
7765
7786
|
//#endregion
|
|
7766
|
-
export { AdminNav, AdminNavEntityField, AdminNavItemRowLabel, AdminNavRowLabel, AppearanceField, BlockDrawerStyles, BlockLibraryField, ColorField, ColorScaleField, ContrastReport, DocumentCreateNew, DocumentTitleActions, FeaturesMatrixField, FontField, GreyScaleField, HiddenSaveButton, IdentityFallback, LibraryField, ListAlignStyles, LookField, MediaAltAutofill, MediaListView, PageSlugCell, PageTitleCell, PairingField, PublishChild, QuestionsList, RefusedSubmitGuard, RefusedSubmitProvider, RequiredPageCell, RequiredPageField, RichTextEditorFontStyles, RoleNameField, RoleSlugField, RolesCell, RolesField, RolesGrantsField, RolesMatrixField, RolesRowLabel, SectionHeading, SlugField, ThemeDocumentControls, ThemeSaveButton, TranslateNowMenuItem, TranslationActivityPanel, TranslationKeyPanel, TranslationStatusBar, setThemePreviewMode };
|
|
7787
|
+
export { AdminNav, AdminNavEntityField, AdminNavItemRowLabel, AdminNavRowLabel, AppearanceField, BlockDrawerStyles, BlockLibraryField, ColorField, ColorScaleField, ContrastReport, DocumentCreateNew, DocumentTitleActions, FeaturesMatrixField, FontField, GreyScaleField, HiddenSaveButton, IdentityFallback, LibraryField, ListAlignStyles, LookField, MediaAltAutofill, MediaListView, PageSlugCell, PageTitleCell, PairingField, PublishChild, QuestionsList, RELEASE_ONLY_NOTE, RefusedSubmitGuard, RefusedSubmitProvider, RequiredPageCell, RequiredPageField, RichTextEditorFontStyles, RoleNameField, RoleSlugField, RolesCell, RolesField, RolesGrantsField, RolesMatrixField, RolesRowLabel, SectionHeading, SlugField, ThemeDocumentControls, ThemeSaveButton, TranslateNowMenuItem, TranslationActivityPanel, TranslationKeyPanel, TranslationStatusBar, setThemePreviewMode };
|
|
7767
7788
|
|
|
7768
7789
|
//# sourceMappingURL=admin.mjs.map
|