@orion-studios/payload-studio 0.5.0-beta.11 → 0.5.0-beta.110
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 +54 -0
- package/dist/admin/client.d.mts +3 -0
- package/dist/admin/client.d.ts +3 -0
- package/dist/admin/client.js +1745 -200
- package/dist/admin/client.mjs +1756 -214
- package/dist/admin/index.d.mts +2 -1
- package/dist/admin/index.d.ts +2 -1
- package/dist/admin/index.js +424 -11
- package/dist/admin/index.mjs +19 -1
- package/dist/admin-app/client.d.mts +7 -0
- package/dist/admin-app/client.d.ts +7 -0
- package/dist/admin-app/client.js +1262 -3
- package/dist/admin-app/client.mjs +1164 -2
- package/dist/admin-app/index.d.mts +1 -1
- package/dist/admin-app/index.d.ts +1 -1
- package/dist/admin-app/index.js +167 -0
- package/dist/admin-app/index.mjs +13 -1
- package/dist/admin-app/styles.css +247 -0
- package/dist/admin.css +8 -0
- package/dist/blocks/index.js +1011 -191
- package/dist/blocks/index.mjs +2 -2
- package/dist/chunk-ADIIWIYL.mjs +322 -0
- package/dist/{chunk-ZLLNO5FM.mjs → chunk-BET2YLAS.mjs} +104 -15
- package/dist/chunk-DAIZDGHL.mjs +614 -0
- package/dist/chunk-GKMBYYXF.mjs +776 -0
- package/dist/chunk-JQAHXYAM.mjs +1829 -0
- package/dist/chunk-OQSEJXC4.mjs +166 -0
- package/dist/chunk-PF3EBZXF.mjs +326 -0
- package/dist/chunk-ROTPP5CU.mjs +99 -0
- package/dist/chunk-XVH5SCBD.mjs +234 -0
- package/dist/chunk-ZTXJG4K5.mjs +85 -0
- package/dist/index-B7QvY3yF.d.mts +245 -0
- package/dist/index-BK03FiEM.d.ts +245 -0
- package/dist/{index-CmR6NInu.d.ts → index-BzKOThsI.d.mts} +30 -3
- package/dist/{index-CmR6NInu.d.mts → index-BzKOThsI.d.ts} +30 -3
- package/dist/{index-DbH0Ljwp.d.mts → index-D8BNfUJb.d.mts} +17 -2
- package/dist/{index-DbH0Ljwp.d.ts → index-DD_E2UfJ.d.ts} +17 -2
- package/dist/index-DUi_XND6.d.ts +193 -0
- package/dist/index-ZbOx4OCF.d.mts +128 -0
- package/dist/index-ZbOx4OCF.d.ts +128 -0
- package/dist/index-gLl_358v.d.mts +193 -0
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +2876 -460
- package/dist/index.mjs +12 -10
- package/dist/nextjs/index.d.mts +2 -1
- package/dist/nextjs/index.d.ts +2 -1
- package/dist/nextjs/index.js +497 -16
- package/dist/nextjs/index.mjs +8 -3
- package/dist/socialMedia-C05Iy-SV.d.mts +21 -0
- package/dist/socialMedia-C05Iy-SV.d.ts +21 -0
- package/dist/studio/index.d.mts +2 -1
- package/dist/studio/index.d.ts +2 -1
- package/dist/studio/index.js +171 -5
- package/dist/studio/index.mjs +7 -3
- package/dist/studio-pages/builder.css +517 -32
- package/dist/studio-pages/client.d.mts +75 -1
- package/dist/studio-pages/client.d.ts +75 -1
- package/dist/studio-pages/client.js +5662 -2759
- package/dist/studio-pages/client.mjs +5578 -2767
- package/dist/studio-pages/index.d.mts +4 -2
- package/dist/studio-pages/index.d.ts +4 -2
- package/dist/studio-pages/index.js +859 -71
- package/dist/studio-pages/index.mjs +10 -4
- package/package.json +35 -13
- package/dist/chunk-AAOHJDNS.mjs +0 -67
- package/dist/chunk-ETRRXURT.mjs +0 -141
- package/dist/chunk-J7W5EE3B.mjs +0 -278
- package/dist/chunk-N67KVM2S.mjs +0 -156
- package/dist/chunk-NESLJZFE.mjs +0 -303
- package/dist/chunk-U5BSPWAD.mjs +0 -1034
- package/dist/index-B9N5MyjF.d.mts +0 -39
- package/dist/index-BallJs-K.d.mts +0 -43
- package/dist/index-BallJs-K.d.ts +0 -43
- package/dist/index-DJFhANvJ.d.mts +0 -128
- package/dist/index-DJFhANvJ.d.ts +0 -128
- package/dist/index-g8tBHLKD.d.ts +0 -39
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-6BWS3CLP.mjs";
|
|
4
|
+
|
|
5
|
+
// src/admin-app/index.ts
|
|
6
|
+
var admin_app_exports = {};
|
|
7
|
+
__export(admin_app_exports, {
|
|
8
|
+
AdminBreadcrumbs: () => AdminBreadcrumbs,
|
|
9
|
+
AdminPage: () => AdminPage,
|
|
10
|
+
buildAdminPageLinkOptions: () => buildAdminPageLinkOptions,
|
|
11
|
+
buildNestedNavTree: () => buildNestedNavTree,
|
|
12
|
+
getAdminNavRows: () => getAdminNavRows,
|
|
13
|
+
navItemIsActive: () => navItemIsActive,
|
|
14
|
+
normalizeAdminNavInputs: () => normalizeAdminNavInputs,
|
|
15
|
+
normalizeNestedNavItems: () => normalizeNestedNavItems,
|
|
16
|
+
parseAdminHeaderNavFromForm: () => parseAdminHeaderNavFromForm,
|
|
17
|
+
roleCanAccessNav: () => roleCanAccessNav
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// src/admin-app/components/AdminBreadcrumbs.tsx
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
function AdminBreadcrumbs({ items }) {
|
|
23
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", className: "orion-admin-breadcrumbs", children: items.map((item, index) => {
|
|
24
|
+
const isLast = index === items.length - 1;
|
|
25
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
26
|
+
item.href && !isLast ? /* @__PURE__ */ jsx("a", { href: item.href, children: item.label }) : /* @__PURE__ */ jsx("span", { children: item.label }),
|
|
27
|
+
!isLast ? /* @__PURE__ */ jsx("span", { className: "orion-admin-breadcrumb-sep", children: "/" }) : null
|
|
28
|
+
] }, `${item.label}-${index}`);
|
|
29
|
+
}) });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/admin-app/components/AdminPage.tsx
|
|
33
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
34
|
+
function AdminPage({ title, description, breadcrumbs, actions, children }) {
|
|
35
|
+
return /* @__PURE__ */ jsxs2("div", { className: "orion-admin-page", children: [
|
|
36
|
+
/* @__PURE__ */ jsxs2("div", { className: "orion-admin-page-header", children: [
|
|
37
|
+
/* @__PURE__ */ jsx2(AdminBreadcrumbs, { items: breadcrumbs }),
|
|
38
|
+
/* @__PURE__ */ jsxs2("div", { className: "orion-admin-page-title-row", children: [
|
|
39
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
40
|
+
/* @__PURE__ */ jsx2("h1", { children: title }),
|
|
41
|
+
description ? /* @__PURE__ */ jsx2("p", { children: description }) : null
|
|
42
|
+
] }),
|
|
43
|
+
actions ? /* @__PURE__ */ jsx2("div", { className: "orion-admin-page-actions", children: actions }) : null
|
|
44
|
+
] })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsx2("div", { className: "orion-admin-page-content", children })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/admin-app/nestedNavigation.ts
|
|
51
|
+
var normalizeNestedNavItems = (items) => {
|
|
52
|
+
const deduped = [];
|
|
53
|
+
const seen = /* @__PURE__ */ new Set();
|
|
54
|
+
for (const item of items) {
|
|
55
|
+
const href = typeof item.href === "string" ? item.href.trim() : "";
|
|
56
|
+
const label = typeof item.label === "string" ? item.label.trim() : "";
|
|
57
|
+
const parentHref = typeof item.parentHref === "string" ? item.parentHref.trim() : "";
|
|
58
|
+
if (!href || !label || seen.has(href)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
seen.add(href);
|
|
62
|
+
deduped.push({
|
|
63
|
+
href,
|
|
64
|
+
label,
|
|
65
|
+
...parentHref ? { parentHref } : {}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const hrefs = new Set(deduped.map((item) => item.href));
|
|
69
|
+
return deduped.map((item) => ({
|
|
70
|
+
href: item.href,
|
|
71
|
+
label: item.label,
|
|
72
|
+
...item.parentHref && item.parentHref !== item.href && hrefs.has(item.parentHref) ? { parentHref: item.parentHref } : {}
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
var buildNestedNavTree = (items) => {
|
|
76
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
77
|
+
const topLevel = [];
|
|
78
|
+
for (const item of items) {
|
|
79
|
+
if (!item.parentHref) {
|
|
80
|
+
topLevel.push(item);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const children = childrenByParent.get(item.parentHref) || [];
|
|
84
|
+
children.push(item);
|
|
85
|
+
childrenByParent.set(item.parentHref, children);
|
|
86
|
+
}
|
|
87
|
+
if (topLevel.length === 0 && items.length > 0) {
|
|
88
|
+
return {
|
|
89
|
+
topLevel: items.map((item) => ({ href: item.href, label: item.label })),
|
|
90
|
+
childrenByParent: /* @__PURE__ */ new Map()
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return { childrenByParent, topLevel };
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// src/admin-app/navigationLinks.ts
|
|
97
|
+
var fallbackHomeOption = {
|
|
98
|
+
href: "/",
|
|
99
|
+
label: "Home",
|
|
100
|
+
title: "Home"
|
|
101
|
+
};
|
|
102
|
+
var buildAdminPageLinkOptions = (pages) => {
|
|
103
|
+
const options = pages.map((page) => {
|
|
104
|
+
const href = typeof page.path === "string" ? page.path.trim() : "";
|
|
105
|
+
const title = typeof page.title === "string" && page.title.trim().length > 0 ? page.title.trim() : "Untitled Page";
|
|
106
|
+
if (!href) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const depth = href === "/" ? 0 : href.split("/").filter(Boolean).length;
|
|
110
|
+
const indentLevel = Math.max(depth - 1, 0);
|
|
111
|
+
const indent = indentLevel > 0 ? `${"\u21B3 ".repeat(indentLevel)}` : "";
|
|
112
|
+
return {
|
|
113
|
+
href,
|
|
114
|
+
label: `${indent}${title}`,
|
|
115
|
+
title
|
|
116
|
+
};
|
|
117
|
+
}).filter((option) => option !== null).sort((a, b) => {
|
|
118
|
+
if (a.href === "/" && b.href !== "/") return -1;
|
|
119
|
+
if (b.href === "/" && a.href !== "/") return 1;
|
|
120
|
+
return a.href.localeCompare(b.href);
|
|
121
|
+
});
|
|
122
|
+
if (options.length === 0) {
|
|
123
|
+
return [fallbackHomeOption];
|
|
124
|
+
}
|
|
125
|
+
return options;
|
|
126
|
+
};
|
|
127
|
+
var getAdminNavRows = (navItems, pageOptions, minRows = 6, maxRows = 20) => {
|
|
128
|
+
const preferredRows = Math.max(navItems.length + 2, Math.min(8, pageOptions.length));
|
|
129
|
+
return Math.min(Math.max(minRows, preferredRows), maxRows);
|
|
130
|
+
};
|
|
131
|
+
var normalizeAdminNavInputs = (rows, pageOptions) => {
|
|
132
|
+
const allowedLinks = new Map(pageOptions.map((option) => [option.href, option.title]));
|
|
133
|
+
const deduped = [];
|
|
134
|
+
const seen = /* @__PURE__ */ new Set();
|
|
135
|
+
for (const row of rows) {
|
|
136
|
+
const href = typeof row.href === "string" ? row.href.trim() : "";
|
|
137
|
+
const defaultLabel = allowedLinks.get(href);
|
|
138
|
+
const explicitLabel = typeof row.label === "string" ? row.label.trim() : "";
|
|
139
|
+
const parentHref = typeof row.parentHref === "string" ? row.parentHref.trim() : "";
|
|
140
|
+
if (!href || !defaultLabel || seen.has(href)) {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
seen.add(href);
|
|
144
|
+
deduped.push({
|
|
145
|
+
href,
|
|
146
|
+
label: explicitLabel.length > 0 ? explicitLabel : defaultLabel,
|
|
147
|
+
...parentHref.length > 0 ? { parentHref } : {}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
const hrefs = new Set(deduped.map((item) => item.href));
|
|
151
|
+
const parentByHref = new Map(deduped.map((item) => [item.href, item.parentHref || ""]));
|
|
152
|
+
const createsCycle = (href, parentHref) => {
|
|
153
|
+
const visited = /* @__PURE__ */ new Set([href]);
|
|
154
|
+
let current = parentHref;
|
|
155
|
+
while (current) {
|
|
156
|
+
if (visited.has(current)) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
visited.add(current);
|
|
160
|
+
current = parentByHref.get(current) || "";
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
163
|
+
};
|
|
164
|
+
return deduped.map((item) => {
|
|
165
|
+
const parentHref = item.parentHref;
|
|
166
|
+
if (!parentHref || parentHref === item.href || !hrefs.has(parentHref) || createsCycle(item.href, parentHref)) {
|
|
167
|
+
return {
|
|
168
|
+
href: item.href,
|
|
169
|
+
label: item.label
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return item;
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
var parseAdminHeaderNavFromForm = (formData, pageOptions, maxRows = 24) => {
|
|
176
|
+
const serialized = String(formData.get("navItemsState") || "").trim();
|
|
177
|
+
if (serialized.length > 0) {
|
|
178
|
+
try {
|
|
179
|
+
const parsed = JSON.parse(serialized);
|
|
180
|
+
if (Array.isArray(parsed)) {
|
|
181
|
+
return normalizeAdminNavInputs(parsed.slice(0, maxRows), pageOptions);
|
|
182
|
+
}
|
|
183
|
+
} catch {
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const rawCount = Number(String(formData.get("navCount") || "0"));
|
|
187
|
+
const navCount = Number.isFinite(rawCount) ? Math.max(0, Math.min(rawCount, maxRows)) : 0;
|
|
188
|
+
const navRows = [];
|
|
189
|
+
for (let index = 0; index < navCount; index += 1) {
|
|
190
|
+
const href = String(formData.get(`navPage_${index}`) || "").trim();
|
|
191
|
+
const label = String(formData.get(`navLabel_${index}`) || "").trim();
|
|
192
|
+
const parentHref = String(formData.get(`navParentHref_${index}`) || "").trim();
|
|
193
|
+
navRows.push({
|
|
194
|
+
href,
|
|
195
|
+
label,
|
|
196
|
+
parentHref
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
if (navRows.length > 0) {
|
|
200
|
+
return normalizeAdminNavInputs(navRows, pageOptions);
|
|
201
|
+
}
|
|
202
|
+
return [];
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// src/admin-app/routeRegistry.ts
|
|
206
|
+
var roleCanAccessNav = (role, item) => {
|
|
207
|
+
if (!item.roles || item.roles.length === 0) {
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
if (!role) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
return item.roles.includes(role);
|
|
214
|
+
};
|
|
215
|
+
var navItemIsActive = (pathname, item) => {
|
|
216
|
+
if (item.href === "/admin") {
|
|
217
|
+
return pathname === "/admin";
|
|
218
|
+
}
|
|
219
|
+
return item.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export {
|
|
223
|
+
AdminBreadcrumbs,
|
|
224
|
+
AdminPage,
|
|
225
|
+
normalizeNestedNavItems,
|
|
226
|
+
buildNestedNavTree,
|
|
227
|
+
buildAdminPageLinkOptions,
|
|
228
|
+
getAdminNavRows,
|
|
229
|
+
normalizeAdminNavInputs,
|
|
230
|
+
parseAdminHeaderNavFromForm,
|
|
231
|
+
roleCanAccessNav,
|
|
232
|
+
navItemIsActive,
|
|
233
|
+
admin_app_exports
|
|
234
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/shared/socialMedia.ts
|
|
2
|
+
var SOCIAL_MEDIA_PLATFORM_LABELS = {
|
|
3
|
+
facebook: "Facebook",
|
|
4
|
+
instagram: "Instagram",
|
|
5
|
+
x: "X (Twitter)",
|
|
6
|
+
linkedin: "LinkedIn",
|
|
7
|
+
youtube: "YouTube",
|
|
8
|
+
tiktok: "TikTok",
|
|
9
|
+
pinterest: "Pinterest",
|
|
10
|
+
snapchat: "Snapchat"
|
|
11
|
+
};
|
|
12
|
+
var SOCIAL_MEDIA_PLATFORMS = [
|
|
13
|
+
"facebook",
|
|
14
|
+
"instagram",
|
|
15
|
+
"x",
|
|
16
|
+
"linkedin",
|
|
17
|
+
"youtube",
|
|
18
|
+
"tiktok",
|
|
19
|
+
"pinterest",
|
|
20
|
+
"snapchat"
|
|
21
|
+
];
|
|
22
|
+
var SOCIAL_MEDIA_ICON_OPTIONS = {
|
|
23
|
+
facebook: [
|
|
24
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:facebook" },
|
|
25
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:facebook-f" },
|
|
26
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-facebook" },
|
|
27
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:facebook-fill" }
|
|
28
|
+
],
|
|
29
|
+
instagram: [
|
|
30
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:instagram" },
|
|
31
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:instagram" },
|
|
32
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-instagram" },
|
|
33
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:instagram-fill" }
|
|
34
|
+
],
|
|
35
|
+
x: [
|
|
36
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:x" },
|
|
37
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:x-twitter" },
|
|
38
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-x" },
|
|
39
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:twitter-x-fill" }
|
|
40
|
+
],
|
|
41
|
+
linkedin: [
|
|
42
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:linkedin" },
|
|
43
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:linkedin-in" },
|
|
44
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-linkedin" },
|
|
45
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:linkedin-fill" }
|
|
46
|
+
],
|
|
47
|
+
youtube: [
|
|
48
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:youtube" },
|
|
49
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:youtube" },
|
|
50
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-youtube" },
|
|
51
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:youtube-fill" }
|
|
52
|
+
],
|
|
53
|
+
tiktok: [
|
|
54
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:tiktok" },
|
|
55
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:tiktok" },
|
|
56
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-tiktok" },
|
|
57
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:tiktok-fill" }
|
|
58
|
+
],
|
|
59
|
+
pinterest: [
|
|
60
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:pinterest" },
|
|
61
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:pinterest-p" },
|
|
62
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-pinterest" },
|
|
63
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:pinterest-fill" }
|
|
64
|
+
],
|
|
65
|
+
snapchat: [
|
|
66
|
+
{ label: "Simple Icons", library: "simple-icons", value: "simple-icons:snapchat" },
|
|
67
|
+
{ label: "Font Awesome Brands", library: "font-awesome-brands", value: "fa6-brands:snapchat" },
|
|
68
|
+
{ label: "Tabler Brands", library: "tabler-brands", value: "tabler:brand-snapchat" },
|
|
69
|
+
{ label: "Remix Icons", library: "remix-icons", value: "ri:snapchat-fill" }
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
var SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM = SOCIAL_MEDIA_PLATFORMS.reduce(
|
|
73
|
+
(acc, platform) => {
|
|
74
|
+
acc[platform] = SOCIAL_MEDIA_ICON_OPTIONS[platform][0].value;
|
|
75
|
+
return acc;
|
|
76
|
+
},
|
|
77
|
+
{}
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
SOCIAL_MEDIA_PLATFORM_LABELS,
|
|
82
|
+
SOCIAL_MEDIA_PLATFORMS,
|
|
83
|
+
SOCIAL_MEDIA_ICON_OPTIONS,
|
|
84
|
+
SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM
|
|
85
|
+
};
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { Field, CollectionConfig, GlobalConfig } from 'payload';
|
|
2
|
+
import { a as SocialMediaPlatform, b as SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM, c as SOCIAL_MEDIA_ICON_OPTIONS, d as SOCIAL_MEDIA_PLATFORMS, e as SOCIAL_MEDIA_PLATFORM_LABELS, S as SocialMediaGlobalData, f as SocialMediaIconLibrary, g as SocialMediaIconOption, h as SocialMediaProfileData, i as SocialMediaProfilesData } from './socialMedia-C05Iy-SV.mjs';
|
|
3
|
+
|
|
4
|
+
type ThemeOption = 'light' | 'dark' | 'brand-light' | 'brand-dark';
|
|
5
|
+
declare const createThemePreferenceField: (defaultTheme?: ThemeOption) => Field;
|
|
6
|
+
declare const themePreferenceField: Field;
|
|
7
|
+
|
|
8
|
+
type StudioSectionRole = 'admin' | 'editor' | 'client';
|
|
9
|
+
type StudioSectionCard = {
|
|
10
|
+
description?: string;
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
13
|
+
type StudioSectionComponent = {
|
|
14
|
+
clientProps?: Record<string, unknown>;
|
|
15
|
+
exportName: string;
|
|
16
|
+
path: string;
|
|
17
|
+
};
|
|
18
|
+
type StudioSectionView = {
|
|
19
|
+
Component: StudioSectionComponent;
|
|
20
|
+
path: string;
|
|
21
|
+
};
|
|
22
|
+
type StudioSection = {
|
|
23
|
+
card?: StudioSectionCard;
|
|
24
|
+
href?: string;
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
matchPrefixes?: string[];
|
|
28
|
+
roles?: StudioSectionRole[];
|
|
29
|
+
view?: StudioSectionView;
|
|
30
|
+
};
|
|
31
|
+
type ResolvedStudioSection = {
|
|
32
|
+
card?: StudioSectionCard;
|
|
33
|
+
href: string;
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
matchPrefixes: string[];
|
|
37
|
+
roles?: StudioSectionRole[];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type StudioGlobalLink = {
|
|
41
|
+
description?: string;
|
|
42
|
+
href?: string;
|
|
43
|
+
label: string;
|
|
44
|
+
slug: string;
|
|
45
|
+
};
|
|
46
|
+
interface AdminStudioConfig {
|
|
47
|
+
enabled?: boolean;
|
|
48
|
+
forms?: {
|
|
49
|
+
collectionSlug?: string;
|
|
50
|
+
enabled?: boolean;
|
|
51
|
+
submissionsCollectionSlug?: string;
|
|
52
|
+
uploadsCollectionSlug?: string;
|
|
53
|
+
};
|
|
54
|
+
globals?: StudioGlobalLink[];
|
|
55
|
+
media?: {
|
|
56
|
+
collectionSlug?: string;
|
|
57
|
+
};
|
|
58
|
+
pages?: {
|
|
59
|
+
builderBasePath?: string;
|
|
60
|
+
collectionSlug?: string;
|
|
61
|
+
};
|
|
62
|
+
sections?: StudioSection[];
|
|
63
|
+
}
|
|
64
|
+
interface AdminConfig {
|
|
65
|
+
brandName: string;
|
|
66
|
+
brandPrimary?: string;
|
|
67
|
+
brandSecondary?: string;
|
|
68
|
+
defaultTheme?: ThemeOption;
|
|
69
|
+
logoUrl?: string;
|
|
70
|
+
basePath?: string;
|
|
71
|
+
studio?: AdminStudioConfig;
|
|
72
|
+
}
|
|
73
|
+
declare function configureAdmin(config: AdminConfig): {
|
|
74
|
+
admin: {
|
|
75
|
+
css: string;
|
|
76
|
+
components: {
|
|
77
|
+
graphics: {
|
|
78
|
+
Logo: {
|
|
79
|
+
exportName: string;
|
|
80
|
+
path: string;
|
|
81
|
+
clientProps: {
|
|
82
|
+
brandName: string;
|
|
83
|
+
logoUrl: string | undefined;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
Icon: {
|
|
87
|
+
exportName: string;
|
|
88
|
+
path: string;
|
|
89
|
+
clientProps: {
|
|
90
|
+
brandName: string;
|
|
91
|
+
logoUrl: string | undefined;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
views: {
|
|
96
|
+
studioForms?: {
|
|
97
|
+
path: "/studio-forms";
|
|
98
|
+
Component: {
|
|
99
|
+
exportName: string;
|
|
100
|
+
path: string;
|
|
101
|
+
clientProps: {
|
|
102
|
+
formsCollectionSlug: string;
|
|
103
|
+
formSubmissionsCollectionSlug: string;
|
|
104
|
+
formUploadsCollectionSlug: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
} | undefined;
|
|
108
|
+
studioGlobals?: {
|
|
109
|
+
path: "/studio-globals";
|
|
110
|
+
Component: {
|
|
111
|
+
exportName: string;
|
|
112
|
+
path: string;
|
|
113
|
+
clientProps: {
|
|
114
|
+
globals: StudioGlobalLink[];
|
|
115
|
+
globalsBasePath: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
} | undefined;
|
|
119
|
+
studioContactForm?: {
|
|
120
|
+
path: "/studio-contact-form";
|
|
121
|
+
Component: {
|
|
122
|
+
exportName: string;
|
|
123
|
+
path: string;
|
|
124
|
+
clientProps: {
|
|
125
|
+
globalSlug: string;
|
|
126
|
+
globalsBasePath: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
} | undefined;
|
|
130
|
+
dashboard: {
|
|
131
|
+
Component: {
|
|
132
|
+
exportName: string;
|
|
133
|
+
path: string;
|
|
134
|
+
clientProps: {
|
|
135
|
+
brandName: string;
|
|
136
|
+
logoUrl: string | undefined;
|
|
137
|
+
globalsBasePath: string;
|
|
138
|
+
globalsExtraMatchPrefixes: string[];
|
|
139
|
+
formSubmissionsCollectionSlug: string;
|
|
140
|
+
formsCollectionSlug: string;
|
|
141
|
+
formsEnabled: boolean;
|
|
142
|
+
formUploadsCollectionSlug: string;
|
|
143
|
+
mediaCollectionSlug: string;
|
|
144
|
+
pagesCollectionSlug: string;
|
|
145
|
+
sections: ResolvedStudioSection[];
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
providers: {
|
|
151
|
+
exportName: string;
|
|
152
|
+
path: string;
|
|
153
|
+
clientProps: {
|
|
154
|
+
defaultTheme: ThemeOption;
|
|
155
|
+
};
|
|
156
|
+
}[];
|
|
157
|
+
afterNavLinks: {
|
|
158
|
+
exportName: string;
|
|
159
|
+
path: string;
|
|
160
|
+
clientProps: {
|
|
161
|
+
defaultTheme: ThemeOption;
|
|
162
|
+
};
|
|
163
|
+
}[];
|
|
164
|
+
Nav?: {
|
|
165
|
+
exportName: string;
|
|
166
|
+
path: string;
|
|
167
|
+
clientProps: {
|
|
168
|
+
brandName: string;
|
|
169
|
+
logoUrl: string | undefined;
|
|
170
|
+
globalsBasePath: string;
|
|
171
|
+
globalsExtraMatchPrefixes: string[];
|
|
172
|
+
formSubmissionsCollectionSlug: string;
|
|
173
|
+
formsCollectionSlug: string;
|
|
174
|
+
formsEnabled: boolean;
|
|
175
|
+
formUploadsCollectionSlug: string;
|
|
176
|
+
mediaCollectionSlug: string;
|
|
177
|
+
pagesCollectionSlug: string;
|
|
178
|
+
sections: ResolvedStudioSection[];
|
|
179
|
+
};
|
|
180
|
+
} | undefined;
|
|
181
|
+
};
|
|
182
|
+
meta: {
|
|
183
|
+
titleSuffix: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
brandName: string;
|
|
187
|
+
brandPrimary: string;
|
|
188
|
+
brandSecondary: string;
|
|
189
|
+
defaultTheme: ThemeOption;
|
|
190
|
+
wrapUsers(usersCollection: CollectionConfig): CollectionConfig;
|
|
191
|
+
wrapGlobals(globals: GlobalConfig[]): GlobalConfig[];
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
declare function withTooltips(fields: Field[], customTooltips?: Record<string, string>): Field[];
|
|
195
|
+
|
|
196
|
+
declare const createHeaderNavItemsField: () => Field;
|
|
197
|
+
|
|
198
|
+
type CreateSocialMediaConnectionsFieldOptions = {
|
|
199
|
+
description?: string;
|
|
200
|
+
label?: string;
|
|
201
|
+
name?: string;
|
|
202
|
+
platforms?: SocialMediaPlatform[];
|
|
203
|
+
};
|
|
204
|
+
declare const createSocialMediaConnectionsField: (options?: CreateSocialMediaConnectionsFieldOptions) => Field;
|
|
205
|
+
declare const socialMediaConnectionsField: Field;
|
|
206
|
+
|
|
207
|
+
type CreateSocialMediaGlobalOptions = {
|
|
208
|
+
description?: string;
|
|
209
|
+
fieldOptions?: Omit<CreateSocialMediaConnectionsFieldOptions, 'label' | 'name'>;
|
|
210
|
+
slug?: string;
|
|
211
|
+
};
|
|
212
|
+
declare const createSocialMediaGlobal: (options?: CreateSocialMediaGlobalOptions) => GlobalConfig;
|
|
213
|
+
|
|
214
|
+
type index_AdminConfig = AdminConfig;
|
|
215
|
+
type index_CreateSocialMediaConnectionsFieldOptions = CreateSocialMediaConnectionsFieldOptions;
|
|
216
|
+
type index_CreateSocialMediaGlobalOptions = CreateSocialMediaGlobalOptions;
|
|
217
|
+
type index_ResolvedStudioSection = ResolvedStudioSection;
|
|
218
|
+
declare const index_SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM: typeof SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM;
|
|
219
|
+
declare const index_SOCIAL_MEDIA_ICON_OPTIONS: typeof SOCIAL_MEDIA_ICON_OPTIONS;
|
|
220
|
+
declare const index_SOCIAL_MEDIA_PLATFORMS: typeof SOCIAL_MEDIA_PLATFORMS;
|
|
221
|
+
declare const index_SOCIAL_MEDIA_PLATFORM_LABELS: typeof SOCIAL_MEDIA_PLATFORM_LABELS;
|
|
222
|
+
declare const index_SocialMediaGlobalData: typeof SocialMediaGlobalData;
|
|
223
|
+
declare const index_SocialMediaIconLibrary: typeof SocialMediaIconLibrary;
|
|
224
|
+
declare const index_SocialMediaIconOption: typeof SocialMediaIconOption;
|
|
225
|
+
declare const index_SocialMediaPlatform: typeof SocialMediaPlatform;
|
|
226
|
+
declare const index_SocialMediaProfileData: typeof SocialMediaProfileData;
|
|
227
|
+
declare const index_SocialMediaProfilesData: typeof SocialMediaProfilesData;
|
|
228
|
+
type index_StudioSection = StudioSection;
|
|
229
|
+
type index_StudioSectionCard = StudioSectionCard;
|
|
230
|
+
type index_StudioSectionComponent = StudioSectionComponent;
|
|
231
|
+
type index_StudioSectionRole = StudioSectionRole;
|
|
232
|
+
type index_StudioSectionView = StudioSectionView;
|
|
233
|
+
declare const index_configureAdmin: typeof configureAdmin;
|
|
234
|
+
declare const index_createHeaderNavItemsField: typeof createHeaderNavItemsField;
|
|
235
|
+
declare const index_createSocialMediaConnectionsField: typeof createSocialMediaConnectionsField;
|
|
236
|
+
declare const index_createSocialMediaGlobal: typeof createSocialMediaGlobal;
|
|
237
|
+
declare const index_createThemePreferenceField: typeof createThemePreferenceField;
|
|
238
|
+
declare const index_socialMediaConnectionsField: typeof socialMediaConnectionsField;
|
|
239
|
+
declare const index_themePreferenceField: typeof themePreferenceField;
|
|
240
|
+
declare const index_withTooltips: typeof withTooltips;
|
|
241
|
+
declare namespace index {
|
|
242
|
+
export { type index_AdminConfig as AdminConfig, type index_CreateSocialMediaConnectionsFieldOptions as CreateSocialMediaConnectionsFieldOptions, type index_CreateSocialMediaGlobalOptions as CreateSocialMediaGlobalOptions, type index_ResolvedStudioSection as ResolvedStudioSection, index_SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM as SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM, index_SOCIAL_MEDIA_ICON_OPTIONS as SOCIAL_MEDIA_ICON_OPTIONS, index_SOCIAL_MEDIA_PLATFORMS as SOCIAL_MEDIA_PLATFORMS, index_SOCIAL_MEDIA_PLATFORM_LABELS as SOCIAL_MEDIA_PLATFORM_LABELS, index_SocialMediaGlobalData as SocialMediaGlobalData, index_SocialMediaIconLibrary as SocialMediaIconLibrary, index_SocialMediaIconOption as SocialMediaIconOption, index_SocialMediaPlatform as SocialMediaPlatform, index_SocialMediaProfileData as SocialMediaProfileData, index_SocialMediaProfilesData as SocialMediaProfilesData, type index_StudioSection as StudioSection, type index_StudioSectionCard as StudioSectionCard, type index_StudioSectionComponent as StudioSectionComponent, type index_StudioSectionRole as StudioSectionRole, type index_StudioSectionView as StudioSectionView, index_configureAdmin as configureAdmin, index_createHeaderNavItemsField as createHeaderNavItemsField, index_createSocialMediaConnectionsField as createSocialMediaConnectionsField, index_createSocialMediaGlobal as createSocialMediaGlobal, index_createThemePreferenceField as createThemePreferenceField, index_socialMediaConnectionsField as socialMediaConnectionsField, index_themePreferenceField as themePreferenceField, index_withTooltips as withTooltips };
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export { type AdminConfig as A, type CreateSocialMediaConnectionsFieldOptions as C, type ResolvedStudioSection as R, type StudioSection as S, type CreateSocialMediaGlobalOptions as a, type StudioSectionCard as b, type StudioSectionComponent as c, type StudioSectionRole as d, type StudioSectionView as e, configureAdmin as f, createHeaderNavItemsField as g, createSocialMediaConnectionsField as h, index as i, createSocialMediaGlobal as j, createThemePreferenceField as k, socialMediaConnectionsField as s, themePreferenceField as t, withTooltips as w };
|