@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
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createDefaultStudioDocument,
|
|
3
|
-
layoutToStudioDocument,
|
|
4
2
|
pageInspectorPanels,
|
|
5
3
|
pageNodeTypes,
|
|
6
4
|
pagePaletteGroups,
|
|
7
5
|
pageStudioModuleManifest,
|
|
6
|
+
resolveBuilderThemeTokens
|
|
7
|
+
} from "../chunk-GKMBYYXF.mjs";
|
|
8
|
+
import "../chunk-OQSEJXC4.mjs";
|
|
9
|
+
import {
|
|
10
|
+
createDefaultStudioDocument,
|
|
11
|
+
defaultBuilderThemeTokens,
|
|
12
|
+
layoutToStudioDocument,
|
|
8
13
|
studioDocumentToLayout
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-ETRRXURT.mjs";
|
|
14
|
+
} from "../chunk-PF3EBZXF.mjs";
|
|
11
15
|
import "../chunk-6BWS3CLP.mjs";
|
|
12
16
|
export {
|
|
13
17
|
createDefaultStudioDocument,
|
|
18
|
+
defaultBuilderThemeTokens,
|
|
14
19
|
layoutToStudioDocument,
|
|
15
20
|
pageInspectorPanels,
|
|
16
21
|
pageNodeTypes,
|
|
17
22
|
pagePaletteGroups,
|
|
18
23
|
pageStudioModuleManifest,
|
|
24
|
+
resolveBuilderThemeTokens,
|
|
19
25
|
studioDocumentToLayout
|
|
20
26
|
};
|
package/package.json
CHANGED
|
@@ -1,60 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-studios/payload-studio",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.110",
|
|
4
4
|
"description": "Unified Payload CMS toolkit for Orion Studios",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
6
8
|
"exports": {
|
|
7
9
|
".": {
|
|
8
10
|
"types": "./dist/index.d.ts",
|
|
9
11
|
"require": "./dist/index.js",
|
|
10
|
-
"import": "./dist/index.mjs"
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
11
14
|
},
|
|
12
15
|
"./admin": {
|
|
13
16
|
"types": "./dist/admin/index.d.ts",
|
|
14
17
|
"require": "./dist/admin/index.js",
|
|
15
|
-
"import": "./dist/admin/index.mjs"
|
|
18
|
+
"import": "./dist/admin/index.mjs",
|
|
19
|
+
"default": "./dist/admin/index.mjs"
|
|
16
20
|
},
|
|
17
21
|
"./admin/client": {
|
|
18
22
|
"types": "./dist/admin/client.d.ts",
|
|
19
23
|
"require": "./dist/admin/client.js",
|
|
20
|
-
"import": "./dist/admin/client.mjs"
|
|
24
|
+
"import": "./dist/admin/client.mjs",
|
|
25
|
+
"default": "./dist/admin/client.mjs"
|
|
21
26
|
},
|
|
22
27
|
"./admin.css": "./dist/admin.css",
|
|
23
28
|
"./admin-app": {
|
|
24
29
|
"types": "./dist/admin-app/index.d.ts",
|
|
25
30
|
"require": "./dist/admin-app/index.js",
|
|
26
|
-
"import": "./dist/admin-app/index.mjs"
|
|
31
|
+
"import": "./dist/admin-app/index.mjs",
|
|
32
|
+
"default": "./dist/admin-app/index.mjs"
|
|
27
33
|
},
|
|
28
34
|
"./admin-app/client": {
|
|
29
35
|
"types": "./dist/admin-app/client.d.ts",
|
|
30
36
|
"require": "./dist/admin-app/client.js",
|
|
31
|
-
"import": "./dist/admin-app/client.mjs"
|
|
37
|
+
"import": "./dist/admin-app/client.mjs",
|
|
38
|
+
"default": "./dist/admin-app/client.mjs"
|
|
32
39
|
},
|
|
33
40
|
"./admin-app/styles.css": "./dist/admin-app/styles.css",
|
|
34
41
|
"./blocks": {
|
|
35
42
|
"types": "./dist/blocks/index.d.ts",
|
|
36
43
|
"require": "./dist/blocks/index.js",
|
|
37
|
-
"import": "./dist/blocks/index.mjs"
|
|
44
|
+
"import": "./dist/blocks/index.mjs",
|
|
45
|
+
"default": "./dist/blocks/index.mjs"
|
|
38
46
|
},
|
|
39
47
|
"./nextjs": {
|
|
40
48
|
"types": "./dist/nextjs/index.d.ts",
|
|
41
49
|
"require": "./dist/nextjs/index.js",
|
|
42
|
-
"import": "./dist/nextjs/index.mjs"
|
|
50
|
+
"import": "./dist/nextjs/index.mjs",
|
|
51
|
+
"default": "./dist/nextjs/index.mjs"
|
|
43
52
|
},
|
|
44
53
|
"./studio": {
|
|
45
54
|
"types": "./dist/studio/index.d.ts",
|
|
46
55
|
"require": "./dist/studio/index.js",
|
|
47
|
-
"import": "./dist/studio/index.mjs"
|
|
56
|
+
"import": "./dist/studio/index.mjs",
|
|
57
|
+
"default": "./dist/studio/index.mjs"
|
|
48
58
|
},
|
|
49
59
|
"./studio-pages": {
|
|
50
60
|
"types": "./dist/studio-pages/index.d.ts",
|
|
51
61
|
"require": "./dist/studio-pages/index.js",
|
|
52
|
-
"import": "./dist/studio-pages/index.mjs"
|
|
62
|
+
"import": "./dist/studio-pages/index.mjs",
|
|
63
|
+
"default": "./dist/studio-pages/index.mjs"
|
|
53
64
|
},
|
|
54
65
|
"./studio-pages/client": {
|
|
55
66
|
"types": "./dist/studio-pages/client.d.ts",
|
|
56
67
|
"require": "./dist/studio-pages/client.js",
|
|
57
|
-
"import": "./dist/studio-pages/client.mjs"
|
|
68
|
+
"import": "./dist/studio-pages/client.mjs",
|
|
69
|
+
"default": "./dist/studio-pages/client.mjs"
|
|
58
70
|
},
|
|
59
71
|
"./studio-pages/builder.css": "./dist/studio-pages/builder.css",
|
|
60
72
|
"./package.json": "./package.json"
|
|
@@ -63,10 +75,19 @@
|
|
|
63
75
|
"dist"
|
|
64
76
|
],
|
|
65
77
|
"scripts": {
|
|
66
|
-
"build": "tsup && node -e \"const fs=require('fs'); fs.copyFileSync('src/admin/styles/admin.css','dist/admin.css'); fs.mkdirSync('dist/admin-app',{recursive:true}); fs.copyFileSync('src/admin-app/styles/admin-app.css','dist/admin-app/styles.css'); fs.mkdirSync('dist/studio-pages',{recursive:true}); fs.copyFileSync('src/studio-pages/styles/builder.css','dist/studio-pages/builder.css'); fs.mkdirSync('dist/admin',{recursive:true}); fs.copyFileSync('src/admin/client.d.ts','dist/admin/client.d.ts'); fs.copyFileSync('src/admin/client.d.ts','dist/admin/client.d.mts'); fs.copyFileSync('src/studio-pages/client.d.ts','dist/studio-pages/client.d.ts'); fs.copyFileSync('src/studio-pages/client.d.ts','dist/studio-pages/client.d.mts')\"",
|
|
78
|
+
"build": "tsup && node -e \"const fs=require('fs'); fs.copyFileSync('src/admin/styles/admin.css','dist/admin.css'); fs.mkdirSync('dist/admin-app',{recursive:true}); fs.copyFileSync('src/admin-app/styles/admin-app.css','dist/admin-app/styles.css'); fs.mkdirSync('dist/studio-pages',{recursive:true}); fs.copyFileSync('src/studio-pages/styles/builder.css','dist/studio-pages/builder.css'); fs.mkdirSync('dist/admin',{recursive:true}); fs.copyFileSync('src/admin/client.d.ts','dist/admin/client.d.ts'); fs.copyFileSync('src/admin/client.d.ts','dist/admin/client.d.mts'); fs.copyFileSync('src/admin-app/client.d.ts','dist/admin-app/client.d.ts'); fs.copyFileSync('src/admin-app/client.d.ts','dist/admin-app/client.d.mts'); fs.copyFileSync('src/studio-pages/client.d.ts','dist/studio-pages/client.d.ts'); fs.copyFileSync('src/studio-pages/client.d.ts','dist/studio-pages/client.d.mts')\"",
|
|
67
79
|
"dev": "tsup --watch",
|
|
80
|
+
"test": "tsx --test src/studio-pages/builder/settings-v2/__tests__/*.test.ts src/studio-pages/__tests__/*.test.ts",
|
|
68
81
|
"typecheck": "tsc --noEmit"
|
|
69
82
|
},
|
|
83
|
+
"overrides": {
|
|
84
|
+
"ajv": "^8.18.0",
|
|
85
|
+
"dompurify": "^3.3.3",
|
|
86
|
+
"file-type": "^21.3.3",
|
|
87
|
+
"immutable": "^4.3.8",
|
|
88
|
+
"rollup": "^4.59.0",
|
|
89
|
+
"undici": "^7.24.4"
|
|
90
|
+
},
|
|
70
91
|
"keywords": [
|
|
71
92
|
"payload",
|
|
72
93
|
"cms",
|
|
@@ -90,8 +111,9 @@
|
|
|
90
111
|
"@payloadcms/ui": "3.75.0",
|
|
91
112
|
"@types/react": "^19.0.0",
|
|
92
113
|
"@types/react-dom": "^19.0.0",
|
|
93
|
-
"next": "16.
|
|
114
|
+
"next": "16.2.0",
|
|
94
115
|
"payload": "3.75.0",
|
|
116
|
+
"tsx": "^4.21.0",
|
|
95
117
|
"tsup": "^8.0.0",
|
|
96
118
|
"typescript": "^5.3.0"
|
|
97
119
|
}
|
package/dist/chunk-AAOHJDNS.mjs
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
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
|
-
navItemIsActive: () => navItemIsActive,
|
|
11
|
-
roleCanAccessNav: () => roleCanAccessNav
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// src/admin-app/components/AdminBreadcrumbs.tsx
|
|
15
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
function AdminBreadcrumbs({ items }) {
|
|
17
|
-
return /* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", className: "orion-admin-breadcrumbs", children: items.map((item, index) => {
|
|
18
|
-
const isLast = index === items.length - 1;
|
|
19
|
-
return /* @__PURE__ */ jsxs("span", { children: [
|
|
20
|
-
item.href && !isLast ? /* @__PURE__ */ jsx("a", { href: item.href, children: item.label }) : /* @__PURE__ */ jsx("span", { children: item.label }),
|
|
21
|
-
!isLast ? /* @__PURE__ */ jsx("span", { className: "orion-admin-breadcrumb-sep", children: "/" }) : null
|
|
22
|
-
] }, `${item.label}-${index}`);
|
|
23
|
-
}) });
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// src/admin-app/components/AdminPage.tsx
|
|
27
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
28
|
-
function AdminPage({ title, description, breadcrumbs, actions, children }) {
|
|
29
|
-
return /* @__PURE__ */ jsxs2("div", { className: "orion-admin-page", children: [
|
|
30
|
-
/* @__PURE__ */ jsxs2("div", { className: "orion-admin-page-header", children: [
|
|
31
|
-
/* @__PURE__ */ jsx2(AdminBreadcrumbs, { items: breadcrumbs }),
|
|
32
|
-
/* @__PURE__ */ jsxs2("div", { className: "orion-admin-page-title-row", children: [
|
|
33
|
-
/* @__PURE__ */ jsxs2("div", { children: [
|
|
34
|
-
/* @__PURE__ */ jsx2("h1", { children: title }),
|
|
35
|
-
description ? /* @__PURE__ */ jsx2("p", { children: description }) : null
|
|
36
|
-
] }),
|
|
37
|
-
actions ? /* @__PURE__ */ jsx2("div", { className: "orion-admin-page-actions", children: actions }) : null
|
|
38
|
-
] })
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ jsx2("div", { className: "orion-admin-page-content", children })
|
|
41
|
-
] });
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// src/admin-app/routeRegistry.ts
|
|
45
|
-
var roleCanAccessNav = (role, item) => {
|
|
46
|
-
if (!item.roles || item.roles.length === 0) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
if (!role) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return item.roles.includes(role);
|
|
53
|
-
};
|
|
54
|
-
var navItemIsActive = (pathname, item) => {
|
|
55
|
-
if (item.href === "/admin") {
|
|
56
|
-
return pathname === "/admin";
|
|
57
|
-
}
|
|
58
|
-
return item.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
AdminBreadcrumbs,
|
|
63
|
-
AdminPage,
|
|
64
|
-
roleCanAccessNav,
|
|
65
|
-
navItemIsActive,
|
|
66
|
-
admin_app_exports
|
|
67
|
-
};
|
package/dist/chunk-ETRRXURT.mjs
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// src/blocks/blocks/sectionStyleFields.ts
|
|
2
|
-
var sectionStyleDefaults = {
|
|
3
|
-
contentBackgroundColor: "#ffffff",
|
|
4
|
-
contentBackgroundMode: "none",
|
|
5
|
-
contentGradientAngle: "135",
|
|
6
|
-
contentGradientFrom: "#ffffff",
|
|
7
|
-
contentGradientPreset: "none",
|
|
8
|
-
contentGradientTo: "#f4f6f2",
|
|
9
|
-
contentWidth: "inherit",
|
|
10
|
-
sectionBackgroundColor: "#ffffff",
|
|
11
|
-
sectionBackgroundMode: "none",
|
|
12
|
-
sectionGradientAngle: "135",
|
|
13
|
-
sectionGradientFrom: "#124a37",
|
|
14
|
-
sectionGradientPreset: "forest",
|
|
15
|
-
sectionGradientTo: "#1f684f",
|
|
16
|
-
sectionPaddingY: "md",
|
|
17
|
-
sectionWidth: "content"
|
|
18
|
-
};
|
|
19
|
-
var sectionStyleFields = () => [
|
|
20
|
-
{
|
|
21
|
-
name: "sectionWidth",
|
|
22
|
-
type: "select",
|
|
23
|
-
defaultValue: sectionStyleDefaults.sectionWidth,
|
|
24
|
-
options: [
|
|
25
|
-
{ label: "Content", value: "content" },
|
|
26
|
-
{ label: "Wide", value: "wide" },
|
|
27
|
-
{ label: "Full", value: "full" }
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: "contentWidth",
|
|
32
|
-
type: "select",
|
|
33
|
-
defaultValue: sectionStyleDefaults.contentWidth,
|
|
34
|
-
options: [
|
|
35
|
-
{ label: "Inherit", value: "inherit" },
|
|
36
|
-
{ label: "Narrow", value: "narrow" },
|
|
37
|
-
{ label: "Content", value: "content" },
|
|
38
|
-
{ label: "Wide", value: "wide" },
|
|
39
|
-
{ label: "Full", value: "full" }
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: "sectionPaddingY",
|
|
44
|
-
type: "select",
|
|
45
|
-
defaultValue: sectionStyleDefaults.sectionPaddingY,
|
|
46
|
-
options: [
|
|
47
|
-
{ label: "Small", value: "sm" },
|
|
48
|
-
{ label: "Medium", value: "md" },
|
|
49
|
-
{ label: "Large", value: "lg" }
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "sectionBackgroundMode",
|
|
54
|
-
type: "select",
|
|
55
|
-
defaultValue: sectionStyleDefaults.sectionBackgroundMode,
|
|
56
|
-
options: [
|
|
57
|
-
{ label: "None", value: "none" },
|
|
58
|
-
{ label: "Color", value: "color" },
|
|
59
|
-
{ label: "Gradient", value: "gradient" }
|
|
60
|
-
]
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: "sectionBackgroundColor",
|
|
64
|
-
type: "text",
|
|
65
|
-
defaultValue: sectionStyleDefaults.sectionBackgroundColor
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: "sectionGradientPreset",
|
|
69
|
-
type: "select",
|
|
70
|
-
defaultValue: sectionStyleDefaults.sectionGradientPreset,
|
|
71
|
-
options: [
|
|
72
|
-
{ label: "None", value: "none" },
|
|
73
|
-
{ label: "Forest", value: "forest" },
|
|
74
|
-
{ label: "Moss", value: "moss" },
|
|
75
|
-
{ label: "Cream", value: "cream" },
|
|
76
|
-
{ label: "Slate", value: "slate" }
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "sectionGradientFrom",
|
|
81
|
-
type: "text",
|
|
82
|
-
defaultValue: sectionStyleDefaults.sectionGradientFrom
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "sectionGradientTo",
|
|
86
|
-
type: "text",
|
|
87
|
-
defaultValue: sectionStyleDefaults.sectionGradientTo
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "sectionGradientAngle",
|
|
91
|
-
type: "text",
|
|
92
|
-
defaultValue: sectionStyleDefaults.sectionGradientAngle
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "contentBackgroundMode",
|
|
96
|
-
type: "select",
|
|
97
|
-
defaultValue: sectionStyleDefaults.contentBackgroundMode,
|
|
98
|
-
options: [
|
|
99
|
-
{ label: "None", value: "none" },
|
|
100
|
-
{ label: "Color", value: "color" },
|
|
101
|
-
{ label: "Gradient", value: "gradient" }
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: "contentBackgroundColor",
|
|
106
|
-
type: "text",
|
|
107
|
-
defaultValue: sectionStyleDefaults.contentBackgroundColor
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "contentGradientPreset",
|
|
111
|
-
type: "select",
|
|
112
|
-
defaultValue: sectionStyleDefaults.contentGradientPreset,
|
|
113
|
-
options: [
|
|
114
|
-
{ label: "None", value: "none" },
|
|
115
|
-
{ label: "Cloud", value: "cloud" },
|
|
116
|
-
{ label: "Sand", value: "sand" },
|
|
117
|
-
{ label: "Mint", value: "mint" },
|
|
118
|
-
{ label: "Night", value: "night" }
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "contentGradientFrom",
|
|
123
|
-
type: "text",
|
|
124
|
-
defaultValue: sectionStyleDefaults.contentGradientFrom
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: "contentGradientTo",
|
|
128
|
-
type: "text",
|
|
129
|
-
defaultValue: sectionStyleDefaults.contentGradientTo
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: "contentGradientAngle",
|
|
133
|
-
type: "text",
|
|
134
|
-
defaultValue: sectionStyleDefaults.contentGradientAngle
|
|
135
|
-
}
|
|
136
|
-
];
|
|
137
|
-
|
|
138
|
-
export {
|
|
139
|
-
sectionStyleDefaults,
|
|
140
|
-
sectionStyleFields
|
|
141
|
-
};
|
package/dist/chunk-J7W5EE3B.mjs
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__export,
|
|
3
|
-
__require
|
|
4
|
-
} from "./chunk-6BWS3CLP.mjs";
|
|
5
|
-
|
|
6
|
-
// src/admin/index.ts
|
|
7
|
-
var admin_exports = {};
|
|
8
|
-
__export(admin_exports, {
|
|
9
|
-
configureAdmin: () => configureAdmin,
|
|
10
|
-
createThemePreferenceField: () => createThemePreferenceField,
|
|
11
|
-
themePreferenceField: () => themePreferenceField,
|
|
12
|
-
withTooltips: () => withTooltips
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
// src/admin/helpers/configureAdmin.ts
|
|
16
|
-
import fs from "fs";
|
|
17
|
-
import path from "path";
|
|
18
|
-
import { fileURLToPath } from "url";
|
|
19
|
-
|
|
20
|
-
// src/admin/fields/themePreference.ts
|
|
21
|
-
var createThemePreferenceField = (defaultTheme = "brand-light") => ({
|
|
22
|
-
name: "themePreference",
|
|
23
|
-
type: "select",
|
|
24
|
-
defaultValue: defaultTheme,
|
|
25
|
-
options: [
|
|
26
|
-
{ label: "Light", value: "light" },
|
|
27
|
-
{ label: "Dark", value: "dark" },
|
|
28
|
-
{ label: "Brand Light", value: "brand-light" },
|
|
29
|
-
{ label: "Brand Dark", value: "brand-dark" }
|
|
30
|
-
],
|
|
31
|
-
admin: {
|
|
32
|
-
position: "sidebar",
|
|
33
|
-
condition: () => false
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var themePreferenceField = createThemePreferenceField("brand-light");
|
|
37
|
-
|
|
38
|
-
// src/admin/helpers/configureAdmin.ts
|
|
39
|
-
function getPkgDistDir() {
|
|
40
|
-
try {
|
|
41
|
-
if (typeof import.meta?.url === "string") {
|
|
42
|
-
return path.dirname(fileURLToPath(import.meta.url));
|
|
43
|
-
}
|
|
44
|
-
} catch {
|
|
45
|
-
}
|
|
46
|
-
if (typeof __dirname === "string") {
|
|
47
|
-
return __dirname;
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
const pkgJson = __require.resolve("@orion-studios/payload-studio/package.json");
|
|
51
|
-
return path.resolve(path.dirname(pkgJson), "dist");
|
|
52
|
-
} catch {
|
|
53
|
-
return process.cwd();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function configureAdmin(config) {
|
|
57
|
-
const {
|
|
58
|
-
brandName,
|
|
59
|
-
brandPrimary = "#3b82f6",
|
|
60
|
-
brandSecondary = "#8b5cf6",
|
|
61
|
-
defaultTheme = "brand-light",
|
|
62
|
-
logoUrl
|
|
63
|
-
} = config;
|
|
64
|
-
const studioEnabled = Boolean(config.studio?.enabled);
|
|
65
|
-
const pagesCollectionSlug = config.studio?.pages?.collectionSlug || "pages";
|
|
66
|
-
const mediaCollectionSlug = config.studio?.media?.collectionSlug || "media";
|
|
67
|
-
const globals = config.studio?.globals || [
|
|
68
|
-
{ slug: "site-settings", label: "Website Settings" },
|
|
69
|
-
{ slug: "header", label: "Header & Navigation" },
|
|
70
|
-
{ slug: "footer", label: "Footer" }
|
|
71
|
-
];
|
|
72
|
-
let cssPath;
|
|
73
|
-
const pkgDist = getPkgDistDir();
|
|
74
|
-
const sourceCssPath = path.resolve(pkgDist, "admin.css");
|
|
75
|
-
if (config.basePath && fs.existsSync(sourceCssPath)) {
|
|
76
|
-
let css = fs.readFileSync(sourceCssPath, "utf-8");
|
|
77
|
-
css = css.replace("--brand-primary: #3b82f6;", `--brand-primary: ${brandPrimary};`);
|
|
78
|
-
css = css.replace("--brand-secondary: #8b5cf6;", `--brand-secondary: ${brandSecondary};`);
|
|
79
|
-
const genDir = path.resolve(config.basePath, ".generated");
|
|
80
|
-
if (!fs.existsSync(genDir)) {
|
|
81
|
-
fs.mkdirSync(genDir, { recursive: true });
|
|
82
|
-
}
|
|
83
|
-
const genPath = path.resolve(genDir, "admin.css");
|
|
84
|
-
fs.writeFileSync(genPath, css);
|
|
85
|
-
cssPath = genPath;
|
|
86
|
-
} else {
|
|
87
|
-
cssPath = sourceCssPath;
|
|
88
|
-
}
|
|
89
|
-
const clientPath = "@orion-studios/payload-studio/admin/client";
|
|
90
|
-
return {
|
|
91
|
-
admin: {
|
|
92
|
-
css: cssPath,
|
|
93
|
-
components: {
|
|
94
|
-
...studioEnabled ? {
|
|
95
|
-
Nav: {
|
|
96
|
-
exportName: "AdminStudioNav",
|
|
97
|
-
path: clientPath,
|
|
98
|
-
clientProps: {
|
|
99
|
-
brandName,
|
|
100
|
-
logoUrl,
|
|
101
|
-
globalsBasePath: "/admin/studio-globals",
|
|
102
|
-
mediaCollectionSlug,
|
|
103
|
-
pagesCollectionSlug
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
} : {},
|
|
107
|
-
graphics: {
|
|
108
|
-
Logo: {
|
|
109
|
-
exportName: "Logo",
|
|
110
|
-
path: clientPath,
|
|
111
|
-
clientProps: {
|
|
112
|
-
brandName,
|
|
113
|
-
logoUrl
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
Icon: {
|
|
117
|
-
exportName: "Icon",
|
|
118
|
-
path: clientPath,
|
|
119
|
-
clientProps: {
|
|
120
|
-
brandName,
|
|
121
|
-
logoUrl
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
views: {
|
|
126
|
-
dashboard: {
|
|
127
|
-
Component: {
|
|
128
|
-
exportName: studioEnabled ? "AdminStudioDashboard" : "Dashboard",
|
|
129
|
-
path: clientPath,
|
|
130
|
-
clientProps: {
|
|
131
|
-
brandName,
|
|
132
|
-
logoUrl,
|
|
133
|
-
globalsBasePath: "/admin/studio-globals",
|
|
134
|
-
mediaCollectionSlug,
|
|
135
|
-
pagesCollectionSlug
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
...studioEnabled ? {
|
|
140
|
-
studioGlobals: {
|
|
141
|
-
path: "/studio-globals",
|
|
142
|
-
Component: {
|
|
143
|
-
exportName: "AdminStudioGlobalsView",
|
|
144
|
-
path: clientPath,
|
|
145
|
-
clientProps: {
|
|
146
|
-
globals,
|
|
147
|
-
globalsBasePath: "/admin/studio-globals"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
} : {}
|
|
152
|
-
},
|
|
153
|
-
providers: [
|
|
154
|
-
{
|
|
155
|
-
exportName: "ThemeProvider",
|
|
156
|
-
path: clientPath,
|
|
157
|
-
clientProps: {
|
|
158
|
-
defaultTheme
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
],
|
|
162
|
-
afterNavLinks: [
|
|
163
|
-
{
|
|
164
|
-
exportName: "ThemeSwitcher",
|
|
165
|
-
path: clientPath,
|
|
166
|
-
clientProps: {
|
|
167
|
-
defaultTheme
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
meta: {
|
|
173
|
-
titleSuffix: ` \u2014 ${brandName}`
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
brandName,
|
|
177
|
-
brandPrimary,
|
|
178
|
-
brandSecondary,
|
|
179
|
-
defaultTheme,
|
|
180
|
-
wrapUsers(usersCollection) {
|
|
181
|
-
const existingFields = usersCollection.fields || [];
|
|
182
|
-
const hasThemePreference = existingFields.some(
|
|
183
|
-
(field) => typeof field === "object" && field !== null && "name" in field && field.name === "themePreference"
|
|
184
|
-
);
|
|
185
|
-
return {
|
|
186
|
-
...usersCollection,
|
|
187
|
-
fields: hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
|
|
188
|
-
};
|
|
189
|
-
},
|
|
190
|
-
wrapGlobals(globals2) {
|
|
191
|
-
const labelMap = {
|
|
192
|
-
header: { group: "Site Design", label: "Header & Navigation" },
|
|
193
|
-
footer: { group: "Site Design", label: "Footer" },
|
|
194
|
-
"site-settings": { group: "Site Design", label: "Website Settings" }
|
|
195
|
-
};
|
|
196
|
-
return globals2.map((global) => {
|
|
197
|
-
const mapping = labelMap[global.slug];
|
|
198
|
-
if (!mapping) return global;
|
|
199
|
-
return {
|
|
200
|
-
...global,
|
|
201
|
-
admin: {
|
|
202
|
-
...global.admin,
|
|
203
|
-
group: mapping.group
|
|
204
|
-
},
|
|
205
|
-
label: mapping.label
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// src/admin/helpers/withTooltips.ts
|
|
213
|
-
var defaultTooltips = {
|
|
214
|
-
title: "The main title displayed on this page.",
|
|
215
|
-
slug: 'The URL-friendly name for this page (e.g., "about-us"). This appears in the web address.',
|
|
216
|
-
template: "Choose a layout template. This controls the overall structure of the page.",
|
|
217
|
-
parent: "Select a parent page to nest this page under. This affects the URL path.",
|
|
218
|
-
path: "The full URL path for this page. This is automatically generated from the slug and parent.",
|
|
219
|
-
layout: "Add and arrange content sections on your page. Each section is a building block.",
|
|
220
|
-
metaTitle: "The title shown in search engine results and browser tabs. Keep under 60 characters.",
|
|
221
|
-
metaDescription: "A brief summary shown in search results. Keep under 160 characters for best results.",
|
|
222
|
-
canonicalUrl: "The preferred URL for this page. Used to prevent duplicate content in search engines.",
|
|
223
|
-
ogImage: "The image shown when this page is shared on social media (Facebook, LinkedIn, etc.).",
|
|
224
|
-
noIndex: "When enabled, search engines will not list this page in results.",
|
|
225
|
-
noFollow: "When enabled, search engines will not follow links on this page.",
|
|
226
|
-
publishedAt: "The date and time this page was first published.",
|
|
227
|
-
alt: "Describe this image for screen readers and search engines. Be specific and concise.",
|
|
228
|
-
navItems: "The links shown in your website's navigation menu.",
|
|
229
|
-
copyright: "The copyright text displayed in your website footer.",
|
|
230
|
-
contactEmail: "The email address displayed in your footer and contact sections.",
|
|
231
|
-
contactPhone: "The phone number displayed in your footer and contact sections.",
|
|
232
|
-
siteName: "Your website's name. Appears in browser tabs and search results.",
|
|
233
|
-
tagline: "A short phrase describing your business. Used in SEO and site metadata.",
|
|
234
|
-
canonicalBaseUrl: 'The base URL of your website (e.g., "https://example.com"). Used for generating canonical URLs.'
|
|
235
|
-
};
|
|
236
|
-
function withTooltips(fields, customTooltips) {
|
|
237
|
-
const tooltips = { ...defaultTooltips, ...customTooltips };
|
|
238
|
-
return fields.map((field) => addTooltipToField(field, tooltips));
|
|
239
|
-
}
|
|
240
|
-
function addTooltipToField(field, tooltips) {
|
|
241
|
-
if ("name" in field && field.name && tooltips[field.name]) {
|
|
242
|
-
const tooltip = tooltips[field.name];
|
|
243
|
-
const admin = field.admin;
|
|
244
|
-
if (!admin?.description) {
|
|
245
|
-
return {
|
|
246
|
-
...field,
|
|
247
|
-
admin: {
|
|
248
|
-
...admin,
|
|
249
|
-
description: tooltip
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
if ("fields" in field && Array.isArray(field.fields)) {
|
|
255
|
-
return {
|
|
256
|
-
...field,
|
|
257
|
-
fields: field.fields.map((f) => addTooltipToField(f, tooltips))
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
if ("tabs" in field && Array.isArray(field.tabs)) {
|
|
261
|
-
return {
|
|
262
|
-
...field,
|
|
263
|
-
tabs: field.tabs.map((tab) => ({
|
|
264
|
-
...tab,
|
|
265
|
-
fields: tab.fields ? tab.fields.map((f) => addTooltipToField(f, tooltips)) : tab.fields
|
|
266
|
-
}))
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
return field;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export {
|
|
273
|
-
createThemePreferenceField,
|
|
274
|
-
themePreferenceField,
|
|
275
|
-
configureAdmin,
|
|
276
|
-
withTooltips,
|
|
277
|
-
admin_exports
|
|
278
|
-
};
|