@ampless/admin 1.0.0-beta.113 → 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.
Files changed (39) hide show
  1. package/dist/api/index.d.ts +1 -1
  2. package/dist/{chunk-XQAPTM5X.js → chunk-2DB3EDD7.js} +1 -1
  3. package/dist/{chunk-IMWUSMAA.js → chunk-7UEIAZPY.js} +16 -2
  4. package/dist/{chunk-L6CFURU6.js → chunk-GNZZ33OH.js} +1 -1
  5. package/dist/{chunk-DR2HES7B.js → chunk-HEBAGP4Q.js} +288 -146
  6. package/dist/{chunk-CRHOOLCJ.js → chunk-HNI5IJWI.js} +1 -1
  7. package/dist/{chunk-TQUMC5HE.js → chunk-JSJ6OFNB.js} +1 -1
  8. package/dist/{chunk-IYBKPYWB.js → chunk-L3LY5KUM.js} +1 -1
  9. package/dist/{chunk-MQT2ULYX.js → chunk-LSEBYLVJ.js} +2 -2
  10. package/dist/{chunk-4X3HTOYV.js → chunk-OT4JJTAW.js} +1 -1
  11. package/dist/{chunk-N4JBA225.js → chunk-OZ2MSV43.js} +3 -3
  12. package/dist/{chunk-XQNR5GZE.js → chunk-RAAQWTZ2.js} +6 -5
  13. package/dist/{chunk-Q2EB5CFY.js → chunk-RP5YCLR4.js} +1 -1
  14. package/dist/{chunk-TLON56UA.js → chunk-XAEQWVMZ.js} +2 -2
  15. package/dist/{chunk-LE4INBQU.js → chunk-XDV7HADD.js} +6 -5
  16. package/dist/{chunk-CRZNBNEF.js → chunk-XGI3Y5KL.js} +1 -1
  17. package/dist/{chunk-OR6TTYYM.js → chunk-YB2GFJU7.js} +1 -1
  18. package/dist/components/account-view.js +3 -3
  19. package/dist/components/admin-dashboard.js +3 -3
  20. package/dist/components/edit-post-view.d.ts +7 -1
  21. package/dist/components/edit-post-view.js +5 -5
  22. package/dist/components/index.d.ts +1 -1
  23. package/dist/components/index.js +6 -6
  24. package/dist/components/login-view.js +3 -3
  25. package/dist/components/mcp-tokens-view.js +3 -3
  26. package/dist/components/media-view.js +5 -5
  27. package/dist/components/new-post-view.d.ts +7 -1
  28. package/dist/components/new-post-view.js +5 -5
  29. package/dist/components/plugin-settings-form.js +3 -3
  30. package/dist/components/posts-list-view.js +3 -3
  31. package/dist/components/users-list-view.js +3 -3
  32. package/dist/{i18n-CiexA8rJ.d.ts → i18n-Cx6FCYEy.d.ts} +22 -1
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.js +1 -1
  35. package/dist/metafile-esm.json +1 -1
  36. package/dist/pages/index.d.ts +10 -11
  37. package/dist/pages/index.js +45 -24
  38. package/dist/table-classes-context-CQvkORm3.d.ts +12 -0
  39. package/package.json +4 -4
@@ -1,53 +1,53 @@
1
1
  import {
2
2
  McpTokensView
3
- } from "../chunk-XQAPTM5X.js";
3
+ } from "../chunk-2DB3EDD7.js";
4
4
  import {
5
5
  MediaPage
6
- } from "../chunk-TLON56UA.js";
6
+ } from "../chunk-XAEQWVMZ.js";
7
7
  import {
8
8
  NewPostPage
9
- } from "../chunk-XQNR5GZE.js";
9
+ } from "../chunk-RAAQWTZ2.js";
10
10
  import {
11
11
  PluginSettingsForm
12
- } from "../chunk-IYBKPYWB.js";
12
+ } from "../chunk-L3LY5KUM.js";
13
13
  import {
14
14
  PostsList
15
- } from "../chunk-L6CFURU6.js";
15
+ } from "../chunk-GNZZ33OH.js";
16
16
  import {
17
17
  UsersListView
18
- } from "../chunk-Q2EB5CFY.js";
18
+ } from "../chunk-RP5YCLR4.js";
19
19
  import {
20
20
  AccountView
21
- } from "../chunk-CRHOOLCJ.js";
21
+ } from "../chunk-HNI5IJWI.js";
22
22
  import {
23
23
  AdminDashboard
24
- } from "../chunk-4X3HTOYV.js";
24
+ } from "../chunk-OT4JJTAW.js";
25
25
  import {
26
26
  EditPostPage
27
- } from "../chunk-LE4INBQU.js";
27
+ } from "../chunk-XDV7HADD.js";
28
28
  import {
29
29
  AdminProviders,
30
30
  Sidebar,
31
31
  SiteSettingsForm,
32
32
  ThemeSettingsForm
33
- } from "../chunk-N4JBA225.js";
33
+ } from "../chunk-OZ2MSV43.js";
34
34
  import "../chunk-C7G5AQ3L.js";
35
- import "../chunk-MQT2ULYX.js";
35
+ import "../chunk-LSEBYLVJ.js";
36
36
  import "../chunk-D72XF3Q3.js";
37
- import "../chunk-DR2HES7B.js";
38
- import "../chunk-CRZNBNEF.js";
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-OR6TTYYM.js";
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-TQUMC5HE.js";
50
- import "../chunk-IMWUSMAA.js";
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(_admin, opts = {}) {
124
+ function createNewPostPage(admin, opts = {}) {
106
125
  const { previewEndpoint } = opts;
107
- return function NewPostPageWrapper() {
108
- return /* @__PURE__ */ jsx2(NewPostPage, { previewEndpoint });
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(_admin, opts = {}) {
134
+ function createEditPostPage(admin, opts = {}) {
115
135
  const { previewEndpoint } = opts;
116
- return function EditPostPageWrapper(props) {
117
- return /* @__PURE__ */ jsx3(EditPostPage, { ...props, previewEndpoint });
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: resolveLocalized(theme.manifest.label, locale) }),
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.113",
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",
@@ -65,9 +65,9 @@
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.70",
69
- "@ampless/runtime": "1.0.0-beta.78",
70
- "ampless": "1.0.0-beta.63"
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",