@mvriu5/payload-ai 0.5.6 → 0.5.9
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 +52 -5
- package/dist/ai/providerOptions.d.ts +1 -14
- package/dist/ai/providerOptions.js +0 -23
- package/dist/ai/providerRuntime.d.ts +3 -2
- package/dist/ai/providerRuntime.js +6 -15
- package/dist/components/AIActionProposalList.d.ts +2 -1
- package/dist/components/AIActionProposalList.js +74 -6
- package/dist/components/AIActionProposalList.module.css +49 -5
- package/dist/components/AIApiKeyField.js +0 -8
- package/dist/components/AIInput.d.ts +1 -1
- package/dist/components/AIInput.js +156 -23
- package/dist/components/AIInput.module.css +185 -147
- package/dist/components/CollectionMentionPopover.d.ts +1 -1
- package/dist/components/DiffDialog.d.ts +12 -0
- package/dist/components/DiffDialog.js +310 -0
- package/dist/components/DiffDialog.module.css +249 -0
- package/dist/components/Icons.d.ts +9 -0
- package/dist/components/Icons.js +266 -0
- package/dist/components/RecentChangesList.d.ts +18 -0
- package/dist/components/RecentChangesList.js +66 -0
- package/dist/components/RecentChangesList.module.css +135 -0
- package/dist/components/hooks/useAISettings.d.ts +1 -1
- package/dist/endpoints/aiApplyActionEndpointHandler.d.ts +3 -1
- package/dist/endpoints/aiApplyActionEndpointHandler.js +209 -8
- package/dist/endpoints/aiChatEndpointHandler.d.ts +5 -1
- package/dist/endpoints/aiChatEndpointHandler.js +106 -21
- package/dist/endpoints/aiMentionSuggestionsEndpointHandler.d.ts +2 -1
- package/dist/endpoints/aiMentionSuggestionsEndpointHandler.js +7 -7
- package/dist/endpoints/aiProposalDiffEndpointHandler.d.ts +7 -0
- package/dist/endpoints/aiProposalDiffEndpointHandler.js +138 -0
- package/dist/endpoints/aiRecentChangesEndpointHandler.d.ts +6 -0
- package/dist/endpoints/aiRecentChangesEndpointHandler.js +35 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +140 -18
- package/dist/payload/collectionPermissions.d.ts +22 -0
- package/dist/payload/collectionPermissions.js +68 -0
- package/dist/payload/schemaContext.d.ts +46 -2
- package/dist/payload/schemaContext.js +105 -14
- package/package.json +113 -121
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
export function MistralAiIcon(props) {
|
|
2
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
viewBox: "0 0 256 233",
|
|
5
|
+
...props
|
|
6
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
7
|
+
d: "M186.182 0h46.545v46.545h-46.545z"
|
|
8
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
9
|
+
fill: "#f7d046",
|
|
10
|
+
d: "M209.455 0H256v46.545h-46.545z"
|
|
11
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
12
|
+
d: "M0 0h46.545v46.545H0zm0 46.545h46.545V93.09H0zm0 46.546h46.545v46.545H0zm0 46.545h46.545v46.545H0zm0 46.546h46.545v46.545H0z"
|
|
13
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
14
|
+
fill: "#f7d046",
|
|
15
|
+
d: "M23.273 0h46.545v46.545H23.273z"
|
|
16
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
17
|
+
fill: "#f2a73b",
|
|
18
|
+
d: "M209.455 46.545H256V93.09h-46.545zm-186.182 0h46.545V93.09H23.273z"
|
|
19
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
20
|
+
d: "M139.636 46.545h46.545V93.09h-46.545z"
|
|
21
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
22
|
+
fill: "#f2a73b",
|
|
23
|
+
d: "M162.909 46.545h46.545V93.09h-46.545zm-93.091 0h46.545V93.09H69.818z"
|
|
24
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
25
|
+
fill: "#ee792f",
|
|
26
|
+
d: "M116.364 93.091h46.545v46.545h-46.545zm46.545 0h46.545v46.545h-46.545zm-93.091 0h46.545v46.545H69.818z"
|
|
27
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
28
|
+
d: "M93.091 139.636h46.545v46.545H93.091z"
|
|
29
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
30
|
+
fill: "#eb5829",
|
|
31
|
+
d: "M116.364 139.636h46.545v46.545h-46.545z"
|
|
32
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
33
|
+
fill: "#ee792f",
|
|
34
|
+
d: "M209.455 93.091H256v46.545h-46.545zm-186.182 0h46.545v46.545H23.273z"
|
|
35
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
36
|
+
d: "M186.182 139.636h46.545v46.545h-46.545z"
|
|
37
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
38
|
+
fill: "#eb5829",
|
|
39
|
+
d: "M209.455 139.636H256v46.545h-46.545z"
|
|
40
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
41
|
+
d: "M186.182 186.182h46.545v46.545h-46.545z"
|
|
42
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
43
|
+
fill: "#eb5829",
|
|
44
|
+
d: "M23.273 139.636h46.545v46.545H23.273z"
|
|
45
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
46
|
+
fill: "#ea3326",
|
|
47
|
+
d: "M209.455 186.182H256v46.545h-46.545zm-186.182 0h46.545v46.545H23.273z"
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
export function OpenaiIcon(props) {
|
|
51
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
viewBox: "0 0 256 260",
|
|
54
|
+
...props
|
|
55
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
56
|
+
d: "M239.184 106.203a64.72 64.72 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.72 64.72 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.67 64.67 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.77 64.77 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483m-97.56 136.338a48.4 48.4 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.6 8.6 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601M37.158 197.93a48.35 48.35 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.34 8.34 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803M23.549 85.38a48.5 48.5 0 0 1 25.58-21.333v61.39a8.29 8.29 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.82.82 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405zm179.466 41.695l-63.08-36.63L161.73 77.86a.82.82 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.54 8.54 0 0 0-4.4-7.213m21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.72.72 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391zM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.6 8.6 0 0 0-4.246 7.367zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218z"
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
export function ClaudeIcon(props) {
|
|
60
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
61
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
62
|
+
viewBox: "0 0 256 257",
|
|
63
|
+
...props
|
|
64
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
65
|
+
fill: "#d97757",
|
|
66
|
+
d: "m50.228 170.321l50.357-28.257l.843-2.463l-.843-1.361h-2.462l-8.426-.518l-28.775-.778l-24.952-1.037l-24.175-1.296l-6.092-1.297L0 125.796l.583-3.759l5.12-3.434l7.324.648l16.202 1.101l24.304 1.685l17.629 1.037l26.118 2.722h4.148l.583-1.685l-1.426-1.037l-1.101-1.037l-25.147-17.045l-27.22-18.017l-14.258-10.37l-7.713-5.25l-3.888-4.925l-1.685-10.758l7-7.713l9.397.649l2.398.648l9.527 7.323l20.35 15.75L94.817 91.9l3.889 3.24l1.555-1.102l.195-.777l-1.75-2.917l-14.453-26.118l-15.425-26.572l-6.87-11.018l-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0l10.63 1.426l4.472 3.888l6.61 15.101l10.694 23.786l16.591 32.34l4.861 9.592l2.592 8.879l.973 2.722h1.685v-1.556l1.36-18.211l2.528-22.36l2.463-28.776l.843-8.1l4.018-9.722l7.971-5.25l6.222 2.981l5.12 7.324l-.713 4.73l-3.046 19.768l-5.962 30.98l-3.889 20.739h2.268l2.593-2.593l10.499-13.934l17.628-22.036l7.778-8.749l9.073-9.657l5.833-4.601h11.018l8.1 12.055l-3.628 12.443l-11.342 14.388l-9.398 12.184l-13.48 18.147l-8.426 14.518l.778 1.166l2.01-.194l30.46-6.481l16.462-2.982l19.637-3.37l8.88 4.148l.971 4.213l-3.5 8.62l-20.998 5.184l-24.628 4.926l-36.682 8.685l-.454.324l.519.648l16.526 1.555l7.065.389h17.304l32.21 2.398l8.426 5.574l5.055 6.805l-.843 5.184l-12.962 6.611l-17.498-4.148l-40.83-9.721l-14-3.5h-1.944v1.167l11.666 11.406l21.387 19.314l26.767 24.887l1.36 6.157l-3.434 4.86l-3.63-.518l-23.526-17.693l-9.073-7.972l-20.545-17.304h-1.36v1.814l4.73 6.935l25.017 37.59l1.296 11.536l-1.814 3.76l-6.481 2.268l-7.13-1.297l-14.647-20.544l-15.1-23.138l-12.185-20.739l-1.49.843l-7.194 77.448l-3.37 3.953l-7.778 2.981l-6.48-4.925l-3.436-7.972l3.435-15.749l4.148-20.544l3.37-16.333l3.046-20.285l1.815-6.74l-.13-.454l-1.49.194l-15.295 20.999l-23.267 31.433l-18.406 19.702l-4.407 1.75l-7.648-3.954l.713-7.064l4.277-6.286l25.47-32.405l15.36-20.092l9.917-11.6l-.065-1.686h-.583L44.07 198.125l-12.055 1.555l-5.185-4.86l.648-7.972l2.463-2.593l20.35-13.999z"
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
export function GoogleGeminiIcon(props) {
|
|
70
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
71
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72
|
+
viewBox: "0 0 512 188",
|
|
73
|
+
...props
|
|
74
|
+
}, /*#__PURE__*/ React.createElement("defs", null, /*#__PURE__*/ React.createElement("radialGradient", {
|
|
75
|
+
id: "SVGPMo0zqwk",
|
|
76
|
+
cx: "85.738%",
|
|
77
|
+
cy: "25.354%",
|
|
78
|
+
r: "103.154%",
|
|
79
|
+
fx: "85.738%",
|
|
80
|
+
fy: "25.354%",
|
|
81
|
+
gradientTransform: "matrix(-.86887 .47915 -.39276 -.66723 1.702 .012)"
|
|
82
|
+
}, /*#__PURE__*/ React.createElement("stop", {
|
|
83
|
+
offset: "0%",
|
|
84
|
+
stopColor: "#5baeff"
|
|
85
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
86
|
+
offset: "100%",
|
|
87
|
+
stopColor: "#9cbfff"
|
|
88
|
+
})), /*#__PURE__*/ React.createElement("radialGradient", {
|
|
89
|
+
id: "SVG6LOdsc2X",
|
|
90
|
+
cx: "61.879%",
|
|
91
|
+
cy: "26.683%",
|
|
92
|
+
r: "80.612%",
|
|
93
|
+
fx: "61.879%",
|
|
94
|
+
fy: "26.683%",
|
|
95
|
+
gradientTransform: "matrix(-.14736 .90946 -.98908 -.1355 .974 -.26)"
|
|
96
|
+
}, /*#__PURE__*/ React.createElement("stop", {
|
|
97
|
+
offset: "0%",
|
|
98
|
+
stopColor: "#409dff"
|
|
99
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
100
|
+
offset: "100%",
|
|
101
|
+
stopColor: "#64b0ff"
|
|
102
|
+
})), /*#__PURE__*/ React.createElement("radialGradient", {
|
|
103
|
+
id: "SVGRoCRHePI",
|
|
104
|
+
cx: "53.184%",
|
|
105
|
+
cy: "19.021%",
|
|
106
|
+
r: "110.789%",
|
|
107
|
+
fx: "53.184%",
|
|
108
|
+
fy: "19.021%",
|
|
109
|
+
gradientTransform: "matrix(-.16226 .97112 -.66046 -.23858 .744 -.28)"
|
|
110
|
+
}, /*#__PURE__*/ React.createElement("stop", {
|
|
111
|
+
offset: "0%",
|
|
112
|
+
stopColor: "#177cff"
|
|
113
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
114
|
+
offset: "100%",
|
|
115
|
+
stopColor: "#4da4ff"
|
|
116
|
+
})), /*#__PURE__*/ React.createElement("radialGradient", {
|
|
117
|
+
id: "SVG8W8bkc7G",
|
|
118
|
+
cx: "-182.665%",
|
|
119
|
+
cy: "10.869%",
|
|
120
|
+
r: "521.404%",
|
|
121
|
+
fx: "-182.665%",
|
|
122
|
+
fy: "10.869%",
|
|
123
|
+
gradientTransform: "matrix(.41608 .16332 -.90933 .07473 -.968 .399)"
|
|
124
|
+
}, /*#__PURE__*/ React.createElement("stop", {
|
|
125
|
+
offset: "0%",
|
|
126
|
+
stopColor: "#1c7aff"
|
|
127
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
128
|
+
offset: "100%",
|
|
129
|
+
stopColor: "#76a9ff"
|
|
130
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
131
|
+
offset: "100%",
|
|
132
|
+
stopColor: "#8fb9ff"
|
|
133
|
+
})), /*#__PURE__*/ React.createElement("linearGradient", {
|
|
134
|
+
id: "SVGKvzpwcOj",
|
|
135
|
+
x1: "48.887%",
|
|
136
|
+
x2: "48.887%",
|
|
137
|
+
y1: "8.809%",
|
|
138
|
+
y2: "100%"
|
|
139
|
+
}, /*#__PURE__*/ React.createElement("stop", {
|
|
140
|
+
offset: "0%",
|
|
141
|
+
stopColor: "#076eff"
|
|
142
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
143
|
+
offset: "100%",
|
|
144
|
+
stopColor: "#3e93ff"
|
|
145
|
+
})), /*#__PURE__*/ React.createElement("linearGradient", {
|
|
146
|
+
id: "SVGaWXYB1Pi",
|
|
147
|
+
x1: "13.217%",
|
|
148
|
+
x2: "78.598%",
|
|
149
|
+
y1: "0%",
|
|
150
|
+
y2: "94.201%"
|
|
151
|
+
}, /*#__PURE__*/ React.createElement("stop", {
|
|
152
|
+
offset: "0%",
|
|
153
|
+
stopColor: "#076eff"
|
|
154
|
+
}), /*#__PURE__*/ React.createElement("stop", {
|
|
155
|
+
offset: "100%",
|
|
156
|
+
stopColor: "#69a3ff"
|
|
157
|
+
}))), /*#__PURE__*/ React.createElement("path", {
|
|
158
|
+
fill: "url(#SVGPMo0zqwk)",
|
|
159
|
+
d: "M125.939 126.64q0 26.094-15.482 41.575q-17.395 18.438-45.748 18.438q-27.135 0-45.923-18.786Q0 149.08 0 121.597q0-27.485 18.786-46.27Q37.573 56.54 64.71 56.54q13.741 0 25.918 4.87t20.004 13.742l-11.48 11.48q-5.74-6.957-14.873-10.871t-19.57-3.914q-20.351 0-34.441 14.09q-13.916 14.264-13.916 35.66t13.916 35.659q14.09 14.09 34.442 14.09q18.613 0 30.963-10.437t14.263-28.702H64.71v-14.96h60.36q.87 4.872.87 9.394"
|
|
160
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
161
|
+
fill: "url(#SVG6LOdsc2X)",
|
|
162
|
+
d: "M176.17 96.205q19.152 0 30.485 12.387q11.334 12.388 11.334 34.703l-.176 1.757h-67.648q.352 12.651 8.434 20.382q8.083 7.73 19.328 7.73q15.462 0 24.248-15.461l14.408 7.028q-5.799 10.894-16.077 17.044t-23.282 6.15q-18.976 0-31.276-13.003t-12.299-32.857q0-19.68 11.948-32.77t30.573-13.09m-.351 14.76q-9.137 0-15.726 5.622q-6.59 5.623-8.698 15.11h49.374q-.702-8.96-7.292-14.846t-17.658-5.887"
|
|
163
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
164
|
+
fill: "url(#SVGRoCRHePI)",
|
|
165
|
+
d: "M244.493 184.843h-16.116V99.008h15.416v11.912h.7q3.68-6.306 11.299-10.51q7.62-4.206 15.153-4.205q9.459 0 16.641 4.38q7.182 4.379 10.51 12.086q10.687-16.466 29.605-16.466q14.89 0 22.948 9.11q8.058 9.108 8.058 25.925v53.603h-16.116v-51.15q0-12.088-4.38-17.43q-4.379-5.343-14.714-5.343q-9.285 0-15.59 7.883q-6.307 7.882-6.307 18.568v47.472h-16.116v-51.15q0-12.088-4.38-17.43q-4.379-5.343-14.714-5.343q-9.285 0-15.59 7.883q-6.307 7.882-6.307 18.568z"
|
|
166
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
167
|
+
fill: "url(#SVGKvzpwcOj)",
|
|
168
|
+
d: "M393.263 69.216q0 4.737-3.334 8.07q-3.334 3.335-8.071 3.335t-8.071-3.334t-3.334-8.071q0-4.738 3.334-8.071q3.334-3.334 8.07-3.334q4.74 0 8.072 3.334q3.334 3.334 3.334 8.07m-3.334 29.652v85.975h-16.142V98.868z"
|
|
169
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
170
|
+
fill: "url(#SVG8W8bkc7G)",
|
|
171
|
+
d: "M512 69.216q0 4.737-3.334 8.07q-3.334 3.335-8.07 3.335q-4.74 0-8.072-3.334q-3.333-3.334-3.334-8.071q0-4.738 3.334-8.071q3.334-3.334 8.071-3.334t8.071 3.334t3.334 8.07m-3.334 29.652v85.975h-16.142V98.868z"
|
|
172
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
173
|
+
fill: "url(#SVGaWXYB1Pi)",
|
|
174
|
+
d: "M404.004 99.008h15.415v11.912h.7q3.68-6.306 11.3-10.51q7.62-4.206 15.853-4.205q15.765 0 24.261 9.022q8.496 9.02 8.496 25.663v53.953h-16.116v-52.902q-.526-21.021-21.196-21.021q-9.634 0-16.116 7.795t-6.481 18.656v47.472h-16.116z"
|
|
175
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
176
|
+
fill: "#076eff",
|
|
177
|
+
d: "M348.374 72.76c-2.846-18.788-17.592-33.533-36.38-36.38c18.788-2.847 33.534-17.593 36.38-36.38c2.847 18.787 17.593 33.533 36.38 36.38c-18.787 2.847-33.533 17.592-36.38 36.38"
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
export function FileDiff(props) {
|
|
181
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
182
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
183
|
+
viewBox: "0 0 24 24",
|
|
184
|
+
fill: "none",
|
|
185
|
+
stroke: "currentColor",
|
|
186
|
+
strokeWidth: 2,
|
|
187
|
+
strokeLinecap: "round",
|
|
188
|
+
strokeLinejoin: "round",
|
|
189
|
+
...props
|
|
190
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
191
|
+
stroke: "none",
|
|
192
|
+
d: "M0 0h24v24H0z",
|
|
193
|
+
fill: "none"
|
|
194
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
195
|
+
d: "M14 3v4a1 1 0 0 0 1 1h4"
|
|
196
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
197
|
+
d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2"
|
|
198
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
199
|
+
d: "M12 10l0 4"
|
|
200
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
201
|
+
d: "M10 12l4 0"
|
|
202
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
203
|
+
d: "M10 17l4 0"
|
|
204
|
+
}));
|
|
205
|
+
}
|
|
206
|
+
export function Send(props) {
|
|
207
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
208
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
209
|
+
viewBox: "0 0 24 24",
|
|
210
|
+
fill: "none",
|
|
211
|
+
stroke: "currentColor",
|
|
212
|
+
strokeWidth: 2,
|
|
213
|
+
strokeLinecap: "round",
|
|
214
|
+
strokeLinejoin: "round",
|
|
215
|
+
className: "icon icon-tabler icons-tabler-outline icon-tabler-send",
|
|
216
|
+
...props
|
|
217
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
218
|
+
stroke: "none",
|
|
219
|
+
d: "M0 0h24v24H0z",
|
|
220
|
+
fill: "none"
|
|
221
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
222
|
+
d: "M10 14l11 -11"
|
|
223
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
224
|
+
d: "M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5"
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
export function Apply(props) {
|
|
228
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
229
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
230
|
+
viewBox: "0 0 24 24",
|
|
231
|
+
fill: "none",
|
|
232
|
+
stroke: "currentColor",
|
|
233
|
+
strokeWidth: 2,
|
|
234
|
+
strokeLinecap: "round",
|
|
235
|
+
strokeLinejoin: "round",
|
|
236
|
+
className: "icon icon-tabler icons-tabler-outline icon-tabler-check",
|
|
237
|
+
...props
|
|
238
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
239
|
+
stroke: "none",
|
|
240
|
+
d: "M0 0h24v24H0z",
|
|
241
|
+
fill: "none"
|
|
242
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
243
|
+
d: "M5 12l5 5l10 -10"
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
export function Reject(props) {
|
|
247
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
248
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
249
|
+
viewBox: "0 0 24 24",
|
|
250
|
+
fill: "none",
|
|
251
|
+
stroke: "currentColor",
|
|
252
|
+
strokeWidth: 2,
|
|
253
|
+
strokeLinecap: "round",
|
|
254
|
+
strokeLinejoin: "round",
|
|
255
|
+
className: "icon icon-tabler icons-tabler-outline icon-tabler-x",
|
|
256
|
+
...props
|
|
257
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
258
|
+
stroke: "none",
|
|
259
|
+
d: "M0 0h24v24H0z",
|
|
260
|
+
fill: "none"
|
|
261
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
262
|
+
d: "M18 6l-12 12"
|
|
263
|
+
}), /*#__PURE__*/ React.createElement("path", {
|
|
264
|
+
d: "M6 6l12 12"
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AIActionProposal } from "./AIActionProposalList.js";
|
|
2
|
+
export type AppliedChange = {
|
|
3
|
+
action?: AIActionProposal["action"] | null;
|
|
4
|
+
additions: number;
|
|
5
|
+
after?: unknown;
|
|
6
|
+
before?: unknown;
|
|
7
|
+
collection?: string | null;
|
|
8
|
+
documentID?: string | null;
|
|
9
|
+
removals: number;
|
|
10
|
+
slug?: string | null;
|
|
11
|
+
title: string;
|
|
12
|
+
url?: string | null;
|
|
13
|
+
};
|
|
14
|
+
type RecentChangesListProps = {
|
|
15
|
+
changes: AppliedChange[];
|
|
16
|
+
};
|
|
17
|
+
export declare const RecentChangesList: ({ changes }: RecentChangesListProps) => import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { DiffDialog } from "./DiffDialog.js";
|
|
3
|
+
import { FileDiff } from "./Icons.js";
|
|
4
|
+
import styles from "./RecentChangesList.module.css";
|
|
5
|
+
import { ExternalLinkIcon } from "@payloadcms/ui";
|
|
6
|
+
const getChangeProposal = (change)=>({
|
|
7
|
+
action: change.action || "update",
|
|
8
|
+
collection: change.collection || undefined,
|
|
9
|
+
id: change.documentID || undefined,
|
|
10
|
+
label: change.title,
|
|
11
|
+
slug: change.slug || undefined
|
|
12
|
+
});
|
|
13
|
+
export const RecentChangesList = ({ changes })=>{
|
|
14
|
+
const [activeDiff, setActiveDiff] = useState(null);
|
|
15
|
+
return /*#__PURE__*/ React.createElement("aside", {
|
|
16
|
+
className: styles.recentChanges
|
|
17
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
18
|
+
className: styles.header
|
|
19
|
+
}, /*#__PURE__*/ React.createElement("h3", {
|
|
20
|
+
className: styles.title
|
|
21
|
+
}, "Recent changes")), /*#__PURE__*/ React.createElement("div", {
|
|
22
|
+
className: styles.list
|
|
23
|
+
}, changes.length === 0 ? /*#__PURE__*/ React.createElement("div", {
|
|
24
|
+
className: styles.empty
|
|
25
|
+
}, "No changes yet.") : changes.map((change, index)=>/*#__PURE__*/ React.createElement("div", {
|
|
26
|
+
className: styles.item,
|
|
27
|
+
key: `${change.title}-${index}`
|
|
28
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
29
|
+
className: styles.titleRow
|
|
30
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
31
|
+
className: styles.itemTitle
|
|
32
|
+
}, change.title), change.url ? /*#__PURE__*/ React.createElement("a", {
|
|
33
|
+
className: styles.ghostButton,
|
|
34
|
+
href: change.url,
|
|
35
|
+
rel: "noreferrer noopener",
|
|
36
|
+
target: "_blank"
|
|
37
|
+
}, /*#__PURE__*/ React.createElement(ExternalLinkIcon, null)) : null), /*#__PURE__*/ React.createElement("div", {
|
|
38
|
+
className: styles.stats
|
|
39
|
+
}, /*#__PURE__*/ React.createElement("code", {
|
|
40
|
+
className: styles.additions
|
|
41
|
+
}, "+", change.additions), /*#__PURE__*/ React.createElement("code", {
|
|
42
|
+
className: styles.removals
|
|
43
|
+
}, "-", change.removals)), /*#__PURE__*/ React.createElement("button", {
|
|
44
|
+
className: styles.button,
|
|
45
|
+
onClick: ()=>{
|
|
46
|
+
if (change.before === undefined || change.after === undefined) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setActiveDiff({
|
|
50
|
+
diff: {
|
|
51
|
+
after: change.after,
|
|
52
|
+
before: change.before
|
|
53
|
+
},
|
|
54
|
+
proposal: getChangeProposal(change)
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
type: "button"
|
|
58
|
+
}, /*#__PURE__*/ React.createElement(FileDiff, {
|
|
59
|
+
height: 16,
|
|
60
|
+
width: 16
|
|
61
|
+
}), "Review")))), activeDiff ? /*#__PURE__*/ React.createElement(DiffDialog, {
|
|
62
|
+
diff: activeDiff.diff,
|
|
63
|
+
onClose: ()=>setActiveDiff(null),
|
|
64
|
+
proposal: activeDiff.proposal
|
|
65
|
+
}) : null);
|
|
66
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
.recentChanges {
|
|
2
|
+
border: 1px solid var(--theme-elevation-150);
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
min-height: 0;
|
|
7
|
+
padding: 16px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.header {
|
|
11
|
+
flex: 0 0 auto;
|
|
12
|
+
margin-bottom: 10px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.title {
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
line-height: 1.3;
|
|
18
|
+
margin: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.list {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex: 1 1 auto;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 8px;
|
|
26
|
+
max-height: 260px;
|
|
27
|
+
min-height: 0;
|
|
28
|
+
overflow: auto;
|
|
29
|
+
padding-right: 2px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.empty {
|
|
33
|
+
color: var(--theme-elevation-500);
|
|
34
|
+
font-size: 12px;
|
|
35
|
+
line-height: 1.4;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.item {
|
|
39
|
+
align-items: center;
|
|
40
|
+
border: 1px solid var(--theme-elevation-100);
|
|
41
|
+
border-radius: 4px;
|
|
42
|
+
display: grid;
|
|
43
|
+
gap: 8px;
|
|
44
|
+
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
45
|
+
padding: 10px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.titleRow {
|
|
49
|
+
align-items: center;
|
|
50
|
+
display: flex;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.itemTitle {
|
|
56
|
+
color: var(--theme-text);
|
|
57
|
+
flex: 0 1 auto;
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
line-height: 1.4;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.stats {
|
|
68
|
+
display: flex;
|
|
69
|
+
gap: 6px;
|
|
70
|
+
justify-content: flex-end;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.additions,
|
|
74
|
+
.removals {
|
|
75
|
+
border-radius: 3px;
|
|
76
|
+
font-size: 11px;
|
|
77
|
+
line-height: 18px;
|
|
78
|
+
padding: 0 5px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.additions {
|
|
82
|
+
background: rgba(39, 132, 90, 0.16);
|
|
83
|
+
color: #27845a;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.removals {
|
|
87
|
+
background: rgba(160, 26, 26, 0.16);
|
|
88
|
+
color: #a01a1a;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.button {
|
|
92
|
+
align-items: center;
|
|
93
|
+
background: var(--theme-elevation-0);
|
|
94
|
+
border: 1px solid var(--theme-elevation-150);
|
|
95
|
+
border-radius: 4px;
|
|
96
|
+
color: var(--theme-text);
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
gap: 6px;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
line-height: 24px;
|
|
103
|
+
min-height: 24px;
|
|
104
|
+
padding: 0 10px;
|
|
105
|
+
text-align: center;
|
|
106
|
+
text-decoration: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.button:disabled {
|
|
110
|
+
color: var(--theme-elevation-400);
|
|
111
|
+
cursor: not-allowed;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.button svg {
|
|
115
|
+
color: var(--theme-elevation-500);
|
|
116
|
+
flex: 0 0 auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ghostButton {
|
|
120
|
+
color: var(--theme-elevation-500);
|
|
121
|
+
flex: 0 0 auto;
|
|
122
|
+
font-size: 12px;
|
|
123
|
+
line-height: 18px;
|
|
124
|
+
text-decoration: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ghostButton:hover {
|
|
128
|
+
text-decoration: underline;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (max-width: 768px) {
|
|
132
|
+
.list {
|
|
133
|
+
max-height: 220px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -6,5 +6,5 @@ export declare const useAISettings: ({ adminUserSlug, apiRoute, defaultModels, }
|
|
|
6
6
|
}) => {
|
|
7
7
|
selectedModel: string;
|
|
8
8
|
setSelectedModel: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
9
|
-
settingsProvider: "claude" | "google" | "
|
|
9
|
+
settingsProvider: "claude" | "google" | "mistral" | "openai" | null;
|
|
10
10
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PayloadHandler } from "payload";
|
|
2
|
+
import { type ResolvedAICollectionPermissionMap } from "../payload/collectionPermissions.js";
|
|
2
3
|
type AIApplyActionEndpointOptions = {
|
|
3
|
-
|
|
4
|
+
changeLogCollection?: string;
|
|
5
|
+
collections?: ResolvedAICollectionPermissionMap;
|
|
4
6
|
};
|
|
5
7
|
export declare const createAIApplyActionEndpointHandler: (options?: AIApplyActionEndpointOptions) => PayloadHandler;
|
|
6
8
|
export {};
|