payload-canvas 0.6.2 → 0.6.4
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/LICENSE +21 -21
- package/README.md +7 -5
- package/dist/admin/aiKeyField.scss +58 -58
- package/dist/admin/diff/layoutDiff.scss +181 -181
- package/dist/admin/editor/assistant/assistant.scss +944 -944
- package/dist/admin/editor/classes/manager.scss +262 -262
- package/dist/admin/editor/comments/comments.scss +539 -539
- package/dist/admin/editor/dnd/dnd.scss +261 -261
- package/dist/admin/editor/editor.scss +2629 -2629
- package/dist/admin/editor/empty/empty.scss +92 -92
- package/dist/admin/editor/fields/fields.scss +778 -778
- package/dist/admin/editor/generate/generate.scss +276 -276
- package/dist/admin/editor/layout/layout.scss +240 -240
- package/dist/admin/editor/live/presence.scss +24 -24
- package/dist/admin/editor/locale/locale.scss +154 -154
- package/dist/admin/editor/media/media.scss +233 -233
- package/dist/admin/editor/menu/menu.scss +132 -132
- package/dist/admin/editor/motion/motion.scss +84 -84
- package/dist/admin/editor/sections/components.scss +238 -238
- package/dist/admin/editor/sections/variants.scss +90 -90
- package/dist/admin/editor/styles/ClassCss.js +3 -3
- package/dist/admin/editor/styles/classes.scss +381 -381
- package/dist/admin/editor/styles/styles.scss +1123 -1123
- package/dist/admin/editor/styles/tokens.js +2 -1
- package/dist/admin/editor/templates/templates.scss +654 -654
- package/dist/admin/editor/tooltip/tooltip.scss +39 -39
- package/dist/admin/editor/topbar/DocumentActions.js +1 -1
- package/dist/admin/editor/topbar/contentMode.scss +26 -26
- package/dist/admin/editor/topbar/screens/screens.scss +134 -134
- package/dist/admin/editor/topbar/settingsDrawer.scss +32 -32
- package/dist/admin/editor/topbar/topbar.scss +645 -645
- package/dist/admin/editor/ui/controls.scss +320 -320
- package/dist/admin/forms/submissions.scss +197 -197
- package/dist/admin/layoutField.scss +69 -69
- package/dist/admin/templateConditions.scss +24 -24
- package/dist/ai/prompt.js +40 -40
- package/dist/blocks/client/marquee.js +14 -14
- package/dist/blocks/defaults.js +17 -1
- package/dist/blocks/payload.js +13 -3
- package/dist/core/responseError.d.ts +5 -0
- package/dist/core/responseError.js +8 -0
- package/dist/css/index.d.ts +6 -0
- package/dist/css/index.js +40 -1
- package/dist/css/shared.js +2 -2
- package/dist/live/session.js +18 -0
- package/dist/live/storage.d.ts +5 -0
- package/dist/live/storage.js +20 -0
- package/dist/mcp/shared.js +16 -16
- package/dist/plugin/index.d.ts +14 -1
- package/dist/plugin/index.js +46 -8
- package/dist/react/canvas/BuilderCanvas.js +4 -3
- package/dist/react/canvas/thumbnail/ThumbnailCanvas.js +2 -1
- package/dist/react/components/AutoplayVideo.d.ts +3 -1
- package/dist/react/components/AutoplayVideo.js +4 -3
- package/dist/react/components/Video.d.ts +1 -0
- package/dist/react/components/Video.js +13 -2
- package/dist/react/components/videoPlayback.d.ts +13 -0
- package/dist/react/components/videoPlayback.js +10 -0
- package/dist/theme/admin/fields.scss +363 -363
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Eugene Lominos
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eugene Lominos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -620,8 +620,8 @@ websiteBuilder({
|
|
|
620
620
|
| `listCollections` | `string[]` | More collections the collection list block can show, after the collections with a `url`. Use it for data collections without pages of their own, such as testimonials or team members. Their items have no `$url`. Each slug must be a collection of the config. Pass the same list to `builderMcpTools`. |
|
|
621
621
|
| `sections` | `SectionDefinition[]` | Ready-made sections. See [Sections](#sections). |
|
|
622
622
|
| `savedSections` | `{ slug?, access?, admin?, hooks? } \| false` | The collection for sections people save in the editor. Default slug `builder-sections`; default access: every signed-in user. `false` turns it off. See [Saved sections](#saved-sections). |
|
|
623
|
-
| `css.entry` | `string` | Your Tailwind entry CSS, absolute or relative to `process.cwd()`. Required. |
|
|
624
|
-
| `css.plugins` | `Record<id, plugin>` | Tailwind plugins by the id your CSS uses in `@plugin "<id>"`. Pass the imported module, so Next bundles it. |
|
|
623
|
+
| `css.entry` | `string` | Your Tailwind entry CSS, absolute or relative to `process.cwd()`. Required, also when the builder edits a Payload blocks field: the canvas compiles Tailwind against it, and the editor reads its breakpoints and theme from it. Without it the app does not start, and the error says what to pass. |
|
|
624
|
+
| `css.plugins` | `Record<id, plugin>` | Tailwind plugins by the id your CSS uses in `@plugin "<id>"`. Pass the imported module, so Next bundles it. Every `@plugin` line of the entry needs one. At startup the plugin compiles the entry once and logs an error that names each missing plugin. Until you add it, `/api/builder/canvas-css` and `/api/builder/style-tokens` answer 500 with the same message, and the editor shows it. |
|
|
625
625
|
| `canvasPath` | `string` | The canvas route. Default `/builder-canvas`. |
|
|
626
626
|
| `templates.slug` | `string` | Slug of the templates collection. Default `builder-templates`. |
|
|
627
627
|
| `templates.hooks` | `CollectionConfig['hooks']` | Hooks for the templates collection, for example to revalidate pages. |
|
|
@@ -1070,6 +1070,7 @@ export const blocks = [...defaultBlocks({ linkCollections: ['pages'] }), pricing
|
|
|
1070
1070
|
- Autoplay respects reduced motion. A `<video>` never gets the `autoplay` attribute. On the site a small client component starts it after mount, and only when the visitor does not ask for less motion (`prefers-reduced-motion: reduce`). Otherwise the video shows its poster and stays paused. A change of that setting plays or pauses it. Its JavaScript loads only on pages with an autoplaying video. Without JavaScript the video stays on its poster. A YouTube or Vimeo embed cannot check the setting: the player decides.
|
|
1071
1071
|
- On the canvas and in section thumbnails an autoplaying video stays paused on its poster, and an embed does not autoplay, so editing stays calm.
|
|
1072
1072
|
- The poster's focal point (`focalX`, `focalY`) sets `object-position` on the video, with the image block's rule: Payload's default 50/50 leaves the crop to the classes (`object-top`).
|
|
1073
|
+
- **Phone video** (`phoneVideo`, an upload, or `phoneUrl`, a video file link): a smaller copy that screens up to 767 px wide load instead (`<source media="(max-width: 767px)">`). Use an upright crop with the poster's framing: the poster's `object-position` applies to it too. To keep the framing, cut a crop of width `W` from a source of width `S` at `x = focalX% × (S − W)`. The browser picks the file once, when the page loads.
|
|
1073
1074
|
- A hero background video: in a stack with `relative isolate`, a `video` first with `autoplay`, `muted`, `loop`, `decorative`, `priority` and a `poster`, and the classes `absolute inset-0 -z-10 size-full object-cover`.
|
|
1074
1075
|
- `heading`: `accent`, words of the text to highlight. They render as `<em>`. Style them with classes on the heading, for example `[&_em]:text-primary [&_em]:not-italic`.
|
|
1075
1076
|
- `stack`: `as` (the inspector's **Tag**) also takes `ol`, `ul`, `li`, `dl`, `dt`, `dd`, `figure` and `figcaption`, for lists, term lists and captions. It takes no `p` or `span`: those cannot hold block children such as a heading.
|
|
@@ -1399,7 +1400,8 @@ A site that already has a Payload `blocks` field (for example `pages.layout` wit
|
|
|
1399
1400
|
websiteBuilder({
|
|
1400
1401
|
collections: { pages: { field: 'layout', url: (doc) => `/${doc.slug}` } },
|
|
1401
1402
|
blocks,
|
|
1402
|
-
|
|
1403
|
+
// Required here too: the canvas compiles your Tailwind against it. Pass every @plugin of the entry.
|
|
1404
|
+
css: { entry: 'src/app/(frontend)/globals.css', plugins: { '@tailwindcss/typography': typography } },
|
|
1403
1405
|
})
|
|
1404
1406
|
```
|
|
1405
1407
|
|
|
@@ -1448,7 +1450,7 @@ export const blocks = [...defaultBlocks({ linkCollections: ['pages'] }), ...site
|
|
|
1448
1450
|
| `styles` | Adds `className` and the Styles panel. Default `false`: your components style themselves. |
|
|
1449
1451
|
| `category` | Library group for blocks without `admin.group`. Default "Site sections" (blocks with slots) or "Site blocks". |
|
|
1450
1452
|
| `overrides` | Per slug: `label`, `category`, `icon`, `styles`, `defaultClassName`, `classes`, `ai`, `parents`, and `slots` (merged into a slot, for example `{ content: { allow: ['*'] } }`). |
|
|
1451
|
-
| `onWarning` | Gets the messages about things that do not carry over. Default: `console.warn` outside production. `false` turns them off. |
|
|
1453
|
+
| `onWarning` | Gets the messages about things that do not carry over. Default: `console.warn` outside production, each message once per server process and once per page load. `false` turns them off. |
|
|
1452
1454
|
|
|
1453
1455
|
`labels.singular` becomes the label, and `admin.group` the library category. `interfaceName`, `dbName`, `imageURL` and the block's own admin components are not used.
|
|
1454
1456
|
|
|
@@ -1475,7 +1477,7 @@ Each component gets the props it always got: `{ id, blockType, blockName, ...fie
|
|
|
1475
1477
|
|
|
1476
1478
|
### How the builder edits a Payload blocks field
|
|
1477
1479
|
|
|
1478
|
-
- **One field.** When the builder opens a page, it reads the stored blocks (`depth: 0`) into the editor. Each save writes them back to the same field through Payload's Local API, as the editor's user (`overrideAccess: false`). Payload's field hooks, validation, access, versions and locales run once per save, as for a save in Payload's editor. Opening the builder saves nothing.
|
|
1480
|
+
- **One field.** When the builder opens a page, it reads the stored blocks (`depth: 0`) into the editor. Each save writes them back to the same field through Payload's Local API, as the editor's user (`overrideAccess: false`). Payload's field hooks, validation, access, versions and locales run once per save, as for a save in Payload's editor. Opening the builder saves nothing, and neither does a save that changes nothing (an edit undone before the save, or a value set to what it was): the builder writes only when the blocks would store something new, so it makes no draft version.
|
|
1479
1481
|
- **Nothing lost.** A round trip keeps every stored value: fields the inspector does not show, unknown keys, `null` and empty values, block ids and order, `blockName` (the block's name in the builder), array rows with their ids, groups, nested blocks fields inside groups and arrays, and upload and relationship ids. No HTML is read back and no defaults are added. Data the builder cannot keep exactly (a block type without a builder block, two blocks with one id) is not changed: the builder refuses to open the page (422) and says why. Payload's editor still opens it.
|
|
1480
1482
|
- **Saves from elsewhere win.** A save from Payload's editor, the REST API or the Local API is the stored truth. An open builder shows it at once and replays its own unsaved edits on top, after every such save until the builder saves.
|
|
1481
1483
|
- **Copied rows.** Rows pasted from another page or inserted from a saved section get new ids. The page keeps its own row ids through remove, save, undo and save.
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
// The API key field of the AI settings global. Payload CSS variables only, no Tailwind.
|
|
2
|
-
@layer payload-default {
|
|
3
|
-
.ai-key-field {
|
|
4
|
-
margin-bottom: var(--spacing-field, calc(var(--base) * 1.5));
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.ai-key-field__status {
|
|
8
|
-
margin: 0 0 calc(var(--base) * 0.25);
|
|
9
|
-
color: var(--theme-text);
|
|
10
|
-
font-size: var(--font-body-size-m, 13px);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.ai-key-field__status--error {
|
|
14
|
-
color: var(--theme-error-500);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.ai-key-field__note {
|
|
18
|
-
margin: 0 0 calc(var(--base) * 0.5);
|
|
19
|
-
color: var(--theme-elevation-500);
|
|
20
|
-
font-size: var(--font-body-size-s, 12px);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.ai-key-field__row {
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-wrap: wrap;
|
|
26
|
-
align-items: center;
|
|
27
|
-
gap: calc(var(--base) * 0.5);
|
|
28
|
-
margin-bottom: calc(var(--base) * 0.5);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.ai-key-field__input {
|
|
32
|
-
flex: 1 1 calc(var(--base) * 16);
|
|
33
|
-
min-width: 0;
|
|
34
|
-
height: calc(var(--base) * 2);
|
|
35
|
-
padding: 0 calc(var(--base) * 0.5);
|
|
36
|
-
border: 1px solid var(--theme-elevation-150);
|
|
37
|
-
border-radius: var(--style-radius-s, var(--border-radius-m));
|
|
38
|
-
background: var(--theme-input-bg);
|
|
39
|
-
color: var(--theme-text);
|
|
40
|
-
font: inherit;
|
|
41
|
-
font-size: var(--font-body-size-m, 13px);
|
|
42
|
-
box-sizing: border-box;
|
|
43
|
-
outline: none;
|
|
44
|
-
|
|
45
|
-
&:hover {
|
|
46
|
-
border-color: var(--theme-elevation-250);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:focus {
|
|
50
|
-
border-color: var(--theme-elevation-400);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.ai-key-field__link {
|
|
55
|
-
color: var(--theme-elevation-800);
|
|
56
|
-
font-size: var(--font-body-size-s, 12px);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
// The API key field of the AI settings global. Payload CSS variables only, no Tailwind.
|
|
2
|
+
@layer payload-default {
|
|
3
|
+
.ai-key-field {
|
|
4
|
+
margin-bottom: var(--spacing-field, calc(var(--base) * 1.5));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ai-key-field__status {
|
|
8
|
+
margin: 0 0 calc(var(--base) * 0.25);
|
|
9
|
+
color: var(--theme-text);
|
|
10
|
+
font-size: var(--font-body-size-m, 13px);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ai-key-field__status--error {
|
|
14
|
+
color: var(--theme-error-500);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ai-key-field__note {
|
|
18
|
+
margin: 0 0 calc(var(--base) * 0.5);
|
|
19
|
+
color: var(--theme-elevation-500);
|
|
20
|
+
font-size: var(--font-body-size-s, 12px);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ai-key-field__row {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: calc(var(--base) * 0.5);
|
|
28
|
+
margin-bottom: calc(var(--base) * 0.5);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ai-key-field__input {
|
|
32
|
+
flex: 1 1 calc(var(--base) * 16);
|
|
33
|
+
min-width: 0;
|
|
34
|
+
height: calc(var(--base) * 2);
|
|
35
|
+
padding: 0 calc(var(--base) * 0.5);
|
|
36
|
+
border: 1px solid var(--theme-elevation-150);
|
|
37
|
+
border-radius: var(--style-radius-s, var(--border-radius-m));
|
|
38
|
+
background: var(--theme-input-bg);
|
|
39
|
+
color: var(--theme-text);
|
|
40
|
+
font: inherit;
|
|
41
|
+
font-size: var(--font-body-size-m, 13px);
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
outline: none;
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
border-color: var(--theme-elevation-250);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus {
|
|
50
|
+
border-color: var(--theme-elevation-400);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ai-key-field__link {
|
|
55
|
+
color: var(--theme-elevation-800);
|
|
56
|
+
font-size: var(--font-body-size-s, 12px);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,181 +1,181 @@
|
|
|
1
|
-
// The builder layout diff in Payload's Versions > compare view. Payload CSS variables only, no
|
|
2
|
-
// Tailwind. Colors come from Payload's own diff variables (`--diff-create-*`, `--diff-delete-*`),
|
|
3
|
-
// with theme fallbacks, so it matches the other fields' diffs in light and dark theme.
|
|
4
|
-
|
|
5
|
-
@layer payload-default {
|
|
6
|
-
.layout-diff {
|
|
7
|
-
position: relative;
|
|
8
|
-
|
|
9
|
-
&__content {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: calc(var(--base) * 0.5);
|
|
13
|
-
background: var(--theme-elevation-50);
|
|
14
|
-
padding: calc(var(--base) * 0.5);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&__summary {
|
|
18
|
-
margin: 0;
|
|
19
|
-
color: var(--theme-elevation-800);
|
|
20
|
-
font-weight: 500;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&__list,
|
|
24
|
-
&__details {
|
|
25
|
-
list-style: none;
|
|
26
|
-
margin: 0;
|
|
27
|
-
padding: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&__list {
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
gap: calc(var(--base) * 0.25);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&__change {
|
|
37
|
-
padding: calc(var(--base) * 0.4) calc(var(--base) * 0.5);
|
|
38
|
-
border: 1px solid var(--theme-elevation-100);
|
|
39
|
-
border-radius: var(--style-radius-s);
|
|
40
|
-
background: var(--theme-elevation-0);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&__head {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-wrap: wrap;
|
|
46
|
-
align-items: baseline;
|
|
47
|
-
gap: calc(var(--base) * 0.3);
|
|
48
|
-
min-width: 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&__pill {
|
|
52
|
-
flex: none;
|
|
53
|
-
padding: 0 calc(var(--base) * 0.25);
|
|
54
|
-
border: 1px solid var(--theme-elevation-150);
|
|
55
|
-
border-radius: var(--style-radius-s);
|
|
56
|
-
background: var(--theme-elevation-100);
|
|
57
|
-
color: var(--theme-elevation-800);
|
|
58
|
-
font-size: calc(var(--base) * 0.55);
|
|
59
|
-
font-weight: 600;
|
|
60
|
-
line-height: 1.6;
|
|
61
|
-
text-transform: uppercase;
|
|
62
|
-
letter-spacing: 0.04em;
|
|
63
|
-
|
|
64
|
-
&--added {
|
|
65
|
-
border-color: var(--diff-create-pill-border, var(--theme-success-400));
|
|
66
|
-
background: var(--diff-create-pill-bg, var(--theme-success-200));
|
|
67
|
-
color: var(--diff-create-pill-color, var(--theme-success-600));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&--removed {
|
|
71
|
-
border-color: var(--diff-delete-pill-border, var(--theme-error-400));
|
|
72
|
-
background: var(--diff-delete-pill-bg, var(--theme-error-200));
|
|
73
|
-
color: var(--diff-delete-pill-color, var(--theme-error-600));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&__name {
|
|
78
|
-
min-width: 0;
|
|
79
|
-
overflow-wrap: anywhere;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&__where {
|
|
83
|
-
color: var(--theme-elevation-600);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&__details {
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
gap: calc(var(--base) * 0.2);
|
|
90
|
-
margin-top: calc(var(--base) * 0.3);
|
|
91
|
-
padding-inline-start: calc(var(--base) * 0.5);
|
|
92
|
-
border-inline-start: 2px solid var(--theme-elevation-100);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&__detail {
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-wrap: wrap;
|
|
98
|
-
align-items: baseline;
|
|
99
|
-
gap: calc(var(--base) * 0.25);
|
|
100
|
-
min-width: 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
&__detail-label {
|
|
104
|
-
display: inline-flex;
|
|
105
|
-
align-items: baseline;
|
|
106
|
-
gap: calc(var(--base) * 0.2);
|
|
107
|
-
color: var(--theme-elevation-600);
|
|
108
|
-
|
|
109
|
-
&::after {
|
|
110
|
-
content: ':';
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.field-diff__locale-label {
|
|
114
|
-
margin: 0;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
&__value,
|
|
119
|
-
&__class {
|
|
120
|
-
padding: 0 calc(var(--base) * 0.15);
|
|
121
|
-
border-radius: var(--style-radius-s);
|
|
122
|
-
text-decoration: none;
|
|
123
|
-
overflow-wrap: anywhere;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&__value--del {
|
|
127
|
-
background: var(--diff-delete-parent-bg, var(--theme-error-100));
|
|
128
|
-
color: var(--diff-delete-parent-color, var(--theme-error-800));
|
|
129
|
-
text-decoration: line-through;
|
|
130
|
-
text-decoration-color: var(--diff-delete-pill-border, var(--theme-error-400));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&__value--ins {
|
|
134
|
-
background: var(--diff-create-parent-bg, var(--theme-success-100));
|
|
135
|
-
color: var(--diff-create-parent-color, var(--theme-success-800));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
&__class {
|
|
139
|
-
font-family: var(--font-mono, ui-monospace, monospace);
|
|
140
|
-
font-size: calc(var(--base) * 0.55);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&__empty {
|
|
144
|
-
color: var(--theme-elevation-400);
|
|
145
|
-
font-style: italic;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&__arrow {
|
|
149
|
-
color: var(--theme-elevation-400);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&__json {
|
|
153
|
-
border-top: 1px solid var(--theme-elevation-100);
|
|
154
|
-
padding-top: calc(var(--base) * 0.4);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&__json-summary {
|
|
158
|
-
cursor: pointer;
|
|
159
|
-
color: var(--theme-elevation-600);
|
|
160
|
-
width: fit-content;
|
|
161
|
-
|
|
162
|
-
&:hover {
|
|
163
|
-
color: var(--theme-elevation-900);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&__json-content {
|
|
168
|
-
display: grid;
|
|
169
|
-
// Same columns as Payload's field diffs: old on the left, new on the right.
|
|
170
|
-
grid-template-columns: calc(50% - var(--base) * 0.5) calc(50% - var(--base) * 0.5);
|
|
171
|
-
gap: var(--base);
|
|
172
|
-
margin-top: calc(var(--base) * 0.5);
|
|
173
|
-
overflow-x: auto;
|
|
174
|
-
|
|
175
|
-
pre {
|
|
176
|
-
white-space: pre-wrap;
|
|
177
|
-
overflow-wrap: anywhere;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
1
|
+
// The builder layout diff in Payload's Versions > compare view. Payload CSS variables only, no
|
|
2
|
+
// Tailwind. Colors come from Payload's own diff variables (`--diff-create-*`, `--diff-delete-*`),
|
|
3
|
+
// with theme fallbacks, so it matches the other fields' diffs in light and dark theme.
|
|
4
|
+
|
|
5
|
+
@layer payload-default {
|
|
6
|
+
.layout-diff {
|
|
7
|
+
position: relative;
|
|
8
|
+
|
|
9
|
+
&__content {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: calc(var(--base) * 0.5);
|
|
13
|
+
background: var(--theme-elevation-50);
|
|
14
|
+
padding: calc(var(--base) * 0.5);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__summary {
|
|
18
|
+
margin: 0;
|
|
19
|
+
color: var(--theme-elevation-800);
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&__list,
|
|
24
|
+
&__details {
|
|
25
|
+
list-style: none;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__list {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: calc(var(--base) * 0.25);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__change {
|
|
37
|
+
padding: calc(var(--base) * 0.4) calc(var(--base) * 0.5);
|
|
38
|
+
border: 1px solid var(--theme-elevation-100);
|
|
39
|
+
border-radius: var(--style-radius-s);
|
|
40
|
+
background: var(--theme-elevation-0);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__head {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
align-items: baseline;
|
|
47
|
+
gap: calc(var(--base) * 0.3);
|
|
48
|
+
min-width: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__pill {
|
|
52
|
+
flex: none;
|
|
53
|
+
padding: 0 calc(var(--base) * 0.25);
|
|
54
|
+
border: 1px solid var(--theme-elevation-150);
|
|
55
|
+
border-radius: var(--style-radius-s);
|
|
56
|
+
background: var(--theme-elevation-100);
|
|
57
|
+
color: var(--theme-elevation-800);
|
|
58
|
+
font-size: calc(var(--base) * 0.55);
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
line-height: 1.6;
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
letter-spacing: 0.04em;
|
|
63
|
+
|
|
64
|
+
&--added {
|
|
65
|
+
border-color: var(--diff-create-pill-border, var(--theme-success-400));
|
|
66
|
+
background: var(--diff-create-pill-bg, var(--theme-success-200));
|
|
67
|
+
color: var(--diff-create-pill-color, var(--theme-success-600));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&--removed {
|
|
71
|
+
border-color: var(--diff-delete-pill-border, var(--theme-error-400));
|
|
72
|
+
background: var(--diff-delete-pill-bg, var(--theme-error-200));
|
|
73
|
+
color: var(--diff-delete-pill-color, var(--theme-error-600));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&__name {
|
|
78
|
+
min-width: 0;
|
|
79
|
+
overflow-wrap: anywhere;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&__where {
|
|
83
|
+
color: var(--theme-elevation-600);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__details {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: calc(var(--base) * 0.2);
|
|
90
|
+
margin-top: calc(var(--base) * 0.3);
|
|
91
|
+
padding-inline-start: calc(var(--base) * 0.5);
|
|
92
|
+
border-inline-start: 2px solid var(--theme-elevation-100);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__detail {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-wrap: wrap;
|
|
98
|
+
align-items: baseline;
|
|
99
|
+
gap: calc(var(--base) * 0.25);
|
|
100
|
+
min-width: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&__detail-label {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: baseline;
|
|
106
|
+
gap: calc(var(--base) * 0.2);
|
|
107
|
+
color: var(--theme-elevation-600);
|
|
108
|
+
|
|
109
|
+
&::after {
|
|
110
|
+
content: ':';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.field-diff__locale-label {
|
|
114
|
+
margin: 0;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__value,
|
|
119
|
+
&__class {
|
|
120
|
+
padding: 0 calc(var(--base) * 0.15);
|
|
121
|
+
border-radius: var(--style-radius-s);
|
|
122
|
+
text-decoration: none;
|
|
123
|
+
overflow-wrap: anywhere;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&__value--del {
|
|
127
|
+
background: var(--diff-delete-parent-bg, var(--theme-error-100));
|
|
128
|
+
color: var(--diff-delete-parent-color, var(--theme-error-800));
|
|
129
|
+
text-decoration: line-through;
|
|
130
|
+
text-decoration-color: var(--diff-delete-pill-border, var(--theme-error-400));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__value--ins {
|
|
134
|
+
background: var(--diff-create-parent-bg, var(--theme-success-100));
|
|
135
|
+
color: var(--diff-create-parent-color, var(--theme-success-800));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&__class {
|
|
139
|
+
font-family: var(--font-mono, ui-monospace, monospace);
|
|
140
|
+
font-size: calc(var(--base) * 0.55);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&__empty {
|
|
144
|
+
color: var(--theme-elevation-400);
|
|
145
|
+
font-style: italic;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&__arrow {
|
|
149
|
+
color: var(--theme-elevation-400);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&__json {
|
|
153
|
+
border-top: 1px solid var(--theme-elevation-100);
|
|
154
|
+
padding-top: calc(var(--base) * 0.4);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&__json-summary {
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
color: var(--theme-elevation-600);
|
|
160
|
+
width: fit-content;
|
|
161
|
+
|
|
162
|
+
&:hover {
|
|
163
|
+
color: var(--theme-elevation-900);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&__json-content {
|
|
168
|
+
display: grid;
|
|
169
|
+
// Same columns as Payload's field diffs: old on the left, new on the right.
|
|
170
|
+
grid-template-columns: calc(50% - var(--base) * 0.5) calc(50% - var(--base) * 0.5);
|
|
171
|
+
gap: var(--base);
|
|
172
|
+
margin-top: calc(var(--base) * 0.5);
|
|
173
|
+
overflow-x: auto;
|
|
174
|
+
|
|
175
|
+
pre {
|
|
176
|
+
white-space: pre-wrap;
|
|
177
|
+
overflow-wrap: anywhere;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|