@ampless/admin 1.0.0-beta.92 → 1.0.0-beta.94

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 (37) hide show
  1. package/dist/api/index.d.ts +1 -1
  2. package/dist/api/index.js +4 -2
  3. package/dist/{chunk-FVHQJCH4.js → chunk-26ZRUSES.js} +2 -2
  4. package/dist/{chunk-IBFNFTJ6.js → chunk-2GFTMGIZ.js} +1 -1
  5. package/dist/{chunk-M5QQJHM7.js → chunk-4UIDGQ2L.js} +8 -0
  6. package/dist/{chunk-TMOFUAU7.js → chunk-5KUAGEQW.js} +1 -1
  7. package/dist/{chunk-6275N7HG.js → chunk-5L2ICOCA.js} +1 -1
  8. package/dist/{chunk-2Y5SRSCZ.js → chunk-6EGOUZXY.js} +1 -1
  9. package/dist/{chunk-OPHSYQQV.js → chunk-ASEYWSR6.js} +2 -2
  10. package/dist/{chunk-OAG4NI7Q.js → chunk-BU7YQ5MS.js} +1 -1
  11. package/dist/{chunk-FVGWVH6Q.js → chunk-ISE2LXLA.js} +3 -3
  12. package/dist/{chunk-VJ5SDYVW.js → chunk-JTPEKM5J.js} +1 -1
  13. package/dist/{chunk-HRCUFIGW.js → chunk-LHHWZQDN.js} +2 -2
  14. package/dist/{chunk-HKMHNEFV.js → chunk-P7NMQTSQ.js} +1 -1
  15. package/dist/{chunk-QO73C7VC.js → chunk-PQU342OC.js} +1 -1
  16. package/dist/{chunk-TEMSFG34.js → chunk-QTU63B4K.js} +2 -2
  17. package/dist/{chunk-UUZAKCZZ.js → chunk-TDXYTNZB.js} +283 -213
  18. package/dist/{chunk-3AQGYUVP.js → chunk-UYT6WMWV.js} +1 -1
  19. package/dist/components/account-view.js +3 -3
  20. package/dist/components/admin-dashboard.js +3 -3
  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.js +5 -5
  28. package/dist/components/plugin-settings-form.js +3 -3
  29. package/dist/components/posts-list-view.js +3 -3
  30. package/dist/components/users-list-view.js +3 -3
  31. package/dist/{i18n-CecqYBeP.d.ts → i18n-BOuZ2Yhb.d.ts} +12 -0
  32. package/dist/index.d.ts +2 -2
  33. package/dist/index.js +1 -1
  34. package/dist/metafile-esm.json +1 -1
  35. package/dist/pages/index.d.ts +1 -1
  36. package/dist/pages/index.js +21 -21
  37. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { NextRequest } from 'next/server';
2
2
  import { Admin } from '../index.js';
3
3
  import 'ampless';
4
4
  import '@ampless/runtime';
5
- import '../i18n-CecqYBeP.js';
5
+ import '../i18n-BOuZ2Yhb.js';
6
6
  import '@aws-amplify/adapter-nextjs';
7
7
 
8
8
  /**
package/dist/api/index.js CHANGED
@@ -58,7 +58,7 @@ async function signMediaUrl({
58
58
 
59
59
  // src/api/preview-route.tsx
60
60
  import { renderThemeCss } from "@ampless/runtime";
61
- import { Fragment, jsxs } from "react/jsx-runtime";
61
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
62
62
  var PREVIEW_BASE_CSS = `
63
63
  /* ampless admin preview \u2014 typography approximation */
64
64
  *,
@@ -250,8 +250,10 @@ function createPreviewRouteHandler(admin, options = {}) {
250
250
  await ampless.renderBody(draft),
251
251
  await ampless.publicPostScriptsForPage([draft])
252
252
  ] });
253
+ const headNode = await ampless.publicHeadForPreview();
253
254
  const { renderToStaticMarkup } = await import("react-dom/server");
254
255
  const fragment = renderToStaticMarkup(node);
256
+ const headMarkup = headNode ? renderToStaticMarkup(/* @__PURE__ */ jsx(Fragment, { children: headNode })) : "";
255
257
  let themeCssBlock = "";
256
258
  try {
257
259
  const themeConfig = await admin.loadThemeConfig();
@@ -260,7 +262,7 @@ function createPreviewRouteHandler(admin, options = {}) {
260
262
  } catch (err) {
261
263
  console.warn("[ampless admin] preview theme CSS unavailable:", err);
262
264
  }
263
- const html = `<!doctype html><html><head><meta charset="utf-8">` + (themeCssBlock ? `<style>${themeCssBlock}</style>` : "") + `<style id="ampless-preview-base">${PREVIEW_BASE_CSS}</style></head><body class="ampless-preview"><main class="${bodyClassName}">${fragment}</main></body></html>`;
265
+ const html = `<!doctype html><html><head><meta charset="utf-8">` + (themeCssBlock ? `<style>${themeCssBlock}</style>` : "") + `<style id="ampless-preview-base">${PREVIEW_BASE_CSS}</style>` + headMarkup + `</head><body class="ampless-preview"><main class="${bodyClassName}">${fragment}</main></body></html>`;
264
266
  return new Response(html, {
265
267
  headers: {
266
268
  "Content-Type": "text/html; charset=utf-8",
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import {
3
3
  MediaUploader
4
- } from "./chunk-TEMSFG34.js";
4
+ } from "./chunk-QTU63B4K.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-IBFNFTJ6.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/components/media-view.tsx
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  translate
4
- } from "./chunk-M5QQJHM7.js";
4
+ } from "./chunk-4UIDGQ2L.js";
5
5
 
6
6
  // src/components/i18n-provider.tsx
7
7
  import { createContext, useContext, useMemo } from "react";
@@ -278,6 +278,10 @@ var en_default = {
278
278
  deleteColumn: "Delete column",
279
279
  toggleHeaderRow: "Toggle header row",
280
280
  deleteTable: "Delete table"
281
+ },
282
+ codeBlock: {
283
+ languageLabel: "Language",
284
+ languagePlaceholder: "e.g. mermaid, ts"
281
285
  }
282
286
  },
