@jini-ai/ui 0.6.19 → 0.6.22

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,9 @@
1
1
  # @jini-ai/ui
2
2
 
3
+ ## 0.6.22
4
+
5
+ - `ErrorNotice` in panel-kit: plain words plus Copy details.
6
+
3
7
  ## 0.6.19
4
8
 
5
9
  - A `<provider>.<kind>-chart` entry from `createChartInteractiveRegistry` now draws with the provider it advertises. Components were cached by chart kind only, so with another enabled provider as the site default, `plugin.echarts.bar-chart` could render through that default. The legacy `recharts.*` aliases and `chart.spec` keep generic selection.
@@ -0,0 +1,18 @@
1
+ import type { UserFacingError } from '@jini-ai/core';
2
+ import { type CopyToClipboardOptions } from '../../utils/copy-to-clipboard.js';
3
+ import type { Translate } from '../i18n/index.js';
4
+ /** A formatted failure, optional host translation, and injectable clipboard ports. */
5
+ export interface ErrorNoticeProps extends CopyToClipboardOptions {
6
+ readonly failure: UserFacingError;
7
+ readonly t?: Translate;
8
+ readonly className?: string;
9
+ /** History surfaces use polite announcements; active form failures keep the alert default. */
10
+ readonly role?: "alert" | "status";
11
+ }
12
+ /**
13
+ * Disclose exactly the formatted copy block in native, selectable details. Copying has no recovery effects.
14
+ * Failed writes leave the details available for manual copying; feedback resets with the incident.
15
+ * @complexity O(copyText length) per render/copy; one clipboard write plus the existing fallback on rejection.
16
+ */
17
+ export declare function ErrorNotice({ failure, t, className, role, ...ports }: ErrorNoticeProps): import("react").JSX.Element;
18
+ //# sourceMappingURL=ErrorNotice.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { copyToClipboard } from '../../utils/copy-to-clipboard.js';
4
+ /**
5
+ * Disclose exactly the formatted copy block in native, selectable details. Copying has no recovery effects.
6
+ * Failed writes leave the details available for manual copying; feedback resets with the incident.
7
+ * @complexity O(copyText length) per render/copy; one clipboard write plus the existing fallback on rejection.
8
+ */
9
+ export function ErrorNotice({ failure, t = text => text, className = 'notice error', role = 'alert', ...ports }) {
10
+ const [feedback, setFeedback] = useState(null);
11
+ async function copy() {
12
+ const copied = await copyToClipboard({ text: failure.copyText }, ports);
13
+ setFeedback({ text: failure.copyText, copied });
14
+ }
15
+ return (_jsxs("div", { className: className, role: role, children: [_jsx("p", { children: failure.message }), _jsx("p", { children: failure.action }), _jsxs("details", { children: [_jsx("summary", { children: t('Show details') }), _jsx("pre", { style: { whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', userSelect: 'text' }, children: failure.copyText }), _jsx("button", { type: "button", onClick: () => void copy(), children: t('Copy details') }), feedback && feedback.text === failure.copyText ? _jsx("p", { role: "status", children: t(feedback.copied ? 'Copied' : 'Copy failed. Select the details and copy them manually.') }) : null] })] }));
16
+ }
17
+ //# sourceMappingURL=ErrorNotice.js.map
@@ -1,4 +1,6 @@
1
1
  export * from './fetch-query/index.js';
2
+ export { ErrorNotice } from './ErrorNotice.js';
3
+ export type { ErrorNoticeProps } from './ErrorNotice.js';
2
4
  export { useFocusTrap } from './hooks/use-focus-trap.hooks.js';
3
5
  export { useDirtyGuard } from './hooks/use-dirty-guard.hooks.js';
4
6
  export type { DirtyGuard } from './hooks/use-dirty-guard.hooks.js';
@@ -1,4 +1,5 @@
1
1
  export * from './fetch-query/index.js';
2
+ export { ErrorNotice } from './ErrorNotice.js';
2
3
  export { useFocusTrap } from './hooks/use-focus-trap.hooks.js';
3
4
  export { useDirtyGuard } from './hooks/use-dirty-guard.hooks.js';
4
5
  export { useAsyncAction } from './hooks/use-async-action.hooks.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/ui",
3
- "version": "0.6.19",
3
+ "version": "0.6.22",
4
4
  "description": "Generic, product-neutral React UI primitives and feature domains. Framework-free types, decision rules, catalogs, and host port contracts live behind ./core (no React, no DOM). The Excalidraw and Lexical editors live behind ./sketch-editor and ./lexical-rich-text-editor; the GrapesJS-backed inline HTML editor lives behind ./html-editor.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -263,19 +263,19 @@
263
263
  "shiki": "^1.24.4",
264
264
  "tailwind-merge": "^2.6.0",
265
265
  "zod": "^3.25.76",
266
+ "@jini-ai/platform": "^0.6.22",
267
+ "@jini-ai/agent-runtime": "^0.6.22",
266
268
  "@jini-ai/integrations": "^0.6.19",
267
- "@jini-ai/agent-runtime": "^0.6.19",
268
269
  "@jini-ai/agentic": "^0.6.19",
269
- "@jini-ai/core": "^0.6.19",
270
- "@jini-ai/platform": "^0.6.19"
270
+ "@jini-ai/core": "^0.6.22"
271
271
  },
272
272
  "dependencies": {
273
273
  "micromark": "^4.0.0",
274
274
  "micromark-extension-gfm": "^3.0.0",
275
+ "@jini-ai/core": "^0.6.22",
275
276
  "@jini-ai/ui-kit": "^0.6.19",
276
- "@jini-ai/core": "^0.6.19",
277
- "@jini-ai/platform": "^0.6.19",
278
- "@jini-ai/agentic": "^0.6.19"
277
+ "@jini-ai/agentic": "^0.6.19",
278
+ "@jini-ai/platform": "^0.6.22"
279
279
  },
280
280
  "peerDependencies": {
281
281
  "@tanstack/react-query": "^5.0.0",