@ampless/admin 1.0.0-beta.91 → 1.0.0-beta.93

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-4YVI7TI4.js → chunk-26ZRUSES.js} +2 -2
  3. package/dist/{chunk-ZHOVAVUK.js → chunk-2GFTMGIZ.js} +1 -1
  4. package/dist/{chunk-TSPYGLX3.js → chunk-4UIDGQ2L.js} +12 -2
  5. package/dist/{chunk-6PAJSUMF.js → chunk-5KUAGEQW.js} +1 -1
  6. package/dist/{chunk-R5CWAZEY.js → chunk-5L2ICOCA.js} +1 -1
  7. package/dist/{chunk-7VF6F2P5.js → chunk-6EGOUZXY.js} +4 -4
  8. package/dist/{chunk-2ND3UUVK.js → chunk-ASEYWSR6.js} +2 -2
  9. package/dist/{chunk-2SYDNTEW.js → chunk-BU7YQ5MS.js} +1 -1
  10. package/dist/{chunk-B7DJVPO3.js → chunk-ISE2LXLA.js} +3 -3
  11. package/dist/{chunk-CU3CL5DB.js → chunk-JTPEKM5J.js} +11 -6
  12. package/dist/{chunk-ZDKVGJ4F.js → chunk-LHHWZQDN.js} +2 -2
  13. package/dist/{chunk-T3UDPN3W.js → chunk-P7NMQTSQ.js} +1 -1
  14. package/dist/{chunk-YGGBEDUG.js → chunk-PQU342OC.js} +1 -1
  15. package/dist/{chunk-CH2BLQD7.js → chunk-QTU63B4K.js} +2 -2
  16. package/dist/{chunk-QOUZDIVS.js → chunk-TDXYTNZB.js} +283 -213
  17. package/dist/{chunk-MOXQLS3E.js → chunk-UYT6WMWV.js} +1 -1
  18. package/dist/{chunk-36MRQN3G.js → chunk-ZDIDJCSU.js} +6 -1
  19. package/dist/components/account-view.d.ts +2 -1
  20. package/dist/components/account-view.js +4 -4
  21. package/dist/components/admin-dashboard.js +3 -3
  22. package/dist/components/edit-post-view.js +5 -5
  23. package/dist/components/index.d.ts +1 -1
  24. package/dist/components/index.js +6 -6
  25. package/dist/components/login-view.d.ts +3 -1
  26. package/dist/components/login-view.js +4 -4
  27. package/dist/components/mcp-tokens-view.js +3 -3
  28. package/dist/components/media-view.js +5 -5
  29. package/dist/components/new-post-view.js +5 -5
  30. package/dist/components/plugin-settings-form.js +3 -3
  31. package/dist/components/posts-list-view.js +3 -3
  32. package/dist/components/users-list-view.js +3 -3
  33. package/dist/{i18n-DiA-HQ9_.d.ts → i18n-BOuZ2Yhb.d.ts} +16 -1
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js +1 -1
  36. package/dist/metafile-esm.json +1 -1
  37. package/dist/pages/index.d.ts +11 -5
  38. package/dist/pages/index.js +27 -20
  39. package/package.json +3 -3
@@ -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-DiA-HQ9_.js';
5
+ import '../i18n-BOuZ2Yhb.js';
6
6
  import '@aws-amplify/adapter-nextjs';
7
7
 
8
8
  /**
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import {
3
3
  MediaUploader
4
- } from "./chunk-CH2BLQD7.js";
4
+ } from "./chunk-QTU63B4K.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-ZHOVAVUK.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-TSPYGLX3.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: {
@@ -410,7 +414,8 @@ var en_default = {
410
414
  delete: "Delete",
411
415
  deleteConfirm: "Delete this passkey? You will no longer be able to sign in with it.",
412
416
  loadError: "Failed to load passkeys",
413
- unsupported: "This browser does not support passkeys."
417
+ unsupported: "This browser does not support passkeys.",
418
+ disabled: "Passkeys are disabled for this site."
414
419
  }
415
420
  }
416
421
  };
@@ -695,6 +700,10 @@ var ja_default = {
695
700
  deleteColumn: "\u5217\u3092\u524A\u9664",
696
701
  toggleHeaderRow: "\u30D8\u30C3\u30C0\u30FC\u884C\u3092\u5207\u66FF",
697
702
  deleteTable: "\u30C6\u30FC\u30D6\u30EB\u3092\u524A\u9664"
703
+ },
704
+ codeBlock: {
705
+ languageLabel: "\u8A00\u8A9E",
706
+ languagePlaceholder: "\u4F8B: mermaid, ts"
698
707
  }
699
708
  },
700
709
  auth: {
@@ -827,7 +836,8 @@ var ja_default = {
827
836
  delete: "\u524A\u9664",
828
837
  deleteConfirm: "\u3053\u306E\u30D1\u30B9\u30AD\u30FC\u3092\u524A\u9664\u3057\u307E\u3059\u304B? \u3053\u306E\u30D1\u30B9\u30AD\u30FC\u3067\u306F\u30B5\u30A4\u30F3\u30A4\u30F3\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",
829
838
  loadError: "\u30D1\u30B9\u30AD\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
830
- unsupported: "\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u306F\u30D1\u30B9\u30AD\u30FC\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002"
839
+ unsupported: "\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u306F\u30D1\u30B9\u30AD\u30FC\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",
840
+ disabled: "\u3053\u306E\u30B5\u30A4\u30C8\u3067\u306F\u30D1\u30B9\u30AD\u30FC\u306F\u7121\u52B9\u3067\u3059\u3002"
831
841
  }
832
842
  }
833
843
  };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useT
4
- } from "./chunk-ZHOVAVUK.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-ZHOVAVUK.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/lib/upload.ts
10
10
  import { uploadData } from "aws-amplify/storage";
@@ -3,10 +3,10 @@ import {
3
3
  classifyPasskeyError,
4
4
  isWebAuthnSupported,
5
5
  signInWithPasskey
6
- } from "./chunk-36MRQN3G.js";
6
+ } from "./chunk-ZDIDJCSU.js";
7
7
  import {
8
8
  useT
9
- } from "./chunk-ZHOVAVUK.js";
9
+ } from "./chunk-2GFTMGIZ.js";
10
10
 
11
11
  // src/components/login-view.tsx
12
12
  import { useEffect, useRef, useState } from "react";
@@ -31,7 +31,7 @@ import {
31
31
  } from "@ampless/runtime/ui";
32
32
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
33
33
  var LAST_EMAIL_KEY = "ampless.lastSignInEmail";
34
- function LoginPage() {
34
+ function LoginPage({ passkeysEnabled = true }) {
35
35
  const router = useRouter();
36
36
  const t = useT();
37
37
  const [mode, setMode] = useState("signIn");
@@ -201,7 +201,7 @@ function LoginPage() {
201
201
  info && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: info }),
202
202
  error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: error }),
203
203
  /* @__PURE__ */ jsx(Button, { type: "submit", className: "w-full", disabled: loading, children: loading ? t("auth.common.working") : t(`auth.${mode}.submit`) }),
204
- mode === "signIn" && passkeySupported && /* @__PURE__ */ jsxs(
204
+ mode === "signIn" && passkeysEnabled && passkeySupported && /* @__PURE__ */ jsxs(
205
205
  Button,
206
206
  {
207
207
  type: "button",
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import {
3
3
  PostForm
4
- } from "./chunk-QOUZDIVS.js";
4
+ } from "./chunk-TDXYTNZB.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-ZHOVAVUK.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-ZHOVAVUK.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-QOUZDIVS.js";
10
+ } from "./chunk-TDXYTNZB.js";
11
11
  import {
12
12
  setAdminCmsConfigClient
13
- } from "./chunk-R5CWAZEY.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-ZHOVAVUK.js";
20
+ } from "./chunk-2GFTMGIZ.js";
21
21
 
22
22
  // src/lib/amplify-client.ts
23
23
  import { Amplify } from "aws-amplify";
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import {
3
3
  isWebAuthnSupported
4
- } from "./chunk-36MRQN3G.js";
4
+ } from "./chunk-ZDIDJCSU.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-ZHOVAVUK.js";
7
+ } from "./chunk-2GFTMGIZ.js";
8
8
 
9
9
  // src/components/account-view.tsx
10
10
  import { useEffect, useState } from "react";
@@ -67,7 +67,7 @@ function formatDate(iso) {
67
67
  if (Number.isNaN(d.getTime())) return "";
68
68
  return d.toLocaleString();
69
69
  }
70
- function AccountView({ currentUserEmail }) {
70
+ function AccountView({ currentUserEmail, passkeysEnabled }) {
71
71
  const t = useT();
72
72
  const [supported, setSupported] = useState(false);
73
73
  const [supportResolved, setSupportResolved] = useState(false);
@@ -90,12 +90,17 @@ function AccountView({ currentUserEmail }) {
90
90
  }
91
91
  }
92
92
  useEffect(() => {
93
+ if (!passkeysEnabled) {
94
+ setSupportResolved(true);
95
+ setLoading(false);
96
+ return;
97
+ }
93
98
  const ok = isWebAuthnSupported();
94
99
  setSupported(ok);
95
100
  setSupportResolved(true);
96
101
  if (ok) void loadPasskeys();
97
102
  else setLoading(false);
98
- }, []);
103
+ }, [passkeysEnabled]);
99
104
  async function handleAdd() {
100
105
  setAdding(true);
101
106
  setAddError(null);
@@ -127,10 +132,10 @@ function AccountView({ currentUserEmail }) {
127
132
  /* @__PURE__ */ jsxs("section", { className: "space-y-4 rounded-md border bg-card p-4 md:p-6", children: [
128
133
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
129
134
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", children: t("account.passkeys.title") }) }),
130
- supportResolved && supported && /* @__PURE__ */ jsx(Button, { type: "button", disabled: adding, onClick: () => void handleAdd(), children: adding ? t("account.passkeys.adding") : t("account.passkeys.add") })
135
+ passkeysEnabled && supportResolved && supported && /* @__PURE__ */ jsx(Button, { type: "button", disabled: adding, onClick: () => void handleAdd(), children: adding ? t("account.passkeys.adding") : t("account.passkeys.add") })
131
136
  ] }),
132
137
  addError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: addError }),
133
- supportResolved && !supported ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("account.passkeys.unsupported") }) : loading ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("account.passkeys.loading") }) : loadError ? /* @__PURE__ */ jsxs("p", { className: "text-sm text-destructive", children: [
138
+ !passkeysEnabled ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("account.passkeys.disabled") }) : supportResolved && !supported ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("account.passkeys.unsupported") }) : loading ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("account.passkeys.loading") }) : loadError ? /* @__PURE__ */ jsxs("p", { className: "text-sm text-destructive", children: [
134
139
  t("account.passkeys.loadError"),
135
140
  ": ",
136
141
  loadError
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import {
3
3
  PostForm
4
- } from "./chunk-QOUZDIVS.js";
4
+ } from "./chunk-TDXYTNZB.js";
5
5
  import {
6
6
  useT
7
- } from "./chunk-ZHOVAVUK.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-ZHOVAVUK.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-ZHOVAVUK.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-R5CWAZEY.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-ZHOVAVUK.js";
12
+ } from "./chunk-2GFTMGIZ.js";
13
13
 
14
14
  // src/components/media-uploader.tsx
15
15
  import { useState, useEffect, useCallback, useRef } from "react";