@bison-lab/payload-core 3.10.0 → 3.11.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 +16 -9
- package/dist/admin.d.mts +26 -14
- package/dist/admin.d.mts.map +1 -1
- package/dist/admin.mjs +739 -460
- package/dist/admin.mjs.map +1 -1
- package/dist/identity-DZOb3_Gk.mjs +383 -0
- package/dist/identity-DZOb3_Gk.mjs.map +1 -0
- package/dist/index.d.mts +29 -7
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +282 -186
- package/dist/index.mjs.map +1 -1
- package/dist/{map-BUDkX8g1.mjs → looks-BbL309kO.mjs} +94 -6
- package/dist/looks-BbL309kO.mjs.map +1 -0
- package/dist/{library-BGq4wGif.d.mts → looks-DsizRfFV.d.mts} +62 -8
- package/dist/looks-DsizRfFV.d.mts.map +1 -0
- package/dist/react.mjs +28 -3
- package/dist/react.mjs.map +1 -1
- package/dist/theme.d.mts +11 -2
- package/dist/theme.d.mts.map +1 -1
- package/dist/theme.mjs +40 -4
- package/dist/theme.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/identity-Bg-G05mb.mjs +0 -199
- package/dist/identity-Bg-G05mb.mjs.map +0 -1
- package/dist/library-BGq4wGif.d.mts.map +0 -1
- package/dist/map-BUDkX8g1.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -22,9 +22,9 @@ lockstep.
|
|
|
22
22
|
|
|
23
23
|
| Import | Contents | Runs where |
|
|
24
24
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
|
25
|
-
| `@bison-lab/payload-core` | `seoPlugin`, `createTheme`, `createBrandAssets`, `seedTheme`, 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`, `seedTheme`, `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
|
-
| `@bison-lab/payload-core/theme` | `getPublishedTheme`, `getPublishedIdentity`, `themeConfigFromDoc`, `themeHead`
|
|
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/admin` | Theme child fields (color scale, library, gray family, fonts, appearance, publish) | Admin. Referenced by import-map string; `generate:importmap` writes it. |
|
|
29
29
|
| `@bison-lab/payload-core/react` | `ThemePreview` (legacy; Theme has no preview pane) | Client. Kept so an older site import does not break. |
|
|
30
30
|
|
|
@@ -125,12 +125,17 @@ The sitemap is the site's: filter `meta.noIndex` out of it.
|
|
|
125
125
|
|
|
126
126
|
## Adopting the Theme global
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
and Identity.
|
|
130
|
-
Theme
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
Theme in the admin nav is a group like Content and Settings: Colors,
|
|
129
|
+
Typography, Appearance, and Identity. Those are ordinary Payload Globals
|
|
130
|
+
(`admin.group: "Theme"`), not custom views. `createTheme` returns them plus
|
|
131
|
+
a hidden store (`theme`) that `getPublishedTheme` already reads. Save on a
|
|
132
|
+
page is Payload's Save; it writes that slice onto the store. Document
|
|
133
|
+
locking is off — these are settings forms. Theme has no draft mode and
|
|
134
|
+
no preview pane. Contrast is the automatic label on editable fills at 7:1; it
|
|
135
|
+
is never enforced and lives in the Needs-attention modal, not on the page.
|
|
136
|
+
`bison.config.json` is the seed a site starts from, not the source of truth.
|
|
137
|
+
Pass `destructive` (or `seed.brandDestructive`); otherwise Theme uses the
|
|
138
|
+
library’s `DESTRUCTIVE_SCALE_HEX` (`#ef4444`). Success falls back to `#22c55e`.
|
|
134
139
|
|
|
135
140
|
**1. Register the Global.** Access is required — the predicates live in the
|
|
136
141
|
site's `src/platform` until they move here. Pass `canManageBrand` as
|
|
@@ -149,7 +154,7 @@ export default buildConfig({
|
|
|
149
154
|
}),
|
|
150
155
|
],
|
|
151
156
|
globals: [
|
|
152
|
-
createTheme({
|
|
157
|
+
...createTheme({
|
|
153
158
|
access: { read: isAuthenticated, update: canManageBrand },
|
|
154
159
|
seed: bisonConfig,
|
|
155
160
|
logo: { collection: BRAND_ASSETS_SLUG },
|
|
@@ -201,6 +206,8 @@ const identity = await getPublishedIdentity(payload, {
|
|
|
201
206
|
mark: { url: "/logo-mark.svg", alt: "Acme mark" },
|
|
202
207
|
});
|
|
203
208
|
const { css, preloads } = themeHead(theme, { identity });
|
|
209
|
+
// Custom Colors need the Theme document: themeHeadFromDoc(doc, bisonConfig, { identity })
|
|
210
|
+
// emits --coral-* and [data-look] so lookField keys paint.
|
|
204
211
|
|
|
205
212
|
// <link rel="preload" as="font" type="font/woff2" crossOrigin="" href={href} />
|
|
206
213
|
// <style dangerouslySetInnerHTML={{ __html: css }} />
|
package/dist/admin.d.mts
CHANGED
|
@@ -12,15 +12,17 @@ declare const ColorField: TextFieldClientComponent;
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/admin/color-scale-field.d.ts
|
|
14
14
|
/**
|
|
15
|
-
* One system (or library row) color: hex, source step,
|
|
16
|
-
*
|
|
15
|
+
* One system (or library row) color: hex, source step, include/exclude.
|
|
16
|
+
* Writes the group's stored fields. A committed hex or step rebuilds the scale.
|
|
17
17
|
*/
|
|
18
18
|
declare const ColorScaleField: GroupFieldClientComponent;
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/admin/library-field.d.ts
|
|
21
21
|
/**
|
|
22
|
-
* Custom colors: the same scale controls as system colors
|
|
23
|
-
*
|
|
22
|
+
* Custom colors: the same scale controls as system colors. A row that is
|
|
23
|
+
* not referenced on a page deletes immediately. Rewriting in-use tokens
|
|
24
|
+
* (`rewriteColorToken`) waits on a site usage lookup — Theme cannot see
|
|
25
|
+
* page assignments by itself.
|
|
24
26
|
*/
|
|
25
27
|
declare const LibraryField: ArrayFieldClientComponent;
|
|
26
28
|
//#endregion
|
|
@@ -56,9 +58,8 @@ declare const GreyScaleField: SelectFieldClientComponent;
|
|
|
56
58
|
//#endregion
|
|
57
59
|
//#region src/admin/contrast-report.d.ts
|
|
58
60
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* schema so `contrastTarget` is still a Theme option; it paints nothing.
|
|
61
|
+
* Fill + automatic label only. Target 7:1, Light and Dark. No gray
|
|
62
|
+
* ContrastStrip. Warnings do not block save.
|
|
62
63
|
*/
|
|
63
64
|
declare const ContrastReport: UIFieldClientComponent;
|
|
64
65
|
//#endregion
|
|
@@ -69,18 +70,22 @@ declare const ContrastReport: UIFieldClientComponent;
|
|
|
69
70
|
declare const SectionHeading: UIFieldClientComponent;
|
|
70
71
|
//#endregion
|
|
71
72
|
//#region src/admin/publish-child.d.ts
|
|
72
|
-
/** @deprecated Theme publish is the document Save button */
|
|
73
73
|
declare const PublishChild: UIFieldClientComponent;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/admin/save-button.d.ts
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
77
|
+
* Light/Dark preview for Colors, Typography, and Appearance. Lives in
|
|
78
|
+
* `beforeDocumentControls` so Payload's Save stays in the Save slot.
|
|
79
|
+
* Save writes that page's slice onto the stored Theme row.
|
|
80
|
+
*/
|
|
81
|
+
declare function ThemeDocumentControls(): react_jsx_runtime0.JSX.Element;
|
|
82
|
+
/**
|
|
83
|
+
* Import-map Save slot used by the older single-Global Theme. Theme pages
|
|
84
|
+
* keep Payload's Save and put Light/Dark in `ThemeDocumentControls`.
|
|
80
85
|
*/
|
|
81
86
|
declare function ThemeSaveButton(): react_jsx_runtime0.JSX.Element;
|
|
82
|
-
/** Import
|
|
83
|
-
declare
|
|
87
|
+
/** @deprecated Import map alias — ThemeDocumentControls is the Save-adjacent slot. */
|
|
88
|
+
declare function HiddenSaveButton(): react_jsx_runtime0.JSX.Element;
|
|
84
89
|
//#endregion
|
|
85
90
|
//#region src/admin/identity-fallback.d.ts
|
|
86
91
|
/**
|
|
@@ -89,5 +94,12 @@ declare const HiddenSaveButton: typeof ThemeSaveButton;
|
|
|
89
94
|
*/
|
|
90
95
|
declare const IdentityFallback: UIFieldClientComponent;
|
|
91
96
|
//#endregion
|
|
92
|
-
|
|
97
|
+
//#region src/admin/look-field.d.ts
|
|
98
|
+
/**
|
|
99
|
+
* Loads the Theme global and offers page-editor looks or included steps.
|
|
100
|
+
* A custom scale published on Colors appears here on the next load.
|
|
101
|
+
*/
|
|
102
|
+
declare const LookField: TextFieldClientComponent;
|
|
103
|
+
//#endregion
|
|
104
|
+
export { AppearanceField, ColorField, ColorScaleField, ContrastReport, FontField, GreyScaleField, HiddenSaveButton, IdentityFallback, LibraryField, LookField, PairingField, PublishChild, SectionHeading, ThemeDocumentControls, ThemeSaveButton };
|
|
93
105
|
//# 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/identity-fallback.tsx"],"mappings":";;;;;;;;;;cAWa,UAAA,EAAY,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/identity-fallback.tsx","../src/admin/look-field.tsx"],"mappings":";;;;;;;;;;cAWa,UAAA,EAAY,wBAAA;;;;;;;cCsBZ,eAAA,EAAiB,yBAAA;;;;;;;;ADtB9B;cEca,YAAA,EAAc,yBAAA;;;;;;;;AFd3B;cGOa,SAAA,EAAW,0BAAA;;;;;;;cCNX,YAAA,EAAc,sBAAA;;;;;;;cCCd,eAAA,EAAiB,yBAAA;;;;;;;cCuDjB,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;;;;AAAA,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"}
|