@ampless/admin 1.0.0-alpha.74 → 1.0.0-alpha.76
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/dist/{chunk-ECN2MBJN.js → chunk-6MDPOMKE.js} +104 -15
- package/dist/{chunk-O7VJHAYM.js → chunk-IJVACP4G.js} +4 -4
- package/dist/{chunk-GNTGWI43.js → chunk-JUNHTZDL.js} +3 -3
- package/dist/chunk-WUYJ42LP.js +28 -0
- package/dist/{chunk-7ATGSNSZ.js → chunk-WXUHQNZB.js} +3 -3
- package/dist/components/edit-post-view.d.ts +9 -2
- package/dist/components/edit-post-view.js +3 -2
- package/dist/components/index.d.ts +15 -1
- package/dist/components/index.js +7 -6
- package/dist/components/new-post-view.d.ts +9 -1
- package/dist/components/new-post-view.js +3 -2
- package/dist/editor.d.ts +30 -0
- package/dist/editor.js +9 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1 -0
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/index.d.ts +61 -5
- package/dist/pages/index.js +44 -33
- package/package.json +8 -4
package/dist/pages/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MediaPage
|
|
3
|
+
} from "../chunk-HOJJIABL.js";
|
|
1
4
|
import {
|
|
2
5
|
NewPostPage
|
|
3
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-JUNHTZDL.js";
|
|
4
7
|
import {
|
|
5
8
|
PluginSettingsForm
|
|
6
9
|
} from "../chunk-PHV2FQFV.js";
|
|
@@ -15,15 +18,19 @@ import {
|
|
|
15
18
|
} from "../chunk-MPZ3GVZC.js";
|
|
16
19
|
import {
|
|
17
20
|
EditPostPage
|
|
18
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-WXUHQNZB.js";
|
|
19
22
|
import {
|
|
20
23
|
AdminProviders,
|
|
21
24
|
Sidebar,
|
|
22
25
|
SiteSettingsForm,
|
|
23
26
|
ThemeSettingsForm
|
|
24
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-IJVACP4G.js";
|
|
28
|
+
import "../chunk-DSCNWIBN.js";
|
|
25
29
|
import "../chunk-D72XF3Q3.js";
|
|
26
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-6MDPOMKE.js";
|
|
31
|
+
import "../chunk-DDAGBC4N.js";
|
|
32
|
+
import "../chunk-WUYJ42LP.js";
|
|
33
|
+
import "../chunk-2ITWLRYF.js";
|
|
27
34
|
import {
|
|
28
35
|
LoginPage
|
|
29
36
|
} from "../chunk-IR4EB5C3.js";
|
|
@@ -31,12 +38,6 @@ import {
|
|
|
31
38
|
McpTokensView
|
|
32
39
|
} from "../chunk-NI4JSVXL.js";
|
|
33
40
|
import "../chunk-C7G5AQ3L.js";
|
|
34
|
-
import {
|
|
35
|
-
MediaPage
|
|
36
|
-
} from "../chunk-HOJJIABL.js";
|
|
37
|
-
import "../chunk-DSCNWIBN.js";
|
|
38
|
-
import "../chunk-DDAGBC4N.js";
|
|
39
|
-
import "../chunk-2ITWLRYF.js";
|
|
40
41
|
import {
|
|
41
42
|
I18nProvider
|
|
42
43
|
} from "../chunk-DUSEHGSV.js";
|
|
@@ -53,13 +54,14 @@ function sanitizeCmsConfigForClient(config) {
|
|
|
53
54
|
)
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
|
-
function createAdminLayout(admin) {
|
|
57
|
+
function createAdminLayout(admin, opts = {}) {
|
|
58
|
+
const EditorBootstrap = opts.editorBootstrap;
|
|
57
59
|
async function AdminLayout({ children }) {
|
|
58
60
|
const session = await admin.getServerSession();
|
|
59
61
|
if (!admin.isEditor(session)) {
|
|
60
62
|
redirect("/login");
|
|
61
63
|
}
|
|
62
|
-
|
|
64
|
+
const inner = /* @__PURE__ */ jsx(I18nProvider, { locale: admin.locale, dict: admin.dict, children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col md:flex-row", children: [
|
|
63
65
|
/* @__PURE__ */ jsx(
|
|
64
66
|
Sidebar,
|
|
65
67
|
{
|
|
@@ -68,7 +70,8 @@ function createAdminLayout(admin) {
|
|
|
68
70
|
}
|
|
69
71
|
),
|
|
70
72
|
/* @__PURE__ */ jsx("main", { className: "min-w-0 flex-1", children })
|
|
71
|
-
] }) })
|
|
73
|
+
] }) });
|
|
74
|
+
return /* @__PURE__ */ jsx(AdminProviders, { outputs: admin.outputs, cmsConfig: sanitizeCmsConfigForClient(admin.cmsConfig), children: EditorBootstrap ? /* @__PURE__ */ jsx(EditorBootstrap, { children: inner }) : inner });
|
|
72
75
|
}
|
|
73
76
|
return AdminLayout;
|
|
74
77
|
}
|
|
@@ -84,13 +87,21 @@ function createPostsListPage(_admin) {
|
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
// src/pages/post-new.tsx
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
91
|
+
function createNewPostPage(_admin, opts = {}) {
|
|
92
|
+
const { previewEndpoint } = opts;
|
|
93
|
+
return function NewPostPageWrapper() {
|
|
94
|
+
return /* @__PURE__ */ jsx2(NewPostPage, { previewEndpoint });
|
|
95
|
+
};
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
// src/pages/post-edit.tsx
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
100
|
+
function createEditPostPage(_admin, opts = {}) {
|
|
101
|
+
const { previewEndpoint } = opts;
|
|
102
|
+
return function EditPostPageWrapper(props) {
|
|
103
|
+
return /* @__PURE__ */ jsx3(EditPostPage, { ...props, previewEndpoint });
|
|
104
|
+
};
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
// src/pages/media.tsx
|
|
@@ -100,7 +111,7 @@ function createMediaPage(_admin) {
|
|
|
100
111
|
|
|
101
112
|
// src/pages/site-edit.tsx
|
|
102
113
|
import Link from "next/link";
|
|
103
|
-
import { jsx as
|
|
114
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
104
115
|
function createSiteEditPage(admin) {
|
|
105
116
|
const { cmsConfig, t, loadSiteSettings } = admin;
|
|
106
117
|
async function EditSitePage({ params }) {
|
|
@@ -126,8 +137,8 @@ function createSiteEditPage(admin) {
|
|
|
126
137
|
};
|
|
127
138
|
return /* @__PURE__ */ jsxs2("div", { className: "mx-auto max-w-7xl p-4 md:p-8", children: [
|
|
128
139
|
/* @__PURE__ */ jsxs2("div", { className: "mb-6 md:mb-8", children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ jsx4("h1", { className: "mt-2 text-2xl font-bold md:text-3xl", children: settings.site.name }),
|
|
141
|
+
/* @__PURE__ */ jsx4("div", { className: "mt-4", children: /* @__PURE__ */ jsx4(
|
|
131
142
|
Link,
|
|
132
143
|
{
|
|
133
144
|
href: `/admin/sites/${siteId}/theme`,
|
|
@@ -136,7 +147,7 @@ function createSiteEditPage(admin) {
|
|
|
136
147
|
}
|
|
137
148
|
) })
|
|
138
149
|
] }),
|
|
139
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ jsx4(SiteSettingsForm, { initial, fallback })
|
|
140
151
|
] });
|
|
141
152
|
}
|
|
142
153
|
return EditSitePage;
|
|
@@ -145,7 +156,7 @@ function createSiteEditPage(admin) {
|
|
|
145
156
|
// src/pages/site-theme.tsx
|
|
146
157
|
import Link2 from "next/link";
|
|
147
158
|
import { resolveLocalized } from "ampless";
|
|
148
|
-
import { jsx as
|
|
159
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
149
160
|
var POLL_INTERVAL_MS = 1e3;
|
|
150
161
|
var POLL_MAX_ATTEMPTS = 30;
|
|
151
162
|
function createSiteThemePage(admin, themeList) {
|
|
@@ -184,18 +195,18 @@ function createSiteThemePage(admin, themeList) {
|
|
|
184
195
|
]
|
|
185
196
|
}
|
|
186
197
|
),
|
|
187
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ jsx5("h1", { className: "mt-2 text-2xl font-bold md:text-3xl", children: t("theme.title") }),
|
|
188
199
|
/* @__PURE__ */ jsxs3("p", { className: "text-sm text-muted-foreground", children: [
|
|
189
200
|
t("common.active"),
|
|
190
201
|
":",
|
|
191
202
|
" ",
|
|
192
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ jsx5("strong", { children: resolveLocalized(theme.manifest.label, locale) }),
|
|
193
204
|
" (",
|
|
194
205
|
theme.activeTheme,
|
|
195
206
|
")"
|
|
196
207
|
] })
|
|
197
208
|
] }),
|
|
198
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ jsx5(
|
|
199
210
|
ThemeSettingsForm,
|
|
200
211
|
{
|
|
201
212
|
manifest: theme.manifest,
|
|
@@ -213,21 +224,21 @@ function createSiteThemePage(admin, themeList) {
|
|
|
213
224
|
|
|
214
225
|
// src/pages/users-list.tsx
|
|
215
226
|
import { redirect as redirect2 } from "next/navigation";
|
|
216
|
-
import { jsx as
|
|
227
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
217
228
|
function createUsersListPage(admin) {
|
|
218
229
|
async function UsersPage() {
|
|
219
230
|
const session = await admin.getServerSession();
|
|
220
231
|
if (!admin.isAdmin(session)) {
|
|
221
232
|
redirect2("/admin");
|
|
222
233
|
}
|
|
223
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ jsx6(UsersListView, { currentUserId: session.userId });
|
|
224
235
|
}
|
|
225
236
|
return UsersPage;
|
|
226
237
|
}
|
|
227
238
|
|
|
228
239
|
// src/pages/mcp-tokens.tsx
|
|
229
240
|
import { redirect as redirect3 } from "next/navigation";
|
|
230
|
-
import { jsx as
|
|
241
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
231
242
|
function createMcpTokensPage(admin) {
|
|
232
243
|
async function McpTokensPage() {
|
|
233
244
|
const session = await admin.getServerSession();
|
|
@@ -235,7 +246,7 @@ function createMcpTokensPage(admin) {
|
|
|
235
246
|
redirect3("/admin");
|
|
236
247
|
}
|
|
237
248
|
const mcpEndpoint = extractMcpEndpoint(admin.outputs);
|
|
238
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ jsx7(
|
|
239
250
|
McpTokensView,
|
|
240
251
|
{
|
|
241
252
|
currentUserId: session.userId,
|
|
@@ -254,7 +265,7 @@ function extractMcpEndpoint(outputs) {
|
|
|
254
265
|
// src/pages/plugins.tsx
|
|
255
266
|
import { redirect as redirect4 } from "next/navigation";
|
|
256
267
|
import { isValidPluginKey } from "ampless";
|
|
257
|
-
import { jsx as
|
|
268
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
258
269
|
function isPlugin(p) {
|
|
259
270
|
return typeof p === "object" && p !== null && "apiVersion" in p;
|
|
260
271
|
}
|
|
@@ -289,10 +300,10 @@ function createPluginsPage(admin) {
|
|
|
289
300
|
}
|
|
290
301
|
return /* @__PURE__ */ jsxs4("div", { className: "mx-auto max-w-7xl p-4 md:p-8", children: [
|
|
291
302
|
/* @__PURE__ */ jsxs4("div", { className: "mb-6 md:mb-8", children: [
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ jsx8("h1", { className: "text-2xl font-bold md:text-3xl", children: t("plugins.title") }),
|
|
304
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-1 text-sm text-muted-foreground", children: t("plugins.description") })
|
|
294
305
|
] }),
|
|
295
|
-
entries.length === 0 ? /* @__PURE__ */
|
|
306
|
+
entries.length === 0 ? /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: t("plugins.noConfigurablePlugins") }) : /* @__PURE__ */ jsx8("div", { className: "space-y-6", children: entries.map((entry) => /* @__PURE__ */ jsx8(
|
|
296
307
|
PluginSettingsForm,
|
|
297
308
|
{
|
|
298
309
|
instanceId: entry.instanceId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampless/admin",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.76",
|
|
4
4
|
"description": "Admin UI for ampless: post editor, media manager, site/theme settings",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"./components": {
|
|
21
21
|
"import": "./dist/components/index.js",
|
|
22
22
|
"types": "./dist/components/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./editor": {
|
|
25
|
+
"import": "./dist/editor.js",
|
|
26
|
+
"types": "./dist/editor.d.ts"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"files": [
|
|
@@ -61,9 +65,9 @@
|
|
|
61
65
|
"lucide-react": "^1.16.0",
|
|
62
66
|
"react-image-crop": "^11.0.10",
|
|
63
67
|
"tailwind-merge": "^3.6.0",
|
|
64
|
-
"@ampless/mcp-server": "1.0.0-alpha.
|
|
65
|
-
"@ampless/runtime": "1.0.0-alpha.
|
|
66
|
-
"ampless": "1.0.0-alpha.
|
|
68
|
+
"@ampless/mcp-server": "1.0.0-alpha.49",
|
|
69
|
+
"@ampless/runtime": "1.0.0-alpha.52",
|
|
70
|
+
"ampless": "1.0.0-alpha.43"
|
|
67
71
|
},
|
|
68
72
|
"peerDependencies": {
|
|
69
73
|
"@aws-amplify/adapter-nextjs": "^1",
|