@llmnative/react 1.31.0 → 1.33.0
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/dist/index.css +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4042 -3206
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/I18n.d.ts +141 -0
- package/dist/types/src/components/blocks/Notifications.d.ts +25 -3
- package/dist/types/src/components/index.d.ts +1 -0
- package/llms-full.txt +24 -1
- package/package.json +1 -1
package/dist/types/src/I18n.d.ts
CHANGED
|
@@ -57,6 +57,10 @@ export interface I18nDict {
|
|
|
57
57
|
filtersRangeMin: string;
|
|
58
58
|
filtersRangeMax: string;
|
|
59
59
|
filtersSelectedCountTemplate: string;
|
|
60
|
+
tableView: string;
|
|
61
|
+
galleryView: string;
|
|
62
|
+
columns: string;
|
|
63
|
+
fields: string;
|
|
60
64
|
};
|
|
61
65
|
select: {
|
|
62
66
|
placeholder: string;
|
|
@@ -88,6 +92,9 @@ export interface I18nDict {
|
|
|
88
92
|
notifications: {
|
|
89
93
|
title: string;
|
|
90
94
|
seeAll: string;
|
|
95
|
+
markAllRead: string;
|
|
96
|
+
empty: string;
|
|
97
|
+
emptyHint: string;
|
|
91
98
|
};
|
|
92
99
|
code: {
|
|
93
100
|
copyCode: string;
|
|
@@ -164,6 +171,13 @@ export interface I18nDict {
|
|
|
164
171
|
noResponse: string;
|
|
165
172
|
promptLabel: string;
|
|
166
173
|
defaultOption: string;
|
|
174
|
+
role: string;
|
|
175
|
+
language: string;
|
|
176
|
+
voice: string;
|
|
177
|
+
style: string;
|
|
178
|
+
temperature: string;
|
|
179
|
+
stop: string;
|
|
180
|
+
stopping: string;
|
|
167
181
|
};
|
|
168
182
|
layout: {
|
|
169
183
|
maxElements: string;
|
|
@@ -192,6 +206,127 @@ export interface I18nDict {
|
|
|
192
206
|
notConfigured: string;
|
|
193
207
|
loadError: string;
|
|
194
208
|
};
|
|
209
|
+
errorBoundary: {
|
|
210
|
+
title: string;
|
|
211
|
+
description: string;
|
|
212
|
+
technicalDetails: string;
|
|
213
|
+
debugInformation: string;
|
|
214
|
+
context: string;
|
|
215
|
+
time: string;
|
|
216
|
+
agent: string;
|
|
217
|
+
componentTree: string;
|
|
218
|
+
copyDebug: string;
|
|
219
|
+
copied: string;
|
|
220
|
+
sendReport: string;
|
|
221
|
+
sending: string;
|
|
222
|
+
reportSent: string;
|
|
223
|
+
reportFailed: string;
|
|
224
|
+
tryAgain: string;
|
|
225
|
+
goHome: string;
|
|
226
|
+
};
|
|
227
|
+
themeSwitcher: {
|
|
228
|
+
title: string;
|
|
229
|
+
subtitle: string;
|
|
230
|
+
colorMode: string;
|
|
231
|
+
light: string;
|
|
232
|
+
dark: string;
|
|
233
|
+
primaryColor: string;
|
|
234
|
+
borderRadius: string;
|
|
235
|
+
sharp: string;
|
|
236
|
+
rounded: string;
|
|
237
|
+
font: string;
|
|
238
|
+
statusColors: string;
|
|
239
|
+
theme: string;
|
|
240
|
+
themeDescription: string;
|
|
241
|
+
iconLibrary: string;
|
|
242
|
+
weight: string;
|
|
243
|
+
blue: string;
|
|
244
|
+
violet: string;
|
|
245
|
+
green: string;
|
|
246
|
+
rose: string;
|
|
247
|
+
orange: string;
|
|
248
|
+
slate: string;
|
|
249
|
+
success: string;
|
|
250
|
+
warning: string;
|
|
251
|
+
info: string;
|
|
252
|
+
danger: string;
|
|
253
|
+
lucideDescription: string;
|
|
254
|
+
phosphorDescription: string;
|
|
255
|
+
weightThin: string;
|
|
256
|
+
weightLight: string;
|
|
257
|
+
weightRegular: string;
|
|
258
|
+
weightBold: string;
|
|
259
|
+
weightFill: string;
|
|
260
|
+
};
|
|
261
|
+
/** Image fields: `ImageField` and the image dialogs of `RichText`. */
|
|
262
|
+
imageField: {
|
|
263
|
+
openOriginal: string;
|
|
264
|
+
crop: string;
|
|
265
|
+
cropTitle: string;
|
|
266
|
+
cropImage: string;
|
|
267
|
+
editImage: string;
|
|
268
|
+
generatingVariants: string;
|
|
269
|
+
responsiveVariants: string;
|
|
270
|
+
variantsGenerated: string;
|
|
271
|
+
imageUrl: string;
|
|
272
|
+
imageUrlHint: string;
|
|
273
|
+
altText: string;
|
|
274
|
+
altTextHint: string;
|
|
275
|
+
altPlaceholder: string;
|
|
276
|
+
linkUrl: string;
|
|
277
|
+
optionalHint: string;
|
|
278
|
+
newTab: string;
|
|
279
|
+
sameTab: string;
|
|
280
|
+
insertImage: string;
|
|
281
|
+
insertImages: string;
|
|
282
|
+
include: string;
|
|
283
|
+
insert: string;
|
|
284
|
+
insertCount: string;
|
|
285
|
+
};
|
|
286
|
+
richText: {
|
|
287
|
+
bold: string;
|
|
288
|
+
italic: string;
|
|
289
|
+
underline: string;
|
|
290
|
+
strike: string;
|
|
291
|
+
heading1: string;
|
|
292
|
+
heading2: string;
|
|
293
|
+
heading3: string;
|
|
294
|
+
bulletList: string;
|
|
295
|
+
orderedList: string;
|
|
296
|
+
blockquote: string;
|
|
297
|
+
inlineCode: string;
|
|
298
|
+
codeBlock: string;
|
|
299
|
+
link: string;
|
|
300
|
+
undo: string;
|
|
301
|
+
redo: string;
|
|
302
|
+
clearFormat: string;
|
|
303
|
+
paragraphStyle: string;
|
|
304
|
+
normal: string;
|
|
305
|
+
insertTable: string;
|
|
306
|
+
insertTableSize: string;
|
|
307
|
+
addRowAbove: string;
|
|
308
|
+
addRowBelow: string;
|
|
309
|
+
addColumnLeft: string;
|
|
310
|
+
addColumnRight: string;
|
|
311
|
+
deleteRow: string;
|
|
312
|
+
deleteColumn: string;
|
|
313
|
+
deleteTable: string;
|
|
314
|
+
uploadImage: string;
|
|
315
|
+
uploadDocument: string;
|
|
316
|
+
sourceCode: string;
|
|
317
|
+
source: string;
|
|
318
|
+
words: string;
|
|
319
|
+
chars: string;
|
|
320
|
+
editLink: string;
|
|
321
|
+
removeLink: string;
|
|
322
|
+
altPlaceholder: string;
|
|
323
|
+
};
|
|
324
|
+
tabDynamic: {
|
|
325
|
+
addTab: string;
|
|
326
|
+
};
|
|
327
|
+
breadcrumbs: {
|
|
328
|
+
label: string;
|
|
329
|
+
};
|
|
195
330
|
}
|
|
196
331
|
type DeepPartial<T> = {
|
|
197
332
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
@@ -223,4 +358,10 @@ interface I18nProviderProps {
|
|
|
223
358
|
export declare const I18nProvider: ({ children, config }: I18nProviderProps) => React.JSX.Element;
|
|
224
359
|
export declare function useI18n(): I18nController;
|
|
225
360
|
export declare function useI18n<P extends DotNestedKeyOf<I18nDict>>(namespace: P): PathValue<I18nDict, P>;
|
|
361
|
+
/**
|
|
362
|
+
* Internal (not exported from the package): the dictionary of the nearest `<I18nProvider>`, or
|
|
363
|
+
* the English one when there is none — for components that may render outside the provider,
|
|
364
|
+
* like the root `ErrorBoundary` of `<App>`.
|
|
365
|
+
*/
|
|
366
|
+
export declare function useI18nDictOrEnglish(): I18nDict;
|
|
226
367
|
export {};
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { BadgeProps } from "../ui/Badge";
|
|
3
3
|
import type { MotionReference } from "../../motion";
|
|
4
|
-
|
|
4
|
+
/** A button on a notification: it acts without opening the notification. */
|
|
5
|
+
export interface NotificationAction {
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
/** May return a promise: the button shows it is working until it settles. */
|
|
9
|
+
onClick: () => void | Promise<unknown>;
|
|
10
|
+
/** `primary` stands out; the default is quiet. */
|
|
11
|
+
variant?: "primary" | "default";
|
|
12
|
+
/** Closes the menu once the action is done; by default it stays open. */
|
|
13
|
+
closeOnClick?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface NotificationItem {
|
|
16
|
+
/** Stable key of the notification (the index otherwise). */
|
|
17
|
+
id?: string;
|
|
5
18
|
title: string;
|
|
6
|
-
|
|
19
|
+
/** A line under the title: what and where. */
|
|
20
|
+
description?: React.ReactNode;
|
|
21
|
+
/** Where the notification leads: a route of the app, or an address when `external`. Without it, it only shows. */
|
|
22
|
+
url?: string;
|
|
23
|
+
/** Opens `url` as an address in a new tab instead of a route of the app. */
|
|
24
|
+
external?: boolean;
|
|
7
25
|
time: string;
|
|
8
26
|
icon: string;
|
|
9
27
|
read?: boolean;
|
|
28
|
+
/** Buttons under the notification, to act on it from the menu. */
|
|
29
|
+
actions?: NotificationAction[];
|
|
10
30
|
}
|
|
11
31
|
interface NotificationsProps {
|
|
12
32
|
items?: NotificationItem[];
|
|
@@ -15,9 +35,11 @@ interface NotificationsProps {
|
|
|
15
35
|
seeAllUrl?: string;
|
|
16
36
|
/** Callback for "mark all as read" — shown in the header only when there are items */
|
|
17
37
|
onMarkAllRead?: () => void;
|
|
38
|
+
/** Called when a notification is opened (e.g. to mark it read); the menu closes. */
|
|
39
|
+
onItemClick?: (item: NotificationItem, index: number) => void;
|
|
18
40
|
/** Named motion preset for notification items appearance. */
|
|
19
41
|
motion?: MotionReference;
|
|
20
42
|
className?: string;
|
|
21
43
|
}
|
|
22
|
-
declare function Notifications({ items, badge, seeAllUrl, onMarkAllRead, motion, className, }: NotificationsProps): React.JSX.Element;
|
|
44
|
+
declare function Notifications({ items, badge, seeAllUrl, onMarkAllRead, onItemClick, motion, className, }: NotificationsProps): React.JSX.Element;
|
|
23
45
|
export default Notifications;
|
|
@@ -5,6 +5,7 @@ export type { BreadcrumbItem, BreadcrumbsProps, BreadcrumbSchemaOptions } from '
|
|
|
5
5
|
export { default as Carousel } from './blocks/Carousel';
|
|
6
6
|
export * from './blocks/Dropdown';
|
|
7
7
|
export { default as Notifications } from './blocks/Notifications';
|
|
8
|
+
export type { NotificationItem, NotificationAction } from './blocks/Notifications';
|
|
8
9
|
export { default as Search } from './blocks/Search';
|
|
9
10
|
export { default as Toolbar } from './blocks/Toolbar';
|
|
10
11
|
export type { ToolbarProps } from './blocks/Toolbar';
|
package/llms-full.txt
CHANGED
|
@@ -63,6 +63,20 @@ import '@llmnative/react/dist/index.css'
|
|
|
63
63
|
/>
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
### Testi dei componenti (i18n)
|
|
67
|
+
|
|
68
|
+
I testi fissi dei componenti vengono da `I18nDict` e seguono `i18n.locale` (en, it, de, ru, ar, zh
|
|
69
|
+
inclusi): un testo si cambia con `i18n.translations`, non nel codice. Namespace dei componenti:
|
|
70
|
+
`notifications` (`markAllRead`, `empty`, `emptyHint`), `errorBoundary` (schermata d'errore; fuori da
|
|
71
|
+
`<I18nProvider>`, come l'`ErrorBoundary` radice di `<App>`, resta in inglese), `themeSwitcher`,
|
|
72
|
+
`imageField` (anche i dialoghi immagine di `RichText`), `richText`, `tabDynamic` (`addTab`),
|
|
73
|
+
`breadcrumbs` (`label`, l'`aria-label` del `nav`), `grid` (`tableView`, `galleryView`, `columns`,
|
|
74
|
+
`fields`), `prompt` (anche `Chatbot`: `role`, `language`, `voice`, `style`, `temperature`, `stop`).
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
<App i18n={{ locale: 'it', translations: { it: { notifications: { emptyHint: 'Niente di nuovo' } } } }} />
|
|
78
|
+
```
|
|
79
|
+
|
|
66
80
|
### AppThemeProviderConfig
|
|
67
81
|
```ts
|
|
68
82
|
{
|
|
@@ -847,7 +861,8 @@ utile quando un comando cambia famiglia sintattica (per esempio da `{{ ... }}` a
|
|
|
847
861
|
<Breadcrumbs trail={[{ label: 'Home', href: '/' }, { label: 'Utenti' }]} separator="/" jsonLd />
|
|
848
862
|
<Brand url="/" label="MyApp" logo="/logo.svg" width={120} />
|
|
849
863
|
<Search onQueryChange={(e) => setQ(e.target.value)} />
|
|
850
|
-
<Notifications items={[...]} seeAllUrl="/notifications" onMarkAllRead={() => {}} />
|
|
864
|
+
<Notifications items={[...]} seeAllUrl="/notifications" onMarkAllRead={() => {}} onItemClick={(item) => markRead(item.id)} />
|
|
865
|
+
<Notifications items={[{ id: 'a', title: 'Fonte senza Action', description: 'crm · sources/notes/a.md', url: '/projects/crm', time: 'ora', icon: 'file', actions: [{ label: "Apri l'Action", icon: 'play', onClick: openAction, variant: 'primary' }] }]} />
|
|
851
866
|
<Carousel images={[...]} />
|
|
852
867
|
<Toolbar items={[...]}>
|
|
853
868
|
{children}
|
|
@@ -919,8 +934,16 @@ icona; niente rete né storage. Default: `rounded-md bg-muted` (tema `Identicon.
|
|
|
919
934
|
| `badge` | `BadgeProps` |
|
|
920
935
|
| `seeAllUrl` | `string` |
|
|
921
936
|
| `onMarkAllRead` | `() => void` |
|
|
937
|
+
| `onItemClick` | `(item, index) => void` — una voce aperta (es. per segnarla letta); il menu si chiude |
|
|
922
938
|
| `motion` | `MotionReference` |
|
|
923
939
|
|
|
940
|
+
`NotificationItem`: `{ id?, title, description?, url?, external?, time, icon, read?, actions? }`. `description` è la
|
|
941
|
+
riga sotto il titolo; senza `url` la voce si mostra e basta; con `external` l'`url` è un indirizzo aperto
|
|
942
|
+
in una nuova scheda (`<a target="_blank">`), altrimenti una rotta (`Link`). `actions`
|
|
943
|
+
(`NotificationAction[]`: `{ label, icon?, onClick, variant?: 'primary' | 'default', closeOnClick? }`) sono
|
|
944
|
+
pulsanti sotto la voce: non la aprono, mostrano il caricamento finché la promessa di `onClick` è in corso
|
|
945
|
+
e lasciano il menu aperto salvo `closeOnClick`.
|
|
946
|
+
|
|
924
947
|
**ListCard:**
|
|
925
948
|
| Prop | Tipo |
|
|
926
949
|
|---|---|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmnative/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"description": "LLM-native React framework for deterministic UI generation. Data-driven by default, schema-driven optional. Ultra-low token consumption — built for AI agents, not just humans.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|