@bison-lab/payload-core 3.31.0 → 3.32.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 +42 -4
- package/dist/admin.d.mts +40 -2
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +834 -3
- package/dist/admin.mjs.map +1 -1
- package/dist/index.d.mts +87 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +119 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,11 +22,11 @@ lockstep.
|
|
|
22
22
|
|
|
23
23
|
| Import | Contents | Runs where |
|
|
24
24
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
|
25
|
-
| `@bison-lab/payload-core` | `seoPlugin`, `createTheme`, `createBrandAssets`, `createRoles`, `createFeatures`, `createPages`, `createUsers`, `createMedia`, `createRedirects`, `createAdminNav`, `adminNav`, `createNavigation`, `adminOnlyApiTab`, `documentTitleActions`, `seedTheme`, `seedRoles`, `seedFeatures`, predicates, `lookField`, `colorTokenField`, import-map strings, title and text helpers, types | Node. What `payload.config.ts` imports; it loads the plugin. |
|
|
25
|
+
| `@bison-lab/payload-core` | `seoPlugin`, `createTheme`, `createBrandAssets`, `createRoles`, `createFeatures`, `createPages`, `createUsers`, `createMedia`, `createRedirects`, `createQuestions`, `createTaxonomy`, `createAdminNav`, `adminNav`, `createNavigation`, `adminOnlyApiTab`, `documentTitleActions`, `seedTheme`, `seedRoles`, `seedFeatures`, predicates, `lookField`, `colorTokenField`, import-map strings, title and text helpers, types | Node. What `payload.config.ts` imports; it loads the plugin. |
|
|
26
26
|
| `@bison-lab/payload-core/metadata` | `pageMetadata`, the title helpers, the same types | Server. What a page route imports; it does not load the plugin. |
|
|
27
27
|
| `@bison-lab/payload-core/theme` | `getPublishedTheme`, `getPublishedIdentity`, `themeConfigFromDoc`, `themeHead`, `themeHeadFromDoc` | Server. What a root layout imports; it does not load the plugin or React. |
|
|
28
28
|
| `@bison-lab/payload-core/navigation` | `getNavigation`, the Header and Footer slugs | Server. What a site header imports; it does not load the plugin or React. |
|
|
29
|
-
| `@bison-lab/payload-core/admin` | Theme fields, the Roles and Features matrices, Admin nav,
|
|
29
|
+
| `@bison-lab/payload-core/admin` | Theme fields, the Roles and Features matrices, Admin nav, the Users Roles checklist, and the FAQ Library list | Admin. Referenced by import-map string; `generate:importmap` writes it. |
|
|
30
30
|
| `@bison-lab/payload-core/react` | `ThemePreview` (legacy; Theme has no preview pane) | Client. Kept so an older site import does not break. |
|
|
31
31
|
|
|
32
32
|
## What editors get
|
|
@@ -426,6 +426,44 @@ A site that already stored footer columns on the `nav` document copies
|
|
|
426
426
|
`footer.columns` onto the new global, then drops the footer fields from
|
|
427
427
|
`nav`.
|
|
428
428
|
|
|
429
|
+
## FAQ Library
|
|
430
|
+
|
|
431
|
+
`createQuestions` is one document per FAQ (question, textarea answer, drafts)
|
|
432
|
+
with a kit List that replaces Payload's stock collection list. `createTaxonomy`
|
|
433
|
+
is a name-only terms collection, hidden from the nav; add and delete for
|
|
434
|
+
`manage: true` facets happen on that list. Pass Anatomy-like collections and
|
|
435
|
+
Topics through `organizeBy` — the package does not know "anatomy". Feature
|
|
436
|
+
slug `questions`. Used-on stays 0 until a later block stores relationships.
|
|
437
|
+
|
|
438
|
+
```ts
|
|
439
|
+
createTaxonomy({
|
|
440
|
+
slug: "topics",
|
|
441
|
+
labels: { singular: "Topic", plural: "Topics" },
|
|
442
|
+
access: { read: () => true, update: canUseFeature("questions") },
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
createQuestions({
|
|
446
|
+
organizeBy: [
|
|
447
|
+
{
|
|
448
|
+
name: "anatomy",
|
|
449
|
+
label: "Anatomy",
|
|
450
|
+
collection: "anatomy",
|
|
451
|
+
manage: false,
|
|
452
|
+
look: { global: "anatomy" },
|
|
453
|
+
},
|
|
454
|
+
{ name: "topics", label: "Topics", collection: "topics", manage: true },
|
|
455
|
+
],
|
|
456
|
+
});
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
The list view is `@bison-lab/payload-core/admin#QuestionsList`. It wraps
|
|
460
|
+
`Page` from `@bison-lab/admin-ui` so the column is Payload's `--gutter-h`,
|
|
461
|
+
the same inset Media and Pages use — not a mockup max-width. A later kit
|
|
462
|
+
list (Media) wraps the same `Page`. Run `payload generate:importmap` and
|
|
463
|
+
`payload migrate:create`. Add a Features extra
|
|
464
|
+
`{ slug: "questions", label: "FAQ Library" }` the same way Navigation is
|
|
465
|
+
added.
|
|
466
|
+
|
|
429
467
|
## No generated types
|
|
430
468
|
|
|
431
469
|
The package cannot import a site's `payload-types`, so the shapes it reads
|
|
@@ -438,7 +476,7 @@ to a type that has one.
|
|
|
438
476
|
|
|
439
477
|
`noIndexField`, the plugin's own fields, the Theme Global fields, the
|
|
440
478
|
Roles Global fields, the Admin nav fields, the Header and Footer fields,
|
|
441
|
-
the Pages slug lock fields, the Redirects collection,
|
|
442
|
-
brand-assets collection fields are columns
|
|
479
|
+
the Pages slug lock fields, the Redirects collection, the
|
|
480
|
+
brand-assets collection fields, and the FAQ Library / taxonomy fields are columns
|
|
443
481
|
in every consuming site. A change to them is a schema change: say "run
|
|
444
482
|
`payload migrate:create`" in the changeset.
|
package/dist/admin.d.mts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ThemeConfig } from "@bison-lab/tokens";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
import { ArrayFieldClientComponent, DefaultCellComponentProps, GroupFieldClientComponent, JSONFieldClientComponent, SelectFieldClientComponent, TextFieldClientComponent, UIFieldClientComponent } from "payload";
|
|
5
|
+
import { ArrayFieldClientComponent, DefaultCellComponentProps, GroupFieldClientComponent, JSONFieldClientComponent, ListViewClientProps, SelectFieldClientComponent, TextFieldClientComponent, UIFieldClientComponent } from "payload";
|
|
6
6
|
|
|
7
7
|
//#region src/admin/color-field.d.ts
|
|
8
8
|
/**
|
|
@@ -230,5 +230,43 @@ declare function AdminNavItemRowLabel(): react_jsx_runtime0.JSX.Element;
|
|
|
230
230
|
*/
|
|
231
231
|
declare const AdminNavEntityField: TextFieldClientComponent;
|
|
232
232
|
//#endregion
|
|
233
|
-
|
|
233
|
+
//#region src/questions/types.d.ts
|
|
234
|
+
/**
|
|
235
|
+
* Theme family for chips on a linked facet. The list fetches this
|
|
236
|
+
* Global and maps each row's label (and key, if present) to `family`
|
|
237
|
+
* so a badge can set `data-look`. Term documents that already store
|
|
238
|
+
* `family` or `look` win.
|
|
239
|
+
*/
|
|
240
|
+
interface OrganizeByLook {
|
|
241
|
+
/** Global slug whose rows carry a Theme family. */
|
|
242
|
+
global: string;
|
|
243
|
+
/** Array field on that Global. Default `areas`. */
|
|
244
|
+
path?: string;
|
|
245
|
+
/** Label field on each row, matched to the term name. Default `label`. */
|
|
246
|
+
label?: string;
|
|
247
|
+
/** Theme family field. Default `family`. */
|
|
248
|
+
family?: string;
|
|
249
|
+
}
|
|
250
|
+
interface OrganizeByEntry {
|
|
251
|
+
/** FAQ relationship field name. Must be a valid Payload field name. */
|
|
252
|
+
name: string;
|
|
253
|
+
/** Filters, table heading, and Manage column. */
|
|
254
|
+
label: string;
|
|
255
|
+
/** Terms collection slug. */
|
|
256
|
+
collection: string;
|
|
257
|
+
/**
|
|
258
|
+
* When true, Manage organization can add and delete terms. Default
|
|
259
|
+
* false — Anatomy-style collections stay read-only here.
|
|
260
|
+
*/
|
|
261
|
+
manage?: boolean;
|
|
262
|
+
/** Optional Theme family source for this facet's chips. */
|
|
263
|
+
look?: OrganizeByLook;
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/admin/questions-list.d.ts
|
|
267
|
+
declare function QuestionsList(props: ListViewClientProps & {
|
|
268
|
+
organizeBy?: readonly OrganizeByEntry[];
|
|
269
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
270
|
+
//#endregion
|
|
271
|
+
export { AdminNav, AdminNavEntityField, AdminNavItemRowLabel, AdminNavRowLabel, AppearanceField, ColorField, ColorScaleField, ContrastReport, DocumentCreateNew, DocumentTitleActions, FeaturesMatrixField, FontField, GreyScaleField, HiddenSaveButton, IdentityFallback, LibraryField, LookField, PageTitleCell, PairingField, PublishChild, QuestionsList, RoleNameField, RoleSlugField, RolesField, RolesGrantsField, RolesMatrixField, RolesRowLabel, SectionHeading, SlugField, ThemeDocumentControls, ThemeSaveButton, setThemePreviewMode };
|
|
234
272
|
//# 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-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/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","../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"],"mappings":";;;;;;;;;;;cAWa,UAAA,EAAY,wBAAA;;;;;;;cCsBZ,eAAA,EAAiB,yBAAA;;;;;;;;;cCOjB,YAAA,EAAc,yBAAA;;;;;;;;;cCtBd,SAAA,EAAW,0BAAA;;;;;;;cCNX,YA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A;EAAW;AAAA,GAAmB,aAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;iBCnD3C,gBAAA,CAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;iBCGhB,oBAAA,CAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;cCEvB,mBAAA,EAAqB,wBAAA"}
|
|
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-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/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","../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/questions/types.ts","../src/admin/questions-list.tsx"],"mappings":";;;;;;;;;;;cAWa,UAAA,EAAY,wBAAA;;;;;;;cCsBZ,eAAA,EAAiB,yBAAA;;;;;;;;;cCOjB,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,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