payload-markdown 1.8.0 → 1.8.1
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 -0
- package/dist/agent/access.d.ts +1 -1
- package/dist/agent/access.js.map +1 -1
- package/dist/agent/guide.d.ts +3 -0
- package/dist/agent/guide.js +28 -2
- package/dist/agent/guide.js.map +1 -1
- package/dist/agent/palettes.d.ts +55 -0
- package/dist/agent/palettes.js +194 -0
- package/dist/agent/palettes.js.map +1 -0
- package/dist/agent/skill.d.ts +2 -2
- package/dist/agent/skill.js +2 -2
- package/dist/agent/skill.js.map +1 -1
- package/dist/agent/validate.d.ts +1 -1
- package/dist/agent/validate.js +3 -0
- package/dist/agent/validate.js.map +1 -1
- package/dist/appearance/PaletteRowLabel.client.d.ts +2 -0
- package/dist/appearance/PaletteRowLabel.client.js +70 -0
- package/dist/appearance/PaletteRowLabel.client.js.map +1 -0
- package/dist/appearance/config.d.ts +8 -0
- package/dist/appearance/config.js +172 -0
- package/dist/appearance/config.js.map +1 -0
- package/dist/appearance/options.d.ts +11 -0
- package/dist/appearance/options.js +15 -0
- package/dist/appearance/options.js.map +1 -0
- package/dist/appearance/runtime.d.ts +25 -0
- package/dist/appearance/runtime.js +126 -0
- package/dist/appearance/runtime.js.map +1 -0
- package/dist/components/MarkdownRenderer/Component.js +4 -0
- package/dist/components/MarkdownRenderer/Component.js.map +1 -1
- package/dist/core/plugins/directiveButton.d.ts +1 -1
- package/dist/core/plugins/directiveButton.js +27 -10
- package/dist/core/plugins/directiveButton.js.map +1 -1
- package/dist/core/plugins/rehypeResolveIcons.js +10 -1
- package/dist/core/plugins/rehypeResolveIcons.js.map +1 -1
- package/dist/core/plugins/remarkValidatePalettes.d.ts +9 -0
- package/dist/core/plugins/remarkValidatePalettes.js +51 -0
- package/dist/core/plugins/remarkValidatePalettes.js.map +1 -0
- package/dist/core/renderMarkdown.js +13 -1
- package/dist/core/renderMarkdown.js.map +1 -1
- package/dist/directive-spec.json +60 -0
- package/dist/directives/definitions/button.d.ts +1 -1
- package/dist/directives/definitions/button.js +9 -2
- package/dist/directives/definitions/button.js.map +1 -1
- package/dist/directives/definitions/callout.js +9 -2
- package/dist/directives/definitions/callout.js.map +1 -1
- package/dist/directives/definitions/card.d.ts +0 -2
- package/dist/directives/definitions/card.js +13 -8
- package/dist/directives/definitions/card.js.map +1 -1
- package/dist/directives/definitions/cards.js +9 -0
- package/dist/directives/definitions/cards.js.map +1 -1
- package/dist/directives/definitions/details.js +4 -0
- package/dist/directives/definitions/details.js.map +1 -1
- package/dist/directives/definitions/section.js +4 -0
- package/dist/directives/definitions/section.js.map +1 -1
- package/dist/directives/definitions/steps.js +4 -0
- package/dist/directives/definitions/steps.js.map +1 -1
- package/dist/directives/definitions/tabs.js +4 -0
- package/dist/directives/definitions/tabs.js.map +1 -1
- package/dist/directives/definitions/toc.js +1 -1
- package/dist/directives/definitions/toc.js.map +1 -1
- package/dist/directives/diagnostics.d.ts +5 -0
- package/dist/directives/diagnostics.js +26 -10
- package/dist/directives/diagnostics.js.map +1 -1
- package/dist/directives/iconPlaceholder.d.ts +9 -3
- package/dist/directives/iconPlaceholder.js +8 -1
- package/dist/directives/iconPlaceholder.js.map +1 -1
- package/dist/directives/palette.d.ts +23 -0
- package/dist/directives/palette.js +40 -0
- package/dist/directives/palette.js.map +1 -0
- package/dist/directives/spec.d.ts +6 -2
- package/dist/directives/spec.js +5 -0
- package/dist/directives/spec.js.map +1 -1
- package/dist/editor/directiveConfig.d.ts +15 -1
- package/dist/editor/directiveConfig.js +21 -1
- package/dist/editor/directiveConfig.js.map +1 -1
- package/dist/editor/directives/completions.d.ts +4 -2
- package/dist/editor/directives/completions.js +22 -3
- package/dist/editor/directives/completions.js.map +1 -1
- package/dist/editor/directives/diagnostics.d.ts +2 -2
- package/dist/editor/directives/diagnostics.js +10 -3
- package/dist/editor/directives/diagnostics.js.map +1 -1
- package/dist/exports/client.d.ts +4 -1
- package/dist/exports/client.js +5 -2
- package/dist/exports/client.js.map +1 -1
- package/dist/field/MarkdownField/Component.js +54 -3
- package/dist/field/MarkdownField/Component.js.map +1 -1
- package/dist/icons/entries.d.ts +22 -0
- package/dist/icons/entries.js +50 -0
- package/dist/icons/entries.js.map +1 -0
- package/dist/icons/resolve.d.ts +2 -1
- package/dist/icons/resolve.js +2 -2
- package/dist/icons/resolve.js.map +1 -1
- package/dist/icons/sanitizeSvg.d.ts +12 -2
- package/dist/icons/sanitizeSvg.js +104 -3
- package/dist/icons/sanitizeSvg.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.js +34 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +65 -4
- package/dist/mcp/index.js.map +1 -1
- package/dist/palettes/colors.d.ts +21 -0
- package/dist/palettes/colors.js +43 -0
- package/dist/palettes/colors.js.map +1 -0
- package/dist/palettes/contrast.d.ts +7 -0
- package/dist/palettes/contrast.js +63 -0
- package/dist/palettes/contrast.js.map +1 -0
- package/dist/palettes/defaults.d.ts +8 -0
- package/dist/palettes/defaults.js +275 -0
- package/dist/palettes/defaults.js.map +1 -0
- package/dist/palettes/diagnostics.d.ts +10 -0
- package/dist/palettes/diagnostics.js +38 -0
- package/dist/palettes/diagnostics.js.map +1 -0
- package/dist/palettes/index.d.ts +61 -0
- package/dist/palettes/index.js +246 -0
- package/dist/palettes/index.js.map +1 -0
- package/dist/render/renderMarkdown.d.ts +3 -1
- package/dist/render/renderMarkdown.js +9 -1
- package/dist/render/renderMarkdown.js.map +1 -1
- package/dist/runtime/index.d.ts +12 -1
- package/dist/runtime/index.js +21 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/types/core.d.ts +43 -0
- package/dist/types/core.js.map +1 -1
- package/dist/types.d.ts +46 -2
- package/dist/types.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/skills/payload-markdown/claude/SKILL.md +1 -0
- package/skills/payload-markdown/claude/reference/directive-spec.json +60 -0
- package/skills/payload-markdown/claude/reference/mcp-content-workflow.md +7 -0
- package/skills/payload-markdown/claude/reference/payload-markdown-directives.md +22 -2
- package/skills/payload-markdown/claude/skill.json +2 -2
- package/skills/payload-markdown/codex/SKILL.md +1 -0
- package/skills/payload-markdown/codex/reference/directive-spec.json +60 -0
- package/skills/payload-markdown/codex/reference/mcp-content-workflow.md +7 -0
- package/skills/payload-markdown/codex/reference/payload-markdown-directives.md +22 -2
- package/skills/payload-markdown/codex/skill.json +2 -2
|
@@ -59,6 +59,7 @@ claude mcp add --transport http payload http://localhost:3000/api/mcp --header "
|
|
|
59
59
|
- Use `:::tabs` only for truly parallel alternatives such as package managers or framework variants.
|
|
60
60
|
- Use `:::details` for optional caveats, migration notes, or advanced branches.
|
|
61
61
|
- Use `:::section`, `:::2col`, `:::3col`, and `:::cell` sparingly for dense landing-style docs sections.
|
|
62
|
+
- Colour icons and directives with named palettes (`palette=`, `iconPalette=`, `@pack/icon palette=name`), never CSS.
|
|
62
63
|
- Avoid unsupported directives, MDX components, arbitrary HTML widgets, and runtime Tailwind classes in authored Markdown.
|
|
63
64
|
|
|
64
65
|
## Examples
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
{
|
|
112
112
|
"name": "section",
|
|
113
113
|
"attributes": [
|
|
114
|
+
{
|
|
115
|
+
"name": "palette",
|
|
116
|
+
"type": "string",
|
|
117
|
+
"format": "palette"
|
|
118
|
+
},
|
|
114
119
|
{
|
|
115
120
|
"name": "theme",
|
|
116
121
|
"type": "string",
|
|
@@ -206,6 +211,11 @@
|
|
|
206
211
|
"type": "string",
|
|
207
212
|
"format": "icon"
|
|
208
213
|
},
|
|
214
|
+
{
|
|
215
|
+
"name": "iconPalette",
|
|
216
|
+
"type": "string",
|
|
217
|
+
"format": "palette"
|
|
218
|
+
},
|
|
209
219
|
{
|
|
210
220
|
"name": "iconPosition",
|
|
211
221
|
"default": "left",
|
|
@@ -224,6 +234,11 @@
|
|
|
224
234
|
"false"
|
|
225
235
|
]
|
|
226
236
|
},
|
|
237
|
+
{
|
|
238
|
+
"name": "palette",
|
|
239
|
+
"type": "string",
|
|
240
|
+
"format": "palette"
|
|
241
|
+
},
|
|
227
242
|
{
|
|
228
243
|
"name": "size",
|
|
229
244
|
"default": "md",
|
|
@@ -470,6 +485,16 @@
|
|
|
470
485
|
"type": "string",
|
|
471
486
|
"format": "icon"
|
|
472
487
|
},
|
|
488
|
+
{
|
|
489
|
+
"name": "iconPalette",
|
|
490
|
+
"type": "string",
|
|
491
|
+
"format": "palette"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "palette",
|
|
495
|
+
"type": "string",
|
|
496
|
+
"format": "palette"
|
|
497
|
+
},
|
|
473
498
|
{
|
|
474
499
|
"name": "theme",
|
|
475
500
|
"type": "string",
|
|
@@ -514,6 +539,11 @@
|
|
|
514
539
|
"false"
|
|
515
540
|
]
|
|
516
541
|
},
|
|
542
|
+
{
|
|
543
|
+
"name": "palette",
|
|
544
|
+
"type": "string",
|
|
545
|
+
"format": "palette"
|
|
546
|
+
},
|
|
517
547
|
{
|
|
518
548
|
"name": "theme",
|
|
519
549
|
"type": "string",
|
|
@@ -596,6 +626,11 @@
|
|
|
596
626
|
"false"
|
|
597
627
|
]
|
|
598
628
|
},
|
|
629
|
+
{
|
|
630
|
+
"name": "palette",
|
|
631
|
+
"type": "string",
|
|
632
|
+
"format": "palette"
|
|
633
|
+
},
|
|
599
634
|
{
|
|
600
635
|
"name": "stepTheme",
|
|
601
636
|
"type": "string",
|
|
@@ -648,6 +683,11 @@
|
|
|
648
683
|
"name": "href",
|
|
649
684
|
"type": "url"
|
|
650
685
|
},
|
|
686
|
+
{
|
|
687
|
+
"name": "iconPalette",
|
|
688
|
+
"type": "string",
|
|
689
|
+
"format": "palette"
|
|
690
|
+
},
|
|
651
691
|
{
|
|
652
692
|
"name": "linkScope",
|
|
653
693
|
"default": "section",
|
|
@@ -667,6 +707,11 @@
|
|
|
667
707
|
"false"
|
|
668
708
|
]
|
|
669
709
|
},
|
|
710
|
+
{
|
|
711
|
+
"name": "palette",
|
|
712
|
+
"type": "string",
|
|
713
|
+
"format": "palette"
|
|
714
|
+
},
|
|
670
715
|
{
|
|
671
716
|
"name": "theme",
|
|
672
717
|
"type": "string",
|
|
@@ -698,6 +743,11 @@
|
|
|
698
743
|
"type": "string",
|
|
699
744
|
"format": "icon"
|
|
700
745
|
},
|
|
746
|
+
{
|
|
747
|
+
"name": "iconPalette",
|
|
748
|
+
"type": "string",
|
|
749
|
+
"format": "palette"
|
|
750
|
+
},
|
|
701
751
|
{
|
|
702
752
|
"name": "linkScope",
|
|
703
753
|
"default": "full",
|
|
@@ -716,6 +766,11 @@
|
|
|
716
766
|
"false"
|
|
717
767
|
]
|
|
718
768
|
},
|
|
769
|
+
{
|
|
770
|
+
"name": "palette",
|
|
771
|
+
"type": "string",
|
|
772
|
+
"format": "palette"
|
|
773
|
+
},
|
|
719
774
|
{
|
|
720
775
|
"name": "theme",
|
|
721
776
|
"type": "string",
|
|
@@ -743,6 +798,11 @@
|
|
|
743
798
|
"name": "default",
|
|
744
799
|
"type": "string"
|
|
745
800
|
},
|
|
801
|
+
{
|
|
802
|
+
"name": "palette",
|
|
803
|
+
"type": "string",
|
|
804
|
+
"format": "palette"
|
|
805
|
+
},
|
|
746
806
|
{
|
|
747
807
|
"name": "tabTheme",
|
|
748
808
|
"type": "string",
|
|
@@ -22,6 +22,12 @@ Other clients use the same URL with an `Authorization: Bearer <key>` header. Ask
|
|
|
22
22
|
6. Report what changed and share `adminUrl` / `previewUrl`.
|
|
23
23
|
7. `markdownPublish` (or `publish: true`) only when the user explicitly asked for the change to go live.
|
|
24
24
|
|
|
25
|
+
## Palettes
|
|
26
|
+
|
|
27
|
+
- Use palette names from `markdownGuide` or `markdownPalettes` (built-in hues, configured ones, and ones managed in the Markdown Appearance global).
|
|
28
|
+
- When the user wants a colour no palette provides (a brand colour, say) and `markdownPaletteSave` is available, create a palette instead of writing CSS: `{ "palette": { "name": "debian", "label": "Debian", "color": "#a80030", "dark": { "color": "#ff5277" } } }`. Give it a `dark.color` when `contrast` notes say the light colour is too dark for dark mode. Then reference it: `icon="@fa-brands/debian palette=debian"`.
|
|
29
|
+
- Saving a palette changes every page that uses it, live. Edit or delete an existing palette only when the user asked for that.
|
|
30
|
+
|
|
25
31
|
## Edits
|
|
26
32
|
|
|
27
33
|
- `{ "action": "replace", "target": "<ref>", "markdown": "…" }` replaces a markdown field or block.
|
|
@@ -37,6 +43,7 @@ Each markdown block renders on its own: a directive opened in one block must clo
|
|
|
37
43
|
- `locked`: someone has it open. Ask the user before retrying with `overrideLock: true`.
|
|
38
44
|
- `forbidden`: the API key or user lacks access. Tell the user which collection needs `Find` or `Update` on the key.
|
|
39
45
|
- `no_drafts`: the collection has no drafts, so writes are already live. Tell the user before writing.
|
|
46
|
+
- `invalid_palette`: a colour or name was rejected; `details.errors` says which. `not_enabled`: the site has no runtime palettes (the developer must add `appearance: true`).
|
|
40
47
|
|
|
41
48
|
## Rules
|
|
42
49
|
|
|
@@ -43,6 +43,24 @@ Install, configure, ship.
|
|
|
43
43
|
- `:::3col`
|
|
44
44
|
- `:::cell`
|
|
45
45
|
|
|
46
|
+
## Colour Palettes
|
|
47
|
+
|
|
48
|
+
Palettes are named colour themes. Use them to colour icons and recolour directives; never write CSS or Tailwind classes for colour.
|
|
49
|
+
|
|
50
|
+
- One icon: `icon="@pack/name palette=ubuntu"`. In a list, each entry carries its own palette, so order never swaps colours: `icon="@fa-brands/debian palette=debian, @fa-brands/ubuntu palette=ubuntu"`.
|
|
51
|
+
- `iconPalette="name"`: default for a directive's icons without their own (`card`, `cards`, `callout`, `button`).
|
|
52
|
+
- `palette="name"`: surface, border and link accent of `card`, `cards`, `callout`, `button`, `details`, `section`, `steps` or `tabs`, and the default for their icons. It combines with `theme`.
|
|
53
|
+
- Built-in palettes: every Tailwind hue (`red`, `orange`, `amber`, `emerald`, `teal`, `sky`, `violet`, `slate`, …). Sites can add more in code or in the Markdown Appearance global; `markdownGuide` and `markdownPalettes` list the real names.
|
|
54
|
+
|
|
55
|
+
```md
|
|
56
|
+
:::card[Linux]{
|
|
57
|
+
icon="@fa-brands/debian palette=debian, @fa-brands/ubuntu palette=ubuntu"
|
|
58
|
+
theme="glass"
|
|
59
|
+
}
|
|
60
|
+
Debian and Ubuntu support.
|
|
61
|
+
:::
|
|
62
|
+
```
|
|
63
|
+
|
|
46
64
|
## Callouts
|
|
47
65
|
|
|
48
66
|
Use callouts for information that changes how the reader should interpret or execute a task.
|
|
@@ -51,7 +69,8 @@ Attributes:
|
|
|
51
69
|
|
|
52
70
|
- `variant`: `note`, `info`, `tip`, `warning`, `danger`, or `success`
|
|
53
71
|
- `theme`: `soft`, `solid`, `glass`, or a configured theme
|
|
54
|
-
- `icon`: local icon reference
|
|
72
|
+
- `icon`: local icon reference, optionally `palette=<name>` after it
|
|
73
|
+
- `palette`, `iconPalette`: colour palettes (see Colour Palettes)
|
|
55
74
|
- `[Label]` or legacy `title`
|
|
56
75
|
|
|
57
76
|
```md
|
|
@@ -173,8 +192,9 @@ Use button links for clear actions. Do not use snippet-only names such as `::but
|
|
|
173
192
|
- `href`: required
|
|
174
193
|
- `variant`: `primary`, `secondary`, `outline`, `ghost`, or `link`
|
|
175
194
|
- `size`: `sm`, `md`, or `lg`
|
|
176
|
-
- `icon`: local icon reference
|
|
195
|
+
- `icon`: local icon reference, optionally `palette=<name>` after it
|
|
177
196
|
- `iconPosition`: `left` or `right`
|
|
197
|
+
- `palette`: button fill, label and border colours; `iconPalette` for the icon
|
|
178
198
|
- `newTab`
|
|
179
199
|
- `ariaLabel` for icon-only buttons
|
|
180
200
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"name": "payload-markdown",
|
|
3
3
|
"package": "@valkyrianlabs/payload-markdown",
|
|
4
4
|
"variant": "claude",
|
|
5
|
-
"version": "1.8.
|
|
6
|
-
"sha256": "
|
|
5
|
+
"version": "1.8.1",
|
|
6
|
+
"sha256": "81a8bc516f5ab9b2f79380ff78a819a99af72749e38124f9594996261522d2de"
|
|
7
7
|
}
|
|
@@ -55,6 +55,7 @@ Quick setup when the tools are missing: the app registers `@payloadcms/plugin-mc
|
|
|
55
55
|
- Use `:::tabs` only for truly parallel alternatives such as package managers or framework variants.
|
|
56
56
|
- Use `:::details` for optional caveats, migration notes, or advanced branches.
|
|
57
57
|
- Use `:::section`, `:::2col`, `:::3col`, and `:::cell` sparingly for dense landing-style docs sections.
|
|
58
|
+
- Colour icons and directives with named palettes (`palette=`, `iconPalette=`, `@pack/icon palette=name`), never CSS.
|
|
58
59
|
- Avoid unsupported directives, MDX components, arbitrary HTML widgets, and runtime Tailwind classes in authored Markdown.
|
|
59
60
|
|
|
60
61
|
## Examples
|
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
{
|
|
112
112
|
"name": "section",
|
|
113
113
|
"attributes": [
|
|
114
|
+
{
|
|
115
|
+
"name": "palette",
|
|
116
|
+
"type": "string",
|
|
117
|
+
"format": "palette"
|
|
118
|
+
},
|
|
114
119
|
{
|
|
115
120
|
"name": "theme",
|
|
116
121
|
"type": "string",
|
|
@@ -206,6 +211,11 @@
|
|
|
206
211
|
"type": "string",
|
|
207
212
|
"format": "icon"
|
|
208
213
|
},
|
|
214
|
+
{
|
|
215
|
+
"name": "iconPalette",
|
|
216
|
+
"type": "string",
|
|
217
|
+
"format": "palette"
|
|
218
|
+
},
|
|
209
219
|
{
|
|
210
220
|
"name": "iconPosition",
|
|
211
221
|
"default": "left",
|
|
@@ -224,6 +234,11 @@
|
|
|
224
234
|
"false"
|
|
225
235
|
]
|
|
226
236
|
},
|
|
237
|
+
{
|
|
238
|
+
"name": "palette",
|
|
239
|
+
"type": "string",
|
|
240
|
+
"format": "palette"
|
|
241
|
+
},
|
|
227
242
|
{
|
|
228
243
|
"name": "size",
|
|
229
244
|
"default": "md",
|
|
@@ -470,6 +485,16 @@
|
|
|
470
485
|
"type": "string",
|
|
471
486
|
"format": "icon"
|
|
472
487
|
},
|
|
488
|
+
{
|
|
489
|
+
"name": "iconPalette",
|
|
490
|
+
"type": "string",
|
|
491
|
+
"format": "palette"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "palette",
|
|
495
|
+
"type": "string",
|
|
496
|
+
"format": "palette"
|
|
497
|
+
},
|
|
473
498
|
{
|
|
474
499
|
"name": "theme",
|
|
475
500
|
"type": "string",
|
|
@@ -514,6 +539,11 @@
|
|
|
514
539
|
"false"
|
|
515
540
|
]
|
|
516
541
|
},
|
|
542
|
+
{
|
|
543
|
+
"name": "palette",
|
|
544
|
+
"type": "string",
|
|
545
|
+
"format": "palette"
|
|
546
|
+
},
|
|
517
547
|
{
|
|
518
548
|
"name": "theme",
|
|
519
549
|
"type": "string",
|
|
@@ -596,6 +626,11 @@
|
|
|
596
626
|
"false"
|
|
597
627
|
]
|
|
598
628
|
},
|
|
629
|
+
{
|
|
630
|
+
"name": "palette",
|
|
631
|
+
"type": "string",
|
|
632
|
+
"format": "palette"
|
|
633
|
+
},
|
|
599
634
|
{
|
|
600
635
|
"name": "stepTheme",
|
|
601
636
|
"type": "string",
|
|
@@ -648,6 +683,11 @@
|
|
|
648
683
|
"name": "href",
|
|
649
684
|
"type": "url"
|
|
650
685
|
},
|
|
686
|
+
{
|
|
687
|
+
"name": "iconPalette",
|
|
688
|
+
"type": "string",
|
|
689
|
+
"format": "palette"
|
|
690
|
+
},
|
|
651
691
|
{
|
|
652
692
|
"name": "linkScope",
|
|
653
693
|
"default": "section",
|
|
@@ -667,6 +707,11 @@
|
|
|
667
707
|
"false"
|
|
668
708
|
]
|
|
669
709
|
},
|
|
710
|
+
{
|
|
711
|
+
"name": "palette",
|
|
712
|
+
"type": "string",
|
|
713
|
+
"format": "palette"
|
|
714
|
+
},
|
|
670
715
|
{
|
|
671
716
|
"name": "theme",
|
|
672
717
|
"type": "string",
|
|
@@ -698,6 +743,11 @@
|
|
|
698
743
|
"type": "string",
|
|
699
744
|
"format": "icon"
|
|
700
745
|
},
|
|
746
|
+
{
|
|
747
|
+
"name": "iconPalette",
|
|
748
|
+
"type": "string",
|
|
749
|
+
"format": "palette"
|
|
750
|
+
},
|
|
701
751
|
{
|
|
702
752
|
"name": "linkScope",
|
|
703
753
|
"default": "full",
|
|
@@ -716,6 +766,11 @@
|
|
|
716
766
|
"false"
|
|
717
767
|
]
|
|
718
768
|
},
|
|
769
|
+
{
|
|
770
|
+
"name": "palette",
|
|
771
|
+
"type": "string",
|
|
772
|
+
"format": "palette"
|
|
773
|
+
},
|
|
719
774
|
{
|
|
720
775
|
"name": "theme",
|
|
721
776
|
"type": "string",
|
|
@@ -743,6 +798,11 @@
|
|
|
743
798
|
"name": "default",
|
|
744
799
|
"type": "string"
|
|
745
800
|
},
|
|
801
|
+
{
|
|
802
|
+
"name": "palette",
|
|
803
|
+
"type": "string",
|
|
804
|
+
"format": "palette"
|
|
805
|
+
},
|
|
746
806
|
{
|
|
747
807
|
"name": "tabTheme",
|
|
748
808
|
"type": "string",
|
|
@@ -16,6 +16,12 @@ The app needs `@payloadcms/plugin-mcp` registered with `withPayloadMarkdownMcp()
|
|
|
16
16
|
6. Report what changed and share `adminUrl` / `previewUrl`.
|
|
17
17
|
7. `markdownPublish` (or `publish: true`) only when the user explicitly asked for the change to go live.
|
|
18
18
|
|
|
19
|
+
## Palettes
|
|
20
|
+
|
|
21
|
+
- Use palette names from `markdownGuide` or `markdownPalettes` (built-in hues, configured ones, and ones managed in the Markdown Appearance global).
|
|
22
|
+
- When the user wants a colour no palette provides (a brand colour, say) and `markdownPaletteSave` is available, create a palette instead of writing CSS: `{ "palette": { "name": "debian", "label": "Debian", "color": "#a80030", "dark": { "color": "#ff5277" } } }`. Give it a `dark.color` when `contrast` notes say the light colour is too dark for dark mode. Then reference it: `icon="@fa-brands/debian palette=debian"`.
|
|
23
|
+
- Saving a palette changes every page that uses it, live. Edit or delete an existing palette only when the user asked for that.
|
|
24
|
+
|
|
19
25
|
## Edits
|
|
20
26
|
|
|
21
27
|
- `{ "action": "replace", "target": "<ref>", "markdown": "…" }` replaces a markdown field or block.
|
|
@@ -31,6 +37,7 @@ Each markdown block renders on its own: a directive opened in one block must clo
|
|
|
31
37
|
- `locked`: someone has it open. Ask the user before retrying with `overrideLock: true`.
|
|
32
38
|
- `forbidden`: the API key or user lacks access. Tell the user which collection needs `Find` or `Update` on the key.
|
|
33
39
|
- `no_drafts`: the collection has no drafts, so writes are already live. Tell the user before writing.
|
|
40
|
+
- `invalid_palette`: a colour or name was rejected; `details.errors` says which. `not_enabled`: the site has no runtime palettes (the developer must add `appearance: true`).
|
|
34
41
|
|
|
35
42
|
## Rules
|
|
36
43
|
|
|
@@ -43,6 +43,24 @@ Install, configure, ship.
|
|
|
43
43
|
- `:::3col`
|
|
44
44
|
- `:::cell`
|
|
45
45
|
|
|
46
|
+
## Colour Palettes
|
|
47
|
+
|
|
48
|
+
Palettes are named colour themes. Use them to colour icons and recolour directives; never write CSS or Tailwind classes for colour.
|
|
49
|
+
|
|
50
|
+
- One icon: `icon="@pack/name palette=ubuntu"`. In a list, each entry carries its own palette, so order never swaps colours: `icon="@fa-brands/debian palette=debian, @fa-brands/ubuntu palette=ubuntu"`.
|
|
51
|
+
- `iconPalette="name"`: default for a directive's icons without their own (`card`, `cards`, `callout`, `button`).
|
|
52
|
+
- `palette="name"`: surface, border and link accent of `card`, `cards`, `callout`, `button`, `details`, `section`, `steps` or `tabs`, and the default for their icons. It combines with `theme`.
|
|
53
|
+
- Built-in palettes: every Tailwind hue (`red`, `orange`, `amber`, `emerald`, `teal`, `sky`, `violet`, `slate`, …). Sites can add more in code or in the Markdown Appearance global; `markdownGuide` and `markdownPalettes` list the real names.
|
|
54
|
+
|
|
55
|
+
```md
|
|
56
|
+
:::card[Linux]{
|
|
57
|
+
icon="@fa-brands/debian palette=debian, @fa-brands/ubuntu palette=ubuntu"
|
|
58
|
+
theme="glass"
|
|
59
|
+
}
|
|
60
|
+
Debian and Ubuntu support.
|
|
61
|
+
:::
|
|
62
|
+
```
|
|
63
|
+
|
|
46
64
|
## Callouts
|
|
47
65
|
|
|
48
66
|
Use callouts for information that changes how the reader should interpret or execute a task.
|
|
@@ -51,7 +69,8 @@ Attributes:
|
|
|
51
69
|
|
|
52
70
|
- `variant`: `note`, `info`, `tip`, `warning`, `danger`, or `success`
|
|
53
71
|
- `theme`: `soft`, `solid`, `glass`, or a configured theme
|
|
54
|
-
- `icon`: local icon reference
|
|
72
|
+
- `icon`: local icon reference, optionally `palette=<name>` after it
|
|
73
|
+
- `palette`, `iconPalette`: colour palettes (see Colour Palettes)
|
|
55
74
|
- `[Label]` or legacy `title`
|
|
56
75
|
|
|
57
76
|
```md
|
|
@@ -173,8 +192,9 @@ Use button links for clear actions. Do not use snippet-only names such as `::but
|
|
|
173
192
|
- `href`: required
|
|
174
193
|
- `variant`: `primary`, `secondary`, `outline`, `ghost`, or `link`
|
|
175
194
|
- `size`: `sm`, `md`, or `lg`
|
|
176
|
-
- `icon`: local icon reference
|
|
195
|
+
- `icon`: local icon reference, optionally `palette=<name>` after it
|
|
177
196
|
- `iconPosition`: `left` or `right`
|
|
197
|
+
- `palette`: button fill, label and border colours; `iconPalette` for the icon
|
|
178
198
|
- `newTab`
|
|
179
199
|
- `ariaLabel` for icon-only buttons
|
|
180
200
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"name": "payload-markdown",
|
|
3
3
|
"package": "@valkyrianlabs/payload-markdown",
|
|
4
4
|
"variant": "codex",
|
|
5
|
-
"version": "1.8.
|
|
6
|
-
"sha256": "
|
|
5
|
+
"version": "1.8.1",
|
|
6
|
+
"sha256": "24846ebf2d452d74866384f248d15c0fac38241592139d0e393fdcc2bfa77521"
|
|
7
7
|
}
|