Skip to content

Commit 51853fa

Browse files
committed
feat: add payload color plugin & updated ai plugin
1 parent b51abdc commit 51853fa

30 files changed

Lines changed: 1449 additions & 1368 deletions

package-lock.json

Lines changed: 62 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
"@c15t/scripts": "^2.1.0",
2727
"@code0-tech/pictor": "^0.13.1",
2828
"@icons-pack/react-simple-icons": "^13.13.0",
29-
"@mvriu5/payload-ai": "^1.3.2",
29+
"@mvriu5/payload-ai": "^1.4.0",
30+
"@mvriu5/payload-color-picker": "^1.0.2",
3031
"@mvriu5/payload-icon-picker": "^1.1.1",
3132
"@number-flow/react": "^0.6.1",
32-
"@openrouter/ai-sdk-provider": "^2.10.0",
33+
"@openrouter/ai-sdk-provider": "^3.0.0",
3334
"@payloadcms/db-postgres": "3.86.0",
3435
"@payloadcms/email-nodemailer": "3.86.0",
3536
"@payloadcms/next": "3.86.0",

src/app/(payload)/admin/importMap.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/blocks/ActionEventsBlock.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,27 @@ export const ActionEventsBlock: Block = {
99
label: "Section",
1010
fields: [
1111
{ name: "sectionHeading", label: "Section Heading", type: "text", required: false, localized: true },
12-
{ name: "sectionLayout", label: "Section Layout", type: "select", required: true, defaultValue: "left", options: [{ label: "Center", value: "center" }, { label: "Left", value: "left" }] },
12+
{
13+
name: "sectionLayout",
14+
label: "Section Layout",
15+
type: "select",
16+
required: true,
17+
defaultValue: "left",
18+
options: [
19+
{ label: "Center", value: "center" },
20+
{ label: "Left", value: "left" },
21+
],
22+
},
1323
{ name: "sectionDescription", label: "Section Description", type: "textarea", required: false, localized: true },
14-
{ name: "sectionLinkButton", label: "Section Link Button", type: "group", fields: [{ name: "label", type: "text", required: false, localized: true }, { name: "url", type: "text", required: false }] },
24+
{
25+
name: "sectionLinkButton",
26+
label: "Section Link Button",
27+
type: "group",
28+
fields: [
29+
{ name: "label", type: "text", required: false, localized: true },
30+
{ name: "url", type: "text", required: false },
31+
],
32+
},
1533
],
1634
},
1735
],

src/blocks/ActionFunctionsBlock.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,27 @@ export const ActionFunctionsBlock: Block = {
99
label: "Section",
1010
fields: [
1111
{ name: "sectionHeading", label: "Section Heading", type: "text", required: false, localized: true },
12-
{ name: "sectionLayout", label: "Section Layout", type: "select", required: true, defaultValue: "left", options: [{ label: "Center", value: "center" }, { label: "Left", value: "left" }] },
12+
{
13+
name: "sectionLayout",
14+
label: "Section Layout",
15+
type: "select",
16+
required: true,
17+
defaultValue: "left",
18+
options: [
19+
{ label: "Center", value: "center" },
20+
{ label: "Left", value: "left" },
21+
],
22+
},
1323
{ name: "sectionDescription", label: "Section Description", type: "textarea", required: false, localized: true },
14-
{ name: "sectionLinkButton", label: "Section Link Button", type: "group", fields: [{ name: "label", type: "text", required: false, localized: true }, { name: "url", type: "text", required: false }] },
24+
{
25+
name: "sectionLinkButton",
26+
label: "Section Link Button",
27+
type: "group",
28+
fields: [
29+
{ name: "label", type: "text", required: false, localized: true },
30+
{ name: "url", type: "text", required: false },
31+
],
32+
},
1533
],
1634
},
1735
],

src/blocks/ActionHeroBlock.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { colorField } from "@mvriu5/payload-color-picker"
12
import type { Block } from "payload"
23

34
export const ActionHeroBlock: Block = {
@@ -20,38 +21,34 @@ export const ActionHeroBlock: Block = {
2021
label: "Grainient Colors",
2122
type: "group",
2223
fields: [
23-
{
24+
colorField({
2425
name: "color1",
2526
label: "Fallback Color 1",
26-
type: "text",
2727
required: false,
2828
defaultValue: "#72f896",
2929
admin: {
3030
description: "Used when the action module does not define brandColor1.",
3131
},
32-
},
33-
{
32+
}),
33+
colorField({
3434
name: "color2",
3535
label: "Fallback Color 2",
36-
type: "text",
3736
required: false,
3837
defaultValue: "#7472f8",
3938
admin: {
4039
description: "Used when the action module does not define brandColor2.",
4140
},
42-
},
43-
{
41+
}),
42+
colorField({
4443
name: "color3",
45-
type: "text",
4644
required: false,
4745
defaultValue: "#13102d",
48-
},
49-
{
46+
}),
47+
colorField({
5048
name: "backgroundColor",
51-
type: "text",
5249
required: false,
5350
defaultValue: "#13102d",
54-
},
51+
}),
5552
],
5653
},
5754
{

src/blocks/ActionListBlock.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,27 @@ export const ActionListBlock: Block = {
99
label: "Section",
1010
fields: [
1111
{ name: "sectionHeading", label: "Section Heading", type: "text", required: false, localized: true, defaultValue: "Actions" },
12-
{ name: "sectionLayout", label: "Section Layout", type: "select", required: true, defaultValue: "left", options: [{ label: "Center", value: "center" }, { label: "Left", value: "left" }] },
12+
{
13+
name: "sectionLayout",
14+
label: "Section Layout",
15+
type: "select",
16+
required: true,
17+
defaultValue: "left",
18+
options: [
19+
{ label: "Center", value: "center" },
20+
{ label: "Left", value: "left" },
21+
],
22+
},
1323
{ name: "sectionDescription", label: "Section Description", type: "textarea", required: false, localized: true, defaultValue: "Browse available actions and integrations." },
14-
{ name: "sectionLinkButton", label: "Section Link Button", type: "group", fields: [{ name: "label", type: "text", required: false, localized: true }, { name: "url", type: "text", required: false }] },
24+
{
25+
name: "sectionLinkButton",
26+
label: "Section Link Button",
27+
type: "group",
28+
fields: [
29+
{ name: "label", type: "text", required: false, localized: true },
30+
{ name: "url", type: "text", required: false },
31+
],
32+
},
1533
],
1634
},
1735
{ name: "searchPlaceholder", type: "text", required: true, localized: true, defaultValue: "Search actions" },

0 commit comments

Comments
 (0)