@orion-studios/payload-studio 0.5.0-beta.11 → 0.5.0-beta.111
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 +1270 -3
- package/dist/admin-app/client.mjs +1172 -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-7lxTrxSG.d.mts +128 -0
- package/dist/index-7lxTrxSG.d.ts +128 -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-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,128 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type AdminRole = 'admin' | 'editor' | 'client';
|
|
5
|
+
type AdminNavIcon = 'dashboard' | 'pages' | 'forms' | 'globals' | 'media' | 'tools' | 'account';
|
|
6
|
+
type AdminNavItem = {
|
|
7
|
+
href: string;
|
|
8
|
+
icon?: AdminNavIcon;
|
|
9
|
+
label: string;
|
|
10
|
+
matchPrefixes: string[];
|
|
11
|
+
roles?: AdminRole[];
|
|
12
|
+
};
|
|
13
|
+
type AdminBreadcrumbItem = {
|
|
14
|
+
label: string;
|
|
15
|
+
href?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const roleCanAccessNav: (role: string | undefined, item: AdminNavItem) => boolean;
|
|
18
|
+
declare const navItemIsActive: (pathname: string, item: AdminNavItem) => boolean;
|
|
19
|
+
|
|
20
|
+
type AdminBreadcrumbsProps = {
|
|
21
|
+
items: AdminBreadcrumbItem[];
|
|
22
|
+
};
|
|
23
|
+
declare function AdminBreadcrumbs({ items }: AdminBreadcrumbsProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
type AdminPageProps = {
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
breadcrumbs: AdminBreadcrumbItem[];
|
|
29
|
+
actions?: ReactNode;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
declare function AdminPage({ title, description, breadcrumbs, actions, children }: AdminPageProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
|
|
34
|
+
type MediaDetailPanelProps = {
|
|
35
|
+
id: string;
|
|
36
|
+
filename?: string;
|
|
37
|
+
alt?: string;
|
|
38
|
+
url?: string;
|
|
39
|
+
filesize?: number;
|
|
40
|
+
width?: number;
|
|
41
|
+
height?: number;
|
|
42
|
+
mimeType?: string;
|
|
43
|
+
createdAt?: string;
|
|
44
|
+
updateAction: (formData: FormData) => void;
|
|
45
|
+
deleteAction: (formData: FormData) => void;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type MediaListItemProps = {
|
|
49
|
+
id: string;
|
|
50
|
+
filename?: string;
|
|
51
|
+
alt?: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
filesize?: number;
|
|
54
|
+
width?: number;
|
|
55
|
+
height?: number;
|
|
56
|
+
mimeType?: string;
|
|
57
|
+
href: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type NestedNavItemInput = {
|
|
61
|
+
href?: string;
|
|
62
|
+
label?: string;
|
|
63
|
+
parentHref?: string;
|
|
64
|
+
};
|
|
65
|
+
type NestedNavItem = {
|
|
66
|
+
href: string;
|
|
67
|
+
label: string;
|
|
68
|
+
parentHref?: string;
|
|
69
|
+
};
|
|
70
|
+
type NestedNavTree = {
|
|
71
|
+
topLevel: NestedNavItem[];
|
|
72
|
+
childrenByParent: Map<string, NestedNavItem[]>;
|
|
73
|
+
};
|
|
74
|
+
declare const normalizeNestedNavItems: <T extends NestedNavItemInput>(items: T[]) => NestedNavItem[];
|
|
75
|
+
declare const buildNestedNavTree: (items: NestedNavItem[]) => NestedNavTree;
|
|
76
|
+
|
|
77
|
+
type AdminNavLinkItem = {
|
|
78
|
+
href: string;
|
|
79
|
+
label: string;
|
|
80
|
+
parentHref?: string;
|
|
81
|
+
};
|
|
82
|
+
type AdminPageRecord = {
|
|
83
|
+
path?: string;
|
|
84
|
+
title?: string;
|
|
85
|
+
};
|
|
86
|
+
type AdminPageLinkOption = {
|
|
87
|
+
href: string;
|
|
88
|
+
label: string;
|
|
89
|
+
title: string;
|
|
90
|
+
};
|
|
91
|
+
declare const buildAdminPageLinkOptions: (pages: AdminPageRecord[]) => AdminPageLinkOption[];
|
|
92
|
+
declare const getAdminNavRows: (navItems: AdminNavLinkItem[], pageOptions: AdminPageLinkOption[], minRows?: number, maxRows?: number) => number;
|
|
93
|
+
type AdminNavInput = {
|
|
94
|
+
href?: string;
|
|
95
|
+
label?: string;
|
|
96
|
+
parentHref?: string;
|
|
97
|
+
};
|
|
98
|
+
declare const normalizeAdminNavInputs: (rows: AdminNavInput[], pageOptions: AdminPageLinkOption[]) => AdminNavLinkItem[];
|
|
99
|
+
declare const parseAdminHeaderNavFromForm: (formData: FormData, pageOptions: AdminPageLinkOption[], maxRows?: number) => AdminNavLinkItem[];
|
|
100
|
+
|
|
101
|
+
type index_AdminBreadcrumbItem = AdminBreadcrumbItem;
|
|
102
|
+
declare const index_AdminBreadcrumbs: typeof AdminBreadcrumbs;
|
|
103
|
+
type index_AdminNavIcon = AdminNavIcon;
|
|
104
|
+
type index_AdminNavInput = AdminNavInput;
|
|
105
|
+
type index_AdminNavItem = AdminNavItem;
|
|
106
|
+
type index_AdminNavLinkItem = AdminNavLinkItem;
|
|
107
|
+
declare const index_AdminPage: typeof AdminPage;
|
|
108
|
+
type index_AdminPageLinkOption = AdminPageLinkOption;
|
|
109
|
+
type index_AdminPageRecord = AdminPageRecord;
|
|
110
|
+
type index_AdminRole = AdminRole;
|
|
111
|
+
type index_MediaDetailPanelProps = MediaDetailPanelProps;
|
|
112
|
+
type index_MediaListItemProps = MediaListItemProps;
|
|
113
|
+
type index_NestedNavItem = NestedNavItem;
|
|
114
|
+
type index_NestedNavItemInput = NestedNavItemInput;
|
|
115
|
+
type index_NestedNavTree = NestedNavTree;
|
|
116
|
+
declare const index_buildAdminPageLinkOptions: typeof buildAdminPageLinkOptions;
|
|
117
|
+
declare const index_buildNestedNavTree: typeof buildNestedNavTree;
|
|
118
|
+
declare const index_getAdminNavRows: typeof getAdminNavRows;
|
|
119
|
+
declare const index_navItemIsActive: typeof navItemIsActive;
|
|
120
|
+
declare const index_normalizeAdminNavInputs: typeof normalizeAdminNavInputs;
|
|
121
|
+
declare const index_normalizeNestedNavItems: typeof normalizeNestedNavItems;
|
|
122
|
+
declare const index_parseAdminHeaderNavFromForm: typeof parseAdminHeaderNavFromForm;
|
|
123
|
+
declare const index_roleCanAccessNav: typeof roleCanAccessNav;
|
|
124
|
+
declare namespace index {
|
|
125
|
+
export { type index_AdminBreadcrumbItem as AdminBreadcrumbItem, index_AdminBreadcrumbs as AdminBreadcrumbs, type index_AdminNavIcon as AdminNavIcon, type index_AdminNavInput as AdminNavInput, type index_AdminNavItem as AdminNavItem, type index_AdminNavLinkItem as AdminNavLinkItem, index_AdminPage as AdminPage, type index_AdminPageLinkOption as AdminPageLinkOption, type index_AdminPageRecord as AdminPageRecord, type index_AdminRole as AdminRole, type index_MediaDetailPanelProps as MediaDetailPanelProps, type index_MediaListItemProps as MediaListItemProps, type index_NestedNavItem as NestedNavItem, type index_NestedNavItemInput as NestedNavItemInput, type index_NestedNavTree as NestedNavTree, index_buildAdminPageLinkOptions as buildAdminPageLinkOptions, index_buildNestedNavTree as buildNestedNavTree, index_getAdminNavRows as getAdminNavRows, index_navItemIsActive as navItemIsActive, index_normalizeAdminNavInputs as normalizeAdminNavInputs, index_normalizeNestedNavItems as normalizeNestedNavItems, index_parseAdminHeaderNavFromForm as parseAdminHeaderNavFromForm, index_roleCanAccessNav as roleCanAccessNav };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { type AdminBreadcrumbItem as A, type MediaDetailPanelProps as M, type NestedNavItem as N, AdminBreadcrumbs as a, type AdminNavIcon as b, type AdminNavInput as c, type AdminNavItem as d, type AdminNavLinkItem as e, AdminPage as f, type AdminPageLinkOption as g, type AdminPageRecord as h, index as i, type AdminRole as j, type MediaListItemProps as k, type NestedNavItemInput as l, type NestedNavTree as m, buildAdminPageLinkOptions as n, buildNestedNavTree as o, getAdminNavRows as p, navItemIsActive as q, normalizeAdminNavInputs as r, normalizeNestedNavItems as s, parseAdminHeaderNavFromForm as t, roleCanAccessNav as u };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type AdminRole = 'admin' | 'editor' | 'client';
|
|
5
|
+
type AdminNavIcon = 'dashboard' | 'pages' | 'forms' | 'globals' | 'media' | 'tools' | 'account';
|
|
6
|
+
type AdminNavItem = {
|
|
7
|
+
href: string;
|
|
8
|
+
icon?: AdminNavIcon;
|
|
9
|
+
label: string;
|
|
10
|
+
matchPrefixes: string[];
|
|
11
|
+
roles?: AdminRole[];
|
|
12
|
+
};
|
|
13
|
+
type AdminBreadcrumbItem = {
|
|
14
|
+
label: string;
|
|
15
|
+
href?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const roleCanAccessNav: (role: string | undefined, item: AdminNavItem) => boolean;
|
|
18
|
+
declare const navItemIsActive: (pathname: string, item: AdminNavItem) => boolean;
|
|
19
|
+
|
|
20
|
+
type AdminBreadcrumbsProps = {
|
|
21
|
+
items: AdminBreadcrumbItem[];
|
|
22
|
+
};
|
|
23
|
+
declare function AdminBreadcrumbs({ items }: AdminBreadcrumbsProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
type AdminPageProps = {
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
breadcrumbs: AdminBreadcrumbItem[];
|
|
29
|
+
actions?: ReactNode;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
declare function AdminPage({ title, description, breadcrumbs, actions, children }: AdminPageProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
|
|
34
|
+
type MediaDetailPanelProps = {
|
|
35
|
+
id: string;
|
|
36
|
+
filename?: string;
|
|
37
|
+
alt?: string;
|
|
38
|
+
url?: string;
|
|
39
|
+
filesize?: number;
|
|
40
|
+
width?: number;
|
|
41
|
+
height?: number;
|
|
42
|
+
mimeType?: string;
|
|
43
|
+
createdAt?: string;
|
|
44
|
+
updateAction: (formData: FormData) => void;
|
|
45
|
+
deleteAction: (formData: FormData) => void;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type MediaListItemProps = {
|
|
49
|
+
id: string;
|
|
50
|
+
filename?: string;
|
|
51
|
+
alt?: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
filesize?: number;
|
|
54
|
+
width?: number;
|
|
55
|
+
height?: number;
|
|
56
|
+
mimeType?: string;
|
|
57
|
+
href: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type NestedNavItemInput = {
|
|
61
|
+
href?: string;
|
|
62
|
+
label?: string;
|
|
63
|
+
parentHref?: string;
|
|
64
|
+
};
|
|
65
|
+
type NestedNavItem = {
|
|
66
|
+
href: string;
|
|
67
|
+
label: string;
|
|
68
|
+
parentHref?: string;
|
|
69
|
+
};
|
|
70
|
+
type NestedNavTree = {
|
|
71
|
+
topLevel: NestedNavItem[];
|
|
72
|
+
childrenByParent: Map<string, NestedNavItem[]>;
|
|
73
|
+
};
|
|
74
|
+
declare const normalizeNestedNavItems: <T extends NestedNavItemInput>(items: T[]) => NestedNavItem[];
|
|
75
|
+
declare const buildNestedNavTree: (items: NestedNavItem[]) => NestedNavTree;
|
|
76
|
+
|
|
77
|
+
type AdminNavLinkItem = {
|
|
78
|
+
href: string;
|
|
79
|
+
label: string;
|
|
80
|
+
parentHref?: string;
|
|
81
|
+
};
|
|
82
|
+
type AdminPageRecord = {
|
|
83
|
+
path?: string;
|
|
84
|
+
title?: string;
|
|
85
|
+
};
|
|
86
|
+
type AdminPageLinkOption = {
|
|
87
|
+
href: string;
|
|
88
|
+
label: string;
|
|
89
|
+
title: string;
|
|
90
|
+
};
|
|
91
|
+
declare const buildAdminPageLinkOptions: (pages: AdminPageRecord[]) => AdminPageLinkOption[];
|
|
92
|
+
declare const getAdminNavRows: (navItems: AdminNavLinkItem[], pageOptions: AdminPageLinkOption[], minRows?: number, maxRows?: number) => number;
|
|
93
|
+
type AdminNavInput = {
|
|
94
|
+
href?: string;
|
|
95
|
+
label?: string;
|
|
96
|
+
parentHref?: string;
|
|
97
|
+
};
|
|
98
|
+
declare const normalizeAdminNavInputs: (rows: AdminNavInput[], pageOptions: AdminPageLinkOption[]) => AdminNavLinkItem[];
|
|
99
|
+
declare const parseAdminHeaderNavFromForm: (formData: FormData, pageOptions: AdminPageLinkOption[], maxRows?: number) => AdminNavLinkItem[];
|
|
100
|
+
|
|
101
|
+
type index_AdminBreadcrumbItem = AdminBreadcrumbItem;
|
|
102
|
+
declare const index_AdminBreadcrumbs: typeof AdminBreadcrumbs;
|
|
103
|
+
type index_AdminNavIcon = AdminNavIcon;
|
|
104
|
+
type index_AdminNavInput = AdminNavInput;
|
|
105
|
+
type index_AdminNavItem = AdminNavItem;
|
|
106
|
+
type index_AdminNavLinkItem = AdminNavLinkItem;
|
|
107
|
+
declare const index_AdminPage: typeof AdminPage;
|
|
108
|
+
type index_AdminPageLinkOption = AdminPageLinkOption;
|
|
109
|
+
type index_AdminPageRecord = AdminPageRecord;
|
|
110
|
+
type index_AdminRole = AdminRole;
|
|
111
|
+
type index_MediaDetailPanelProps = MediaDetailPanelProps;
|
|
112
|
+
type index_MediaListItemProps = MediaListItemProps;
|
|
113
|
+
type index_NestedNavItem = NestedNavItem;
|
|
114
|
+
type index_NestedNavItemInput = NestedNavItemInput;
|
|
115
|
+
type index_NestedNavTree = NestedNavTree;
|
|
116
|
+
declare const index_buildAdminPageLinkOptions: typeof buildAdminPageLinkOptions;
|
|
117
|
+
declare const index_buildNestedNavTree: typeof buildNestedNavTree;
|
|
118
|
+
declare const index_getAdminNavRows: typeof getAdminNavRows;
|
|
119
|
+
declare const index_navItemIsActive: typeof navItemIsActive;
|
|
120
|
+
declare const index_normalizeAdminNavInputs: typeof normalizeAdminNavInputs;
|
|
121
|
+
declare const index_normalizeNestedNavItems: typeof normalizeNestedNavItems;
|
|
122
|
+
declare const index_parseAdminHeaderNavFromForm: typeof parseAdminHeaderNavFromForm;
|
|
123
|
+
declare const index_roleCanAccessNav: typeof roleCanAccessNav;
|
|
124
|
+
declare namespace index {
|
|
125
|
+
export { type index_AdminBreadcrumbItem as AdminBreadcrumbItem, index_AdminBreadcrumbs as AdminBreadcrumbs, type index_AdminNavIcon as AdminNavIcon, type index_AdminNavInput as AdminNavInput, type index_AdminNavItem as AdminNavItem, type index_AdminNavLinkItem as AdminNavLinkItem, index_AdminPage as AdminPage, type index_AdminPageLinkOption as AdminPageLinkOption, type index_AdminPageRecord as AdminPageRecord, type index_AdminRole as AdminRole, type index_MediaDetailPanelProps as MediaDetailPanelProps, type index_MediaListItemProps as MediaListItemProps, type index_NestedNavItem as NestedNavItem, type index_NestedNavItemInput as NestedNavItemInput, type index_NestedNavTree as NestedNavTree, index_buildAdminPageLinkOptions as buildAdminPageLinkOptions, index_buildNestedNavTree as buildNestedNavTree, index_getAdminNavRows as getAdminNavRows, index_navItemIsActive as navItemIsActive, index_normalizeAdminNavInputs as normalizeAdminNavInputs, index_normalizeNestedNavItems as normalizeNestedNavItems, index_parseAdminHeaderNavFromForm as parseAdminHeaderNavFromForm, index_roleCanAccessNav as roleCanAccessNav };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { type AdminBreadcrumbItem as A, type MediaDetailPanelProps as M, type NestedNavItem as N, AdminBreadcrumbs as a, type AdminNavIcon as b, type AdminNavInput as c, type AdminNavItem as d, type AdminNavLinkItem as e, AdminPage as f, type AdminPageLinkOption as g, type AdminPageRecord as h, index as i, type AdminRole as j, type MediaListItemProps as k, type NestedNavItemInput as l, type NestedNavTree as m, buildAdminPageLinkOptions as n, buildNestedNavTree as o, getAdminNavRows as p, navItemIsActive as q, normalizeAdminNavInputs as r, normalizeNestedNavItems as s, parseAdminHeaderNavFromForm as t, roleCanAccessNav as u };
|