@ampless/admin 1.0.0-beta.110 → 1.0.0-beta.114
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/api/index.js +2 -3
- package/dist/{chunk-XQAPTM5X.js → chunk-2DB3EDD7.js} +1 -1
- package/dist/{chunk-IMWUSMAA.js → chunk-7UEIAZPY.js} +16 -2
- package/dist/{chunk-L6CFURU6.js → chunk-GNZZ33OH.js} +1 -1
- package/dist/{chunk-DR2HES7B.js → chunk-HEBAGP4Q.js} +288 -146
- package/dist/{chunk-CRHOOLCJ.js → chunk-HNI5IJWI.js} +1 -1
- package/dist/{chunk-TQUMC5HE.js → chunk-JSJ6OFNB.js} +1 -1
- package/dist/{chunk-IYBKPYWB.js → chunk-L3LY5KUM.js} +1 -1
- package/dist/{chunk-MQT2ULYX.js → chunk-LSEBYLVJ.js} +2 -2
- package/dist/{chunk-4X3HTOYV.js → chunk-OT4JJTAW.js} +1 -1
- package/dist/{chunk-N4JBA225.js → chunk-OZ2MSV43.js} +3 -3
- package/dist/{chunk-XQNR5GZE.js → chunk-RAAQWTZ2.js} +6 -5
- package/dist/{chunk-Q2EB5CFY.js → chunk-RP5YCLR4.js} +1 -1
- package/dist/{chunk-TLON56UA.js → chunk-XAEQWVMZ.js} +2 -2
- package/dist/{chunk-LE4INBQU.js → chunk-XDV7HADD.js} +6 -5
- package/dist/{chunk-CRZNBNEF.js → chunk-XGI3Y5KL.js} +1 -1
- package/dist/{chunk-OR6TTYYM.js → chunk-YB2GFJU7.js} +1 -1
- package/dist/components/account-view.js +3 -3
- package/dist/components/admin-dashboard.js +3 -3
- package/dist/components/edit-post-view.d.ts +7 -1
- 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.d.ts +7 -1
- 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-CiexA8rJ.d.ts → i18n-Cx6FCYEy.d.ts} +22 -1
- 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 +10 -11
- package/dist/pages/index.js +45 -24
- package/dist/table-classes-context-CQvkORm3.d.ts +12 -0
- package/package.json +19 -19
package/dist/pages/index.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import {
|
|
2
2
|
McpTokensView
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-2DB3EDD7.js";
|
|
4
4
|
import {
|
|
5
5
|
MediaPage
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-XAEQWVMZ.js";
|
|
7
7
|
import {
|
|
8
8
|
NewPostPage
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-RAAQWTZ2.js";
|
|
10
10
|
import {
|
|
11
11
|
PluginSettingsForm
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-L3LY5KUM.js";
|
|
13
13
|
import {
|
|
14
14
|
PostsList
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-GNZZ33OH.js";
|
|
16
16
|
import {
|
|
17
17
|
UsersListView
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-RP5YCLR4.js";
|
|
19
19
|
import {
|
|
20
20
|
AccountView
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-HNI5IJWI.js";
|
|
22
22
|
import {
|
|
23
23
|
AdminDashboard
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-OT4JJTAW.js";
|
|
25
25
|
import {
|
|
26
26
|
EditPostPage
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-XDV7HADD.js";
|
|
28
28
|
import {
|
|
29
29
|
AdminProviders,
|
|
30
30
|
Sidebar,
|
|
31
31
|
SiteSettingsForm,
|
|
32
32
|
ThemeSettingsForm
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-OZ2MSV43.js";
|
|
34
34
|
import "../chunk-C7G5AQ3L.js";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-LSEBYLVJ.js";
|
|
36
36
|
import "../chunk-D72XF3Q3.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-HEBAGP4Q.js";
|
|
38
|
+
import "../chunk-XGI3Y5KL.js";
|
|
39
39
|
import "../chunk-PCPXAEBG.js";
|
|
40
40
|
import "../chunk-2ITWLRYF.js";
|
|
41
41
|
import {
|
|
42
42
|
LoginPage
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-YB2GFJU7.js";
|
|
44
44
|
import {
|
|
45
45
|
isWebAuthnEnabled
|
|
46
46
|
} from "../chunk-ZDIDJCSU.js";
|
|
47
47
|
import {
|
|
48
48
|
I18nProvider
|
|
49
|
-
} from "../chunk-
|
|
50
|
-
import "../chunk-
|
|
49
|
+
} from "../chunk-JSJ6OFNB.js";
|
|
50
|
+
import "../chunk-7UEIAZPY.js";
|
|
51
51
|
|
|
52
52
|
// src/pages/admin-layout.tsx
|
|
53
53
|
import { redirect } from "next/navigation";
|
|
@@ -100,21 +100,42 @@ function createPostsListPage(_admin) {
|
|
|
100
100
|
return PostsList;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
// src/pages/table-classes.ts
|
|
104
|
+
import { resolveLocalized, themeTableClasses } from "ampless";
|
|
105
|
+
async function loadEditorTableClasses(admin) {
|
|
106
|
+
const a = admin ?? {};
|
|
107
|
+
if (typeof a.loadThemeConfig !== "function") return [];
|
|
108
|
+
try {
|
|
109
|
+
const { manifest } = await a.loadThemeConfig();
|
|
110
|
+
const locale = typeof a.locale === "string" ? a.locale : "en";
|
|
111
|
+
return themeTableClasses(manifest).map((c) => {
|
|
112
|
+
const out = { id: c.id, label: resolveLocalized(c.label, locale) || c.id };
|
|
113
|
+
if (c.description) out.description = resolveLocalized(c.description, locale);
|
|
114
|
+
return out;
|
|
115
|
+
});
|
|
116
|
+
} catch (err) {
|
|
117
|
+
console.error("[ampless admin] could not load the active theme for table styles; the editor offers none", err);
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
103
122
|
// src/pages/post-new.tsx
|
|
104
123
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
105
|
-
function createNewPostPage(
|
|
124
|
+
function createNewPostPage(admin, opts = {}) {
|
|
106
125
|
const { previewEndpoint } = opts;
|
|
107
|
-
return function NewPostPageWrapper() {
|
|
108
|
-
|
|
126
|
+
return async function NewPostPageWrapper() {
|
|
127
|
+
const tableClasses = await loadEditorTableClasses(admin);
|
|
128
|
+
return /* @__PURE__ */ jsx2(NewPostPage, { previewEndpoint, tableClasses });
|
|
109
129
|
};
|
|
110
130
|
}
|
|
111
131
|
|
|
112
132
|
// src/pages/post-edit.tsx
|
|
113
133
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
114
|
-
function createEditPostPage(
|
|
134
|
+
function createEditPostPage(admin, opts = {}) {
|
|
115
135
|
const { previewEndpoint } = opts;
|
|
116
|
-
return function EditPostPageWrapper(props) {
|
|
117
|
-
|
|
136
|
+
return async function EditPostPageWrapper(props) {
|
|
137
|
+
const tableClasses = await loadEditorTableClasses(admin);
|
|
138
|
+
return /* @__PURE__ */ jsx3(EditPostPage, { ...props, previewEndpoint, tableClasses });
|
|
118
139
|
};
|
|
119
140
|
}
|
|
120
141
|
|
|
@@ -169,7 +190,7 @@ function createSiteEditPage(admin) {
|
|
|
169
190
|
|
|
170
191
|
// src/pages/site-theme.tsx
|
|
171
192
|
import Link2 from "next/link";
|
|
172
|
-
import { resolveLocalized } from "ampless";
|
|
193
|
+
import { resolveLocalized as resolveLocalized2 } from "ampless";
|
|
173
194
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
174
195
|
var POLL_INTERVAL_MS = 1e3;
|
|
175
196
|
var POLL_MAX_ATTEMPTS = 30;
|
|
@@ -214,7 +235,7 @@ function createSiteThemePage(admin, themeList) {
|
|
|
214
235
|
t("common.active"),
|
|
215
236
|
":",
|
|
216
237
|
" ",
|
|
217
|
-
/* @__PURE__ */ jsx5("strong", { children:
|
|
238
|
+
/* @__PURE__ */ jsx5("strong", { children: resolveLocalized2(theme.manifest.label, locale) }),
|
|
218
239
|
" (",
|
|
219
240
|
theme.activeTheme,
|
|
220
241
|
")"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A table custom class the active theme declares (ThemeManifest.customClasses
|
|
3
|
+
* with target 'table'), with its label already resolved for the admin locale.
|
|
4
|
+
* Serializable so the server page factory can pass it to the client editor.
|
|
5
|
+
*/
|
|
6
|
+
interface EditorTableClass {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type { EditorTableClass as E };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampless/admin",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.114",
|
|
4
4
|
"description": "Admin UI for ampless: post editor, media manager, site/theme settings",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,30 +44,30 @@
|
|
|
44
44
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
45
45
|
"@radix-ui/react-label": "^2.1.8",
|
|
46
46
|
"@radix-ui/react-slot": "^1.2.4",
|
|
47
|
-
"@tiptap/core": "^3.
|
|
48
|
-
"@tiptap/extension-highlight": "^3.
|
|
49
|
-
"@tiptap/extension-image": "^3.
|
|
50
|
-
"@tiptap/extension-link": "^3.
|
|
51
|
-
"@tiptap/extension-table": "^3.
|
|
52
|
-
"@tiptap/extension-table-cell": "^3.
|
|
53
|
-
"@tiptap/extension-table-header": "^3.
|
|
54
|
-
"@tiptap/extension-table-row": "^3.
|
|
55
|
-
"@tiptap/extension-task-item": "^3.
|
|
56
|
-
"@tiptap/extension-task-list": "^3.
|
|
57
|
-
"@tiptap/extension-text-align": "^3.
|
|
58
|
-
"@tiptap/extension-underline": "^3.
|
|
59
|
-
"@tiptap/pm": "^3.
|
|
60
|
-
"@tiptap/react": "^3.
|
|
61
|
-
"@tiptap/starter-kit": "^3.
|
|
47
|
+
"@tiptap/core": "^3.30.5",
|
|
48
|
+
"@tiptap/extension-highlight": "^3.30.5",
|
|
49
|
+
"@tiptap/extension-image": "^3.30.5",
|
|
50
|
+
"@tiptap/extension-link": "^3.30.5",
|
|
51
|
+
"@tiptap/extension-table": "^3.30.5",
|
|
52
|
+
"@tiptap/extension-table-cell": "^3.30.5",
|
|
53
|
+
"@tiptap/extension-table-header": "^3.30.5",
|
|
54
|
+
"@tiptap/extension-table-row": "^3.30.5",
|
|
55
|
+
"@tiptap/extension-task-item": "^3.30.5",
|
|
56
|
+
"@tiptap/extension-task-list": "^3.30.5",
|
|
57
|
+
"@tiptap/extension-text-align": "^3.30.5",
|
|
58
|
+
"@tiptap/extension-underline": "^3.30.5",
|
|
59
|
+
"@tiptap/pm": "^3.30.5",
|
|
60
|
+
"@tiptap/react": "^3.30.5",
|
|
61
|
+
"@tiptap/starter-kit": "^3.30.5",
|
|
62
62
|
"class-variance-authority": "^0.7.1",
|
|
63
63
|
"clsx": "^2.1.1",
|
|
64
64
|
"jszip": "^3.10.1",
|
|
65
65
|
"lucide-react": "^1.16.0",
|
|
66
66
|
"react-image-crop": "^11.0.10",
|
|
67
67
|
"tailwind-merge": "^3.6.0",
|
|
68
|
-
"@ampless/mcp-server": "1.0.0-beta.
|
|
69
|
-
"@ampless/runtime": "1.0.0-beta.
|
|
70
|
-
"ampless": "1.0.0-beta.
|
|
68
|
+
"@ampless/mcp-server": "1.0.0-beta.71",
|
|
69
|
+
"@ampless/runtime": "1.0.0-beta.79",
|
|
70
|
+
"ampless": "1.0.0-beta.64"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@aws-amplify/adapter-nextjs": "^1",
|