@abpjs/ui 0.2.0-next.3 → 0.2.0-next.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0-next.5
4
+
5
+ A prerelease under npm's `next` tag: the step-up dialog for AbpGuard 0.7.0's strong step-up and passkeys. Against an
6
+ older AbpGuard nothing changes (no level means the password level).
7
+
8
+ - `StepUpDialog` reads the level the server asks for (`step_up_required` with `level`, `methods`). At `strong`, it
9
+ offers a passkey first when the person has one, or the password with an authenticator code. Asked of someone with no
10
+ strong factor (`strong_factor_required`), it takes the password, then sets up a passkey or the app (QR and key) right
11
+ there, with the recovery codes shown once for a first factor; the call then asks again and they confirm with it.
12
+ - Passkeys in the browser's own JSON both ways (`createPasskey`, `getPasskey`, `passkeysSupported`), with a base64url
13
+ fallback for browsers without `PublicKeyCredential.parse*FromJSON`.
14
+ - `requestStepUp(need)` and `StepUpHandler` take the server's need (`StepUpNeed`, `stepUpNeedOf`). `createHostRequest`
15
+ and `createHostEvents` pass it on and ask again when the server asks for more (a factor set up, then the strong step-up),
16
+ up to three times. `HostRequestInit.stepUp: false` throws a step-up refusal instead of asking (the dialog's own calls).
17
+ `needsStepUp` and `STRONG_FACTOR_REQUIRED` beside `isStepUp`.
18
+ - `createHostEvents` asks the step-up dialog by default, as `createHostRequest` does.
19
+
20
+ ## 0.2.0-next.4
21
+
22
+ A prerelease under npm's `next` tag, for a host's scope page on the `ai` area.
23
+
24
+ - ai: `ai.models.can`'s context names the scope too (`scopeId`), so a host that keeps the connections reads that
25
+ scope's own record of what its models can do on a scope's screen.
26
+ - ai: `AiScopeScreen` takes the host's page `header`, drawn first in its own column, so a host's page keeps one column.
27
+
3
28
  ## 0.2.0-next.3
4
29
 
5
30
  A prerelease under npm's `next` tag. The `ai` area now needs **AbpAi.HttpApi 0.8.0** on the server: stay on next.2
package/dist/ai.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react from 'react';
2
+ import { ReactNode } from 'react';
2
3
  import { SettingsPage, HostRequest } from '@abpjs/ui';
3
4
 
4
5
  /** The site's AI page, with its header: what a host's catch-all route draws for `ai.admin`. */
@@ -31,10 +32,12 @@ declare function AiAdmin(): react.JSX.Element;
31
32
  * A scope's AI, for a host's own scope settings page (its header is the host's), from the scope's view (AbpAi.HttpApi
32
33
  * 0.8.0, for whoever administers the scope): what the site and the scopes above open to it, its own connections'
33
34
  * models while it may have them, its aliases over the ones from above, its limits inside theirs, its usage, and a
34
- * quick call through an alias.
35
+ * quick call through an alias. `header` is the host's page header, drawn first in the screen's own column (and with
36
+ * the error when there's one), so the page reads as one column.
35
37
  */
36
- declare function AiScopeScreen({ scopeId }: {
38
+ declare function AiScopeScreen({ scopeId, header }: {
37
39
  scopeId: string;
40
+ header?: ReactNode;
38
41
  }): react.JSX.Element;
39
42
 
40
43
  interface components {
package/dist/ai.js CHANGED
@@ -949,7 +949,7 @@ function ModelsPanel({ scopeId, connections, rows, loading, hostKeeps, onChanged
949
949
  {
950
950
  id: "can",
951
951
  header: t("can"),
952
- cell: (m) => hostSaysCan ? /* @__PURE__ */ jsx5(HostSlot2, { name: "ai.models.can", context: { connectionId: m.connectionId, modelId: m.modelId } }) : /* @__PURE__ */ jsxs5(HStack4, { gap: "1", flexWrap: "wrap", children: [
952
+ cell: (m) => hostSaysCan ? /* @__PURE__ */ jsx5(HostSlot2, { name: "ai.models.can", context: { connectionId: m.connectionId, modelId: m.modelId, scopeId } }) : /* @__PURE__ */ jsxs5(HStack4, { gap: "1", flexWrap: "wrap", children: [
953
953
  m.tools && /* @__PURE__ */ jsx5(StatusPill2, { tone: "neutral", dot: false, children: t("tools") }),
954
954
  m.images && /* @__PURE__ */ jsx5(StatusPill2, { tone: "neutral", dot: false, children: t("images") }),
955
955
  m.structuredOutput && /* @__PURE__ */ jsx5(StatusPill2, { tone: "neutral", dot: false, children: t("structured") })
@@ -1323,7 +1323,7 @@ import { useMemo as useMemo5 } from "react";
1323
1323
  import { Stack as Stack10, Text as Text8 } from "@chakra-ui/react";
1324
1324
  import { InlineAlert as InlineAlert7, Loading, Panel as Panel8, StatusPill as StatusPill4, TextBone, TextSlot, useApiQuery as useApiQuery4, useNames as useNames3 } from "@abpjs/ui";
1325
1325
  import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
1326
- function AiScopeScreen({ scopeId }) {
1326
+ function AiScopeScreen({ scopeId, header }) {
1327
1327
  const t = useAiTexts();
1328
1328
  const limitText = useLimitText();
1329
1329
  const id = encodeURIComponent(scopeId);
@@ -1348,10 +1348,16 @@ function AiScopeScreen({ scopeId }) {
1348
1348
  }, [v]);
1349
1349
  const scopeNames = useNames3("scopes", useMemo5(() => above.flatMap((g) => g.scopeId ? [g.scopeId] : []), [above]));
1350
1350
  const aliasNames = useMemo5(() => [...new Set([...aliases.data ?? [], ...v?.aliasesFromAbove ?? []].map((x) => x.name))], [aliases.data, v]);
1351
- if (view.error && !v || access.error && !a) return /* @__PURE__ */ jsx10(InlineAlert7, { tone: "danger", children: view.error ?? access.error });
1351
+ if (view.error && !v || access.error && !a) {
1352
+ return /* @__PURE__ */ jsxs10(Stack10, { gap: "section", children: [
1353
+ header,
1354
+ /* @__PURE__ */ jsx10(InlineAlert7, { tone: "danger", children: view.error ?? access.error })
1355
+ ] });
1356
+ }
1352
1357
  const opened = a && (a.allSiteModels ? t("allModels") : a.siteModels.length ? t("someModels", { count: a.siteModels.length }) : t("noModelsOpen"));
1353
1358
  const lines = (list) => !list ? /* @__PURE__ */ jsx10(Text8, { textStyle: "sm", children: /* @__PURE__ */ jsx10(TextBone, { width: 24 }) }) : list.length ? list.map((l) => /* @__PURE__ */ jsx10(Text8, { textStyle: "sm", children: limitText(l) }, l.id)) : /* @__PURE__ */ jsx10(Text8, { textStyle: "sm", color: "fg.muted", children: t("noLimits") });
1354
1359
  return /* @__PURE__ */ jsx10(Loading, { when: !v || !a, children: /* @__PURE__ */ jsxs10(Stack10, { gap: "section", children: [
1360
+ header,
1355
1361
  /* @__PURE__ */ jsx10(Panel8, { title: t("projectAccessTitle"), description: t("projectAccessHint"), "data-testid": "ai-project-access", children: /* @__PURE__ */ jsxs10(Stack10, { gap: "2", children: [
1356
1362
  /* @__PURE__ */ jsx10(Text8, { children: /* @__PURE__ */ jsx10(StatusPill4, { tone: a?.allSiteModels || a?.siteModels.length ? "success" : "neutral", children: opened }) }),
1357
1363
  /* @__PURE__ */ jsx10(Text8, { textStyle: "sm", children: /* @__PURE__ */ jsx10(TextSlot, { width: 44, children: v && (v.mayConnect ? t("ownAllowed") : t("ownNotAllowed")) }) })