283
287
  auth: {
@@ -696,6 +700,10 @@ var ja_default = {
696
700
  deleteColumn: "\u5217\u3092\u524A\u9664",
697
701
  toggleHeaderRow: "\u30D8\u30C3\u30C0\u30FC\u884C\u3092\u5207\u66FF",
698
702
  deleteTable: "\u30C6\u30FC\u30D6\u30EB\u3092\u524A\u9664"
703
+ },
704
+ codeBlock: {
705
+ languageLabel: "\u8A00\u8A9E",
706
+ languagePlaceholder: "\u4F8B: mermaid, ts"
699
707
  }
700
708
  },
701
709
  auth: {
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useT
4
- } from "./chunk-IBFNFTJ6.js";
4
+ } from "./chunk-2GFTMGIZ.js";
5
5
 
6
6
  // src/components/posts-list-view.tsx
7
7
  import { useEffect, useMemo, useState } from "react";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-2ITWLRYF.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-IBFNFTJ6.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/lib/upload.ts
10
10
  import { uploadData } from "aws-amplify/storage";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-ZDIDJCSU.js";
7
7
  import {
8
8
  useT
9
- } from "./chunk-IBFNFTJ6.js";
9
+ } from "./chunk-2GFTMGIZ.js";
10
10
 
11
11
  // src/components/login-view.tsx
12
12
  import { useEffect, useRef, useState } from "react";
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import {
3
3
  PostForm
4
- } from "./chunk-UUZAKCZZ.js";
4
+ } from "./chunk-TDXYTNZB.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-IBFNFTJ6.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/components/new-post-view.tsx
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useT
4
- } from "./chunk-IBFNFTJ6.js";
4
+ } from "./chunk-2GFTMGIZ.js";
5
5
 
6
6
  // src/components/users-list-view.tsx
7
7
  import { useEffect, useState } from "react";
@@ -7,17 +7,17 @@ import {
7
7
  } from "./chunk-D72XF3Q3.js";
8
8
  import {
9
9
  clearAllDrafts
10
- } from "./chunk-UUZAKCZZ.js";
10
+ } from "./chunk-TDXYTNZB.js";
11
11
  import {
12
12
  setAdminCmsConfigClient
13
- } from "./chunk-6275N7HG.js";
13
+ } from "./chunk-5L2ICOCA.js";
14
14
  import {
15
15
  setAdminMediaContext
16
16
  } from "./chunk-2ITWLRYF.js";
17
17
  import {
18
18
  useLocale,
19
19
  useT
20
- } from "./chunk-IBFNFTJ6.js";
20
+ } from "./chunk-2GFTMGIZ.js";
21
21
 
22
22
  // src/lib/amplify-client.ts
23
23
  import { Amplify } from "aws-amplify";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-ZDIDJCSU.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-IBFNFTJ6.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/components/account-view.tsx
10
10
  import { useEffect, useState } from "react";
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import {
3
3
  PostForm
4
- } from "./chunk-UUZAKCZZ.js";
4
+ } from "./chunk-TDXYTNZB.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-IBFNFTJ6.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/components/edit-post-view.tsx
10
10
  import { useEffect, useState, use } from "react";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-C7G5AQ3L.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-IBFNFTJ6.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/components/mcp-tokens-view.tsx
10
10
  import { useEffect, useState } from "react";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  useLocale,
7
7
  useT
8
- } from "./chunk-IBFNFTJ6.js";
8
+ } from "./chunk-2GFTMGIZ.js";
9
9
 
10
10
  // src/components/plugin-settings-form.tsx
11
11
  import { useState as useState2, useEffect as useEffect2 } from "react";
@@ -3,13 +3,13 @@ import {
3
3
  ImageUploadDialog,
4
4
  createMediaRow,
5
5
  getMediaProcessingDefaults
6
- } from "./chunk-6275N7HG.js";
6
+ } from "./chunk-5L2ICOCA.js";
7
7
  import {
8
8
  publicMediaUrl
9
9
  } from "./chunk-2ITWLRYF.js";
10
10
  import {
11
11
  useT
12
- } from "./chunk-IBFNFTJ6.js";
12
+ } from "./chunk-2GFTMGIZ.js";
13
13
 
14
14
  // src/components/media-uploader.tsx
15
15
  import { useState, useEffect, useCallback, useRef } from "react";