@ampless/admin 1.0.0-alpha.69 → 1.0.0-alpha.71
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/api/index.d.ts +1 -1
- package/dist/{chunk-YPZWY7DZ.js → chunk-7ATGSNSZ.js} +2 -2
- package/dist/{chunk-CZQYHUH7.js → chunk-7TAT4AHW.js} +48 -0
- package/dist/{chunk-FTAGUNNZ.js → chunk-DDAGBC4N.js} +5 -1
- package/dist/{chunk-PIULVPF5.js → chunk-DSCNWIBN.js} +2 -2
- package/dist/{chunk-CAGGVZUP.js → chunk-DUSEHGSV.js} +1 -1
- package/dist/{chunk-WE2GQIMF.js → chunk-ECN2MBJN.js} +583 -135
- package/dist/{chunk-3CBZ5FIV.js → chunk-GNTGWI43.js} +2 -2
- package/dist/{chunk-UEX2BIGF.js → chunk-HOJJIABL.js} +2 -2
- package/dist/{chunk-JS4ULHOZ.js → chunk-IR4EB5C3.js} +1 -1
- package/dist/{chunk-WBE6K6WZ.js → chunk-LNX3I35F.js} +1 -1
- package/dist/{chunk-TM7WHB5Q.js → chunk-MPZ3GVZC.js} +1 -1
- package/dist/{chunk-L6U3X7GJ.js → chunk-NI4JSVXL.js} +1 -1
- package/dist/{chunk-DDKBL6N4.js → chunk-O7VJHAYM.js} +43 -3
- package/dist/{chunk-SIQ3B55P.js → chunk-PHV2FQFV.js} +1 -1
- package/dist/{chunk-PAATFYUJ.js → chunk-TBNETGQL.js} +1 -1
- package/dist/components/admin-dashboard.js +3 -3
- package/dist/components/edit-post-view.js +5 -5
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +6 -6
- package/dist/components/login-view.js +3 -3
- package/dist/components/mcp-tokens-view.js +3 -3
- package/dist/components/media-view.js +5 -5
- package/dist/components/new-post-view.js +5 -5
- package/dist/components/plugin-settings-form.js +3 -3
- package/dist/components/posts-list-view.js +3 -3
- package/dist/components/users-list-view.js +3 -3
- package/dist/{i18n-DTN5tkNf.d.ts → i18n-DBNV_Fgf.d.ts} +72 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/index.d.ts +1 -1
- package/dist/pages/index.js +15 -15
- package/package.json +4 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
PostForm
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ECN2MBJN.js";
|
|
5
5
|
import {
|
|
6
6
|
useT
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DUSEHGSV.js";
|
|
8
8
|
|
|
9
9
|
// src/components/new-post-view.tsx
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
MediaUploader
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DSCNWIBN.js";
|
|
5
5
|
import {
|
|
6
6
|
useT
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DUSEHGSV.js";
|
|
8
8
|
|
|
9
9
|
// src/components/media-view.tsx
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
import {
|
|
3
3
|
invalidateSiteSettingsCache
|
|
4
4
|
} from "./chunk-D72XF3Q3.js";
|
|
5
|
+
import {
|
|
6
|
+
clearAllDrafts
|
|
7
|
+
} from "./chunk-ECN2MBJN.js";
|
|
5
8
|
import {
|
|
6
9
|
setMcpTokenStore
|
|
7
10
|
} from "./chunk-C7G5AQ3L.js";
|
|
8
11
|
import {
|
|
9
12
|
setAdminCmsConfigClient
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DDAGBC4N.js";
|
|
11
14
|
import {
|
|
12
15
|
setAdminMediaContext
|
|
13
16
|
} from "./chunk-2ITWLRYF.js";
|
|
14
17
|
import {
|
|
15
18
|
useLocale,
|
|
16
19
|
useT
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DUSEHGSV.js";
|
|
18
21
|
|
|
19
22
|
// src/lib/amplify-client.ts
|
|
20
23
|
import { Amplify } from "aws-amplify";
|
|
@@ -48,7 +51,24 @@ function toCorePost(p) {
|
|
|
48
51
|
status: p.status ?? "draft",
|
|
49
52
|
publishedAt: p.publishedAt ?? void 0,
|
|
50
53
|
tags: (p.tags ?? []).filter((t) => typeof t === "string"),
|
|
51
|
-
metadata: decodeMetadata(p.metadata)
|
|
54
|
+
metadata: decodeMetadata(p.metadata),
|
|
55
|
+
updatedAt: p.updatedAt ?? void 0
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function toCoreRevision(r) {
|
|
59
|
+
return {
|
|
60
|
+
postHistoryId: r.postHistoryId,
|
|
61
|
+
postId: r.postId,
|
|
62
|
+
revisedAt: r.revisedAt,
|
|
63
|
+
title: r.title ?? void 0,
|
|
64
|
+
slug: r.slug ?? void 0,
|
|
65
|
+
excerpt: r.excerpt ?? void 0,
|
|
66
|
+
format: r.format ?? void 0,
|
|
67
|
+
body: decodeAwsJson(r.body),
|
|
68
|
+
status: r.status ?? void 0,
|
|
69
|
+
publishedAt: r.publishedAt ?? void 0,
|
|
70
|
+
tags: (r.tags ?? []).filter((t) => typeof t === "string"),
|
|
71
|
+
metadata: decodeMetadata(r.metadata)
|
|
52
72
|
};
|
|
53
73
|
}
|
|
54
74
|
var installed = false;
|
|
@@ -115,6 +135,25 @@ function installAdminPostsProvider() {
|
|
|
115
135
|
async remove(postId) {
|
|
116
136
|
const { errors } = await client.models.Post.delete({ postId });
|
|
117
137
|
if (errors) throw new Error(errors[0]?.message ?? "Failed to delete post");
|
|
138
|
+
},
|
|
139
|
+
async listPostHistory(postId, options) {
|
|
140
|
+
const { data, nextToken, errors } = await client.models.PostHistory.listByPost(
|
|
141
|
+
{ postId },
|
|
142
|
+
{
|
|
143
|
+
sortDirection: "DESC",
|
|
144
|
+
limit: options?.limit,
|
|
145
|
+
nextToken: options?.nextToken
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
if (errors) {
|
|
149
|
+
throw new Error(errors[0]?.message ?? "Failed to list post history");
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
items: (data ?? []).map(toCoreRevision),
|
|
153
|
+
// Amplify returns `string | null`; the public type is
|
|
154
|
+
// `string | undefined`.
|
|
155
|
+
nextToken: nextToken ?? void 0
|
|
156
|
+
};
|
|
118
157
|
}
|
|
119
158
|
};
|
|
120
159
|
setPostsProvider(provider);
|
|
@@ -386,6 +425,7 @@ function Sidebar({
|
|
|
386
425
|
size: "sm",
|
|
387
426
|
className: "w-full justify-start gap-3",
|
|
388
427
|
onClick: async () => {
|
|
428
|
+
clearAllDrafts();
|
|
389
429
|
await signOut();
|
|
390
430
|
window.location.href = "/login";
|
|
391
431
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
AdminDashboard
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-MPZ3GVZC.js";
|
|
5
|
+
import "../chunk-DUSEHGSV.js";
|
|
6
|
+
import "../chunk-7TAT4AHW.js";
|
|
7
7
|
export {
|
|
8
8
|
AdminDashboard
|
|
9
9
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
EditPostPage
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-7ATGSNSZ.js";
|
|
5
|
+
import "../chunk-ECN2MBJN.js";
|
|
6
|
+
import "../chunk-DDAGBC4N.js";
|
|
7
7
|
import "../chunk-2ITWLRYF.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-DUSEHGSV.js";
|
|
9
|
+
import "../chunk-7TAT4AHW.js";
|
|
10
10
|
export {
|
|
11
11
|
EditPostPage
|
|
12
12
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { L as Locale, D as Dictionary } from '../i18n-
|
|
2
|
+
import { L as Locale, D as Dictionary } from '../i18n-DBNV_Fgf.js';
|
|
3
3
|
import { Config, Post, ThemeManifest, LocalizedString, MediaProcessingDefaults } from 'ampless';
|
|
4
4
|
import { AmplessOutputs, ColorScheme } from '@ampless/runtime';
|
|
5
5
|
import { ProcessOptions } from 'ampless/media';
|
package/dist/components/index.js
CHANGED
|
@@ -4,23 +4,23 @@ import {
|
|
|
4
4
|
Sidebar,
|
|
5
5
|
SiteSettingsForm,
|
|
6
6
|
ThemeSettingsForm
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-O7VJHAYM.js";
|
|
8
8
|
import {
|
|
9
9
|
invalidateSiteSettingsCache
|
|
10
10
|
} from "../chunk-D72XF3Q3.js";
|
|
11
11
|
import {
|
|
12
12
|
MediaPicker,
|
|
13
13
|
PostForm
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-ECN2MBJN.js";
|
|
15
15
|
import "../chunk-C7G5AQ3L.js";
|
|
16
16
|
import {
|
|
17
17
|
MediaUploader
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-DSCNWIBN.js";
|
|
19
19
|
import {
|
|
20
20
|
ImageUploadDialog,
|
|
21
21
|
sanitizeName,
|
|
22
22
|
uploadProcessedImage
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-DDAGBC4N.js";
|
|
24
24
|
import {
|
|
25
25
|
publicMediaUrl,
|
|
26
26
|
setAdminMediaContext
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
I18nProvider,
|
|
30
30
|
useLocale,
|
|
31
31
|
useT
|
|
32
|
-
} from "../chunk-
|
|
33
|
-
import "../chunk-
|
|
32
|
+
} from "../chunk-DUSEHGSV.js";
|
|
33
|
+
import "../chunk-7TAT4AHW.js";
|
|
34
34
|
export {
|
|
35
35
|
AdminProviders,
|
|
36
36
|
I18nProvider,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
LoginPage
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-IR4EB5C3.js";
|
|
5
|
+
import "../chunk-DUSEHGSV.js";
|
|
6
|
+
import "../chunk-7TAT4AHW.js";
|
|
7
7
|
export {
|
|
8
8
|
LoginPage
|
|
9
9
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
McpTokensView
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NI4JSVXL.js";
|
|
5
5
|
import "../chunk-C7G5AQ3L.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-DUSEHGSV.js";
|
|
7
|
+
import "../chunk-7TAT4AHW.js";
|
|
8
8
|
export {
|
|
9
9
|
McpTokensView
|
|
10
10
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
MediaPage
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-HOJJIABL.js";
|
|
5
|
+
import "../chunk-DSCNWIBN.js";
|
|
6
|
+
import "../chunk-DDAGBC4N.js";
|
|
7
7
|
import "../chunk-2ITWLRYF.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-DUSEHGSV.js";
|
|
9
|
+
import "../chunk-7TAT4AHW.js";
|
|
10
10
|
export {
|
|
11
11
|
MediaPage
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
NewPostPage
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-GNTGWI43.js";
|
|
5
|
+
import "../chunk-ECN2MBJN.js";
|
|
6
|
+
import "../chunk-DDAGBC4N.js";
|
|
7
7
|
import "../chunk-2ITWLRYF.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-DUSEHGSV.js";
|
|
9
|
+
import "../chunk-7TAT4AHW.js";
|
|
10
10
|
export {
|
|
11
11
|
NewPostPage
|
|
12
12
|
};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PluginSettingsForm,
|
|
4
4
|
renderScalarInput
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-PHV2FQFV.js";
|
|
6
6
|
import "../chunk-D72XF3Q3.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-DUSEHGSV.js";
|
|
8
|
+
import "../chunk-7TAT4AHW.js";
|
|
9
9
|
export {
|
|
10
10
|
PluginSettingsForm,
|
|
11
11
|
renderScalarInput
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
PostsList
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LNX3I35F.js";
|
|
5
|
+
import "../chunk-DUSEHGSV.js";
|
|
6
|
+
import "../chunk-7TAT4AHW.js";
|
|
7
7
|
export {
|
|
8
8
|
PostsList
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
UsersListView
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-TBNETGQL.js";
|
|
5
|
+
import "../chunk-DUSEHGSV.js";
|
|
6
|
+
import "../chunk-7TAT4AHW.js";
|
|
7
7
|
export {
|
|
8
8
|
UsersListView
|
|
9
9
|
};
|
|
@@ -100,6 +100,30 @@ var posts = {
|
|
|
100
100
|
createPost: "Create post",
|
|
101
101
|
"delete": "Delete",
|
|
102
102
|
deleteConfirm: "Delete \"{title}\"?"
|
|
103
|
+
},
|
|
104
|
+
history: {
|
|
105
|
+
title: "Revision history",
|
|
106
|
+
empty: "No revisions yet. A snapshot is recorded each time you save.",
|
|
107
|
+
columnRevisedAt: "Revised",
|
|
108
|
+
columnStatus: "Status",
|
|
109
|
+
columnTitle: "Title",
|
|
110
|
+
view: "View",
|
|
111
|
+
restore: "Restore",
|
|
112
|
+
restoreConfirm: "Load this revision into the editor? Your current unsaved changes will be replaced. Nothing is saved until you click Save.",
|
|
113
|
+
viewing: "Viewing revision from {date}",
|
|
114
|
+
loadMore: "Load more",
|
|
115
|
+
staticCaveat: "This is a static (bundled) revision. Restoring brings back only the file manifest — the referenced files in S3 may have been overwritten by a later save, so the bundle may not render as it did then."
|
|
116
|
+
},
|
|
117
|
+
draft: {
|
|
118
|
+
recoverTitle: "Restore unsaved changes?",
|
|
119
|
+
recoverBody: "An unsaved local draft from {when} was found in this browser. Restore it into the editor? Nothing is saved until you click Save.",
|
|
120
|
+
staleTitle: "Unsaved draft may be out of date",
|
|
121
|
+
staleBody: "The server version changed since this local draft was taken {when}. Your draft may be based on older content — restoring could overwrite newer edits.",
|
|
122
|
+
restore: "Restore",
|
|
123
|
+
restoreAnyway: "Restore anyway",
|
|
124
|
+
discard: "Discard",
|
|
125
|
+
restored: "Unsaved draft restored. Review and click Save to keep it.",
|
|
126
|
+
staticUnsupported: "Drafts aren't auto-saved for static (bundled) posts."
|
|
103
127
|
}
|
|
104
128
|
};
|
|
105
129
|
var media = {
|
|
@@ -463,6 +487,30 @@ declare const dictionaries: {
|
|
|
463
487
|
delete: string;
|
|
464
488
|
deleteConfirm: string;
|
|
465
489
|
};
|
|
490
|
+
history: {
|
|
491
|
+
title: string;
|
|
492
|
+
empty: string;
|
|
493
|
+
columnRevisedAt: string;
|
|
494
|
+
columnStatus: string;
|
|
495
|
+
columnTitle: string;
|
|
496
|
+
view: string;
|
|
497
|
+
restore: string;
|
|
498
|
+
restoreConfirm: string;
|
|
499
|
+
viewing: string;
|
|
500
|
+
loadMore: string;
|
|
501
|
+
staticCaveat: string;
|
|
502
|
+
};
|
|
503
|
+
draft: {
|
|
504
|
+
recoverTitle: string;
|
|
505
|
+
recoverBody: string;
|
|
506
|
+
staleTitle: string;
|
|
507
|
+
staleBody: string;
|
|
508
|
+
restore: string;
|
|
509
|
+
restoreAnyway: string;
|
|
510
|
+
discard: string;
|
|
511
|
+
restored: string;
|
|
512
|
+
staticUnsupported: string;
|
|
513
|
+
};
|
|
466
514
|
};
|
|
467
515
|
media: {
|
|
468
516
|
title: string;
|
|
@@ -809,6 +857,30 @@ declare const dictionaries: {
|
|
|
809
857
|
delete: string;
|
|
810
858
|
deleteConfirm: string;
|
|
811
859
|
};
|
|
860
|
+
history: {
|
|
861
|
+
title: string;
|
|
862
|
+
empty: string;
|
|
863
|
+
columnRevisedAt: string;
|
|
864
|
+
columnStatus: string;
|
|
865
|
+
columnTitle: string;
|
|
866
|
+
view: string;
|
|
867
|
+
restore: string;
|
|
868
|
+
restoreConfirm: string;
|
|
869
|
+
viewing: string;
|
|
870
|
+
loadMore: string;
|
|
871
|
+
staticCaveat: string;
|
|
872
|
+
};
|
|
873
|
+
draft: {
|
|
874
|
+
recoverTitle: string;
|
|
875
|
+
recoverBody: string;
|
|
876
|
+
staleTitle: string;
|
|
877
|
+
staleBody: string;
|
|
878
|
+
restore: string;
|
|
879
|
+
restoreAnyway: string;
|
|
880
|
+
discard: string;
|
|
881
|
+
restored: string;
|
|
882
|
+
staticUnsupported: string;
|
|
883
|
+
};
|
|
812
884
|
};
|
|
813
885
|
media: {
|
|
814
886
|
title: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Config } from 'ampless';
|
|
2
2
|
import { AmplessOutputs, EffectiveSiteSettings, EffectiveThemeConfig, ResolvedMedia, Ampless } from '@ampless/runtime';
|
|
3
|
-
import { L as Locale, D as Dictionary } from './i18n-
|
|
4
|
-
export { A as AdminLocaleStrings, g as getDictionary, r as resolveLocale, t as translate } from './i18n-
|
|
3
|
+
import { L as Locale, D as Dictionary } from './i18n-DBNV_Fgf.js';
|
|
4
|
+
export { A as AdminLocaleStrings, g as getDictionary, r as resolveLocale, t as translate } from './i18n-DBNV_Fgf.js';
|
|
5
5
|
import * as _aws_amplify_adapter_nextjs from '@aws-amplify/adapter-nextjs';
|
|
6
6
|
|
|
7
7
|
/**
|