@yuktishaalaa/yuktai 4.6.4 → 4.6.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/README.md CHANGED
@@ -1,6 +1,3 @@
1
-
2
-
3
-
4
1
  # @yuktishaalaa/yuktai
5
2
 
6
3
  > Universal Next.js plugin for accessibility, AI, and data. One install brings WCAG 2.2 auto-fix, in-browser RAG, an AI agent, code generation, and an accessible data grid with Agentic AI + WebMCP — zero API keys, zero cost, works offline.
@@ -57,71 +54,49 @@ Plus Grid Assistant capabilities, Grid Agent tools, WebMCP integration, 7 custom
57
54
 
58
55
  ## What's new
59
56
 
60
- v4.5.0 — Agentic AI + WebMCP for YuktaiGrid
61
- YuktaiGrid now exposes grid operations as reusable tools for Agentic AI and WebMCP.
62
-
63
- Shared Grid Tools layer for agent and WebMCP execution
64
-
65
- Search grid rows
66
-
67
- Count grid rows
57
+ ### v4.6.4 — YuktaiGrid Agentic AI + WebMCP
68
58
 
69
- Get grid columns
59
+ YuktaiGrid now brings Grid UI, Grid AI Assistant, reusable Grid Tools, Agent execution, and WebMCP registration together.
70
60
 
71
- Get a row by ID
61
+ - Shared Grid Tools for Agent and WebMCP execution
72
62
 
73
- Highlight rows
63
+ - Search grid rows
74
64
 
75
- Select a row
65
+ - Count grid rows
76
66
 
77
- Open a row
67
+ - Get grid columns
78
68
 
79
- WebMCP tool registration through document.modelContext
80
-
81
- useYuktaiGridAgent for programmatic agent tool execution
82
-
83
- Designed around the flow: User → Agent → WebMCP → YuktaiGrid → Data
84
-
85
- v4.4.1
86
- Previous published YuktAI release.
87
-
88
- ---
69
+ - Get a row by ID
89
70
 
90
- **## What's new
71
+ - Highlight rows
91
72
 
92
- ### v4.1.2 — grid polish
73
+ - Select a row
93
74
 
94
- - Search icon inside search input
75
+ - Open a row
95
76
 
96
- - Empty-search-results state with "Clear search" action
77
+ - WebMCP registration through document.modelContext
97
78
 
98
- - Attractive pagination with page numbers and ellipsis
79
+ - useYuktaiGridAgent for programmatic Grid tool execution
99
80
 
100
- - Better touch targets (36×36 min)
81
+ - Embedded Grid AI Assistant inside YuktaiGrid
101
82
 
102
- - ARIA `aria-current="page"` on active page
83
+ - English and Telugu AI UI
103
84
 
104
- ### v4.1.0 — 7 custom SVG icons
85
+ - English voice input by default with Telugu voice-input support
105
86
 
106
- Zero external icon dependency. All icons: 24×24 viewBox, 2.5 stroke, `currentColor`, accessible.
87
+ - language, inputLanguage, and embedded AI options
107
88
 
108
- - `SearchIcon`, `SortUpIcon`, `SortDownIcon`
89
+ - Functional page-size switching such as 10 → 20 → 50 → 100
109
90
 
110
- - `ChevronLeftIcon`, `ChevronRightIcon`
91
+ - Inline SVG Grid icons with no external icon dependency
111
92
 
112
- - `CheckIcon`, `CloseIcon`
93
+ - Public seven-icon package API
113
94
 
114
- ### v4.0.0 — YuktaiGrid ships
95
+ Architecture: User → Agent → WebMCP → YuktaiGrid → Data
115
96
 
116
- Fully accessible data grid. 5 built-in themes. Mobile card view. Search + sort + pagination.
97
+ ### v4.6.3
117
98
 
118
- ### v3.0.0 — Voice + chat AI assistant
119
-
120
- Floating chat panel. Voice input via Web Speech API. TTS for AI replies. Zero LLM download.
121
-
122
- ### v2.0.0 — Accessibility engine
123
-
124
- Auto-injects ARIA labels, `alt`, `role`, `tabindex`. MutationObserver watches for new elements.
99
+ Previous published release before the v4.6.4 Grid fixes and polish.
125
100
 
126
101
  ---
127
102
 
@@ -155,7 +130,7 @@ Requirements: Node.js 18+, npm 8+, Next.js 13+.
155
130
 
156
131
  const nextConfig = {
157
132
 
158
- transpilePackages: ["@yuktishaalaa/yuktai"],
133
+   transpilePackages: ["@yuktishaalaa/yuktai"],
159
134
 
160
135
  };
161
136
 
@@ -177,21 +152,21 @@ import { YuktAIWrapper } from "@yuktishaalaa/yuktai";
177
152
 
178
153
  export default function YuktaiClient({ children }: { children: ReactNode }) {
179
154
 
180
- const [mounted, setMounted] = useState(false);
155
+   const [mounted, setMounted] = useState(false);
181
156
 
182
- useEffect(() => setMounted(true), []);
157
+   useEffect(() => setMounted(true), []);
183
158
 
184
- if (!mounted) return <>{children}</>;
159
+   if (!mounted) return <>{children}</>;
185
160
 
186
- return (
161
+   return (
187
162
 
188
- <YuktAIWrapper position="left">
163
+     <YuktAIWrapper position="left">
189
164
 
190
- {children}
165
+       {children}
191
166
 
192
- </YuktAIWrapper>
167
+     </YuktAIWrapper>
193
168
 
194
- );
169
+   );
195
170
 
196
171
  }
197
172
 
@@ -205,23 +180,23 @@ import YuktaiClient from "@/components/YuktaiClient";
205
180
 
206
181
  export default function RootLayout({ children }: { children: React.ReactNode }) {
207
182
 
208
- return (
183
+   return (
209
184
 
210
- <html lang="en">
185
+     <html lang="en">
211
186
 
212
- <body>
187
+       <body>
213
188
 
214
- <YuktaiClient>
189
+         <YuktaiClient>
215
190
 
216
- <main>{children}</main>
191
+           <main>{children}</main>
217
192
 
218
- </YuktaiClient>
193
+         </YuktaiClient>
219
194
 
220
- </body>
195
+       </body>
221
196
 
222
- </html>
197
+     </html>
223
198
 
224
- );
199
+   );
225
200
 
226
201
  }
227
202
 
@@ -267,27 +242,27 @@ import { wcagPlugin } from "@yuktishaalaa/yuktai";
267
242
 
268
243
  const report = wcagPlugin.applyFixes({
269
244
 
270
- enabled: true,
245
+   enabled:       true,
271
246
 
272
- highContrast: false,
247
+   highContrast:  false,
273
248
 
274
- darkMode: false,
249
+   darkMode:      false,
275
250
 
276
- reduceMotion: false,
251
+   reduceMotion:  false,
277
252
 
278
- largeTargets: false,
253
+   largeTargets:  false,
279
254
 
280
- speechEnabled: false,
255
+   speechEnabled: false,
281
256
 
282
- colorBlindMode:"none",
257
+   colorBlindMode:"none",
283
258
 
284
- autoFix: true,
259
+   autoFix:       true,
285
260
 
286
261
  });
287
262
 
288
- console.log(report.fixed); // number of fixes applied
263
+ console.log(report.fixed);   // number of fixes applied
289
264
 
290
- console.log(report.score); // 0–100
265
+ console.log(report.score);   // 0–100
291
266
 
292
267
  ```
293
268
 
@@ -307,67 +282,81 @@ import { YuktaiGrid } from "@yuktishaalaa/yuktai";
307
282
 
308
283
  const data = [
309
284
 
310
- { id: 1, name: "Sandeep", role: "Developer", salary: 85000 },
285
+ { id: 1, name: "Sandeep", role: "Developer", salary: 85000 },
311
286
 
312
- { id: 2, name: "Priya", role: "Designer", salary: 90000 },
287
+ { id: 2, name: "Priya", role: "Designer", salary: 90000 },
313
288
 
314
289
  ];
315
290
 
316
291
  export default function EmployeesPage() {
317
292
 
318
- return (
293
+ return (
294
+
295
+ \<YuktaiGrid
296
+
297
+ data={data}
319
298
 
320
- <YuktaiGrid
299
+ columns={[
321
300
 
322
- data={data}
301
+ { key: "name", label: "Name", sortable: true },
323
302
 
324
- columns={[
303
+ { key: "role", label: "Role" },
325
304
 
326
- { key: "name", label: "Name", sortable: true },
305
+ { key: "salary", label: "Salary", type: "number", align: "right" },
327
306
 
328
- { key: "role", label: "Role" },
307
+ ]}
329
308
 
330
- { key: "salary", label: "Salary", type: "number", align: "right" },
309
+ theme="default" // default | high-contrast | dark | color-blind | dyslexia
331
310
 
332
- ]}
311
+ locale="en-US" // en-US | te-IN
333
312
 
334
- theme="default" // default | high-contrast | dark | color-blind | dyslexia
313
+ search={true} // real-time filtering
335
314
 
336
- search={true} // real-time filtering
315
+ ai={true} // embedded Grid AI Assistant
337
316
 
338
- view="auto" // auto (card on mobile) | table | card
317
+ view="auto" // auto | table | card
339
318
 
340
- pagination={{ pageSize: 10 }} // built-in client pagination
319
+ pagination={{
320
+ pageSize: 20,
321
+ showSizeChanger: true,
322
+ sizeOptions: [10, 20, 50, 100],
323
+ }}
341
324
 
342
- />
325
+ />
343
326
 
344
- );
327
+ );
345
328
 
346
329
  }
347
330
 
348
331
  ```
349
332
 
350
- ### Grid features (12)
333
+ ### Grid features
334
+
335
+ - Search bar with inline SVG icon
336
+
337
+ - Sort — click a column header to toggle ascending / descending
351
338
 
352
- - Search bar with icon and "Clear" action
339
+ - Functional client-side pagination
353
340
 
354
- - Sort — click column header (asc → desc → cleared)
341
+ - Configurable page-size switching such as 10, 20, 50, 100
355
342
 
356
- - Pagination with page numbers and ellipsis
343
+ - Mobile card view below the configured breakpoint
357
344
 
358
- - Mobile card view (below 768px, no config needed)
345
+ - Loading and empty states
359
346
 
360
- - Loading, empty, and empty-search states
347
+ - 5 WCAG themes
361
348
 
362
- - 5 WCAG themes with 3-line switcher
349
+ - Row selection, custom render, and rowKey
363
350
 
364
- - Row selection, custom render, `rowKey`
351
+ - Row highlighting and optional auto-scroll to highlighted rows
365
352
 
366
- - Keyboard navigation
353
+ - Embedded Grid AI Assistant
367
354
 
368
- - ARIA `role="grid"`, `aria-sort`, `aria-current`
355
+ - English and Telugu Grid UI
369
356
 
370
- - 44×44 touch targets
357
+ - Inline SVG search, sort, selection, and pagination icons
358
+
359
+ - No external icon dependency
371
360
 
372
361
  ### Handling large datasets (100K, 200K, 300K rows)
373
362
 
@@ -389,51 +378,51 @@ const TTL_MS = 60_000;
389
378
 
390
379
  async function fetchAll(): Promise<any[]> {
391
380
 
392
- const now = Date.now();
381
+   const now = Date.now();
393
382
 
394
- if (cachedData && now - cacheTime < TTL_MS) return cachedData;
383
+   if (cachedData && now - cacheTime < TTL_MS) return cachedData;
395
384
 
396
- const res = await fetch("https://your-api.com/employees", { cache: "no-store" });
385
+   const res  = await fetch("https://your-api.com/employees", { cache: "no-store" });
397
386
 
398
- const json = await res.json();
387
+   const json = await res.json();
399
388
 
400
- cachedData = Array.isArray(json) ? json : (json.employees ?? json.data ?? []);
389
+   cachedData = Array.isArray(json) ? json : (json.employees ?? json.data ?? []);
401
390
 
402
- cacheTime = now;
391
+   cacheTime  = now;
403
392
 
404
- return cachedData;
393
+   return cachedData;
405
394
 
406
395
  }
407
396
 
408
397
  export async function GET(req: NextRequest) {
409
398
 
410
- const p = req.nextUrl.searchParams;
399
+   const p = req.nextUrl.searchParams;
411
400
 
412
- const page = Math.max(1, parseInt(p.get("page") || "1"));
401
+   const page     = Math.max(1, parseInt(p.get("page")     || "1"));
413
402
 
414
- const pageSize = Math.max(1, parseInt(p.get("pageSize") || "5000"));
403
+   const pageSize = Math.max(1, parseInt(p.get("pageSize") || "5000"));
415
404
 
416
- const search = (p.get("search") || "").toLowerCase().trim();
405
+   const search   = (p.get("search") || "").toLowerCase().trim();
417
406
 
418
- const all = await fetchAll();
407
+   const all      = await fetchAll();
419
408
 
420
- const filtered = search
409
+   const filtered = search
421
410
 
422
- ? all.filter(r => Object.values(r).some(v => String(v).toLowerCase().includes(search)))
411
+     ? all.filter(r => Object.values(r).some(v => String(v).toLowerCase().includes(search)))
423
412
 
424
- : all;
413
+     : all;
425
414
 
426
- const total = filtered.length;
415
+   const total = filtered.length;
427
416
 
428
- const rows = filtered.slice((page - 1) * pageSize, page * pageSize);
417
+   const rows  = filtered.slice((page - 1) * pageSize, page * pageSize);
429
418
 
430
- return NextResponse.json({
419
+   return NextResponse.json({
431
420
 
432
- rows,
421
+     rows,
433
422
 
434
- pagination: { page, pageSize, totalRows: total, totalPages: Math.ceil(total / pageSize) },
423
+     pagination: { page, pageSize, totalRows: total, totalPages: Math.ceil(total / pageSize) },
435
424
 
436
- });
425
+   });
437
426
 
438
427
  }
439
428
 
@@ -443,31 +432,31 @@ export async function GET(req: NextRequest) {
443
432
 
444
433
  ```tsx
445
434
 
446
- const [apiResp, setApiResp] = useState<any>(null);
435
+ const [apiResp, setApiResp]     = useState<any>(null);
447
436
 
448
- const [currentPage, setPage] = useState(1);
437
+ const [currentPage, setPage]    = useState(1);
449
438
 
450
439
  useEffect(() => {
451
440
 
452
- fetch(`/api/employees?page=${currentPage}&pageSize=5000`)
441
+   fetch(`/api/employees?page=${currentPage}&pageSize=5000`)
453
442
 
454
- .then(r => r.json())
443
+     .then(r => r.json())
455
444
 
456
- .then(setApiResp);
445
+     .then(setApiResp);
457
446
 
458
447
  }, [currentPage]);
459
448
 
460
449
  <YuktaiGrid
461
450
 
462
- data={apiResp?.rows ?? []}
451
+   data={apiResp?.rows ?? []}
463
452
 
464
- columns={columns}
453
+   columns={columns}
465
454
 
466
- search={false} // disable — we handle search server-side
455
+   search={false}         // disable — we handle search server-side
467
456
 
468
- pagination={false} // disable — we handle pagination server-side
457
+   pagination={false}     // disable — we handle pagination server-side
469
458
 
470
- loading={!apiResp}
459
+   loading={!apiResp}
471
460
 
472
461
  />
473
462
 
@@ -477,6 +466,101 @@ Then render your own pagination bar backed by `apiResp.pagination`. This pattern
477
466
 
478
467
  ---
479
468
 
469
+ ---
470
+
471
+ ## Grid Agentic AI + WebMCP
472
+
473
+ YuktaiGrid exposes reusable Grid operations so an Agent can work with grid data through a shared tool layer and WebMCP.
474
+
475
+ ### Grid tools
476
+
477
+ ```ts
478
+
479
+ import {
480
+ searchGrid,
481
+ countGrid,
482
+ getColumns,
483
+ getRow,
484
+ highlightRows,
485
+ selectRow,
486
+ openRow,
487
+ } from "@yuktishaalaa/yuktai";
488
+
489
+ ```
490
+
491
+ These operations form the common execution layer for programmatic Agent tools and WebMCP.
492
+
493
+ ### Agent execution
494
+
495
+ ```tsx
496
+
497
+ import {
498
+ useYuktaiGridAgent,
499
+ type GridAgentTool,
500
+ } from "@yuktishaalaa/yuktai";
501
+
502
+ const tools: GridAgentTool[] = [
503
+ {
504
+ name: "search",
505
+ description: "Search grid rows",
506
+ execute: async ({ query }) => {
507
+ return { query };
508
+ },
509
+ },
510
+ ];
511
+
512
+ const { executeTool, loading } =
513
+ useYuktaiGridAgent({ tools });
514
+
515
+ ```
516
+
517
+ ### WebMCP
518
+
519
+ ```tsx
520
+
521
+ import {
522
+ YuktaiGridWebMCP,
523
+ } from "@yuktishaalaa/yuktai";
524
+
525
+ <YuktaiGridWebMCP
526
+ data={data}
527
+ columns={columns}
528
+ />
529
+
530
+ ```
531
+
532
+ WebMCP registration is invisible in the UI and uses document.modelContext when available.
533
+
534
+ ### Embedded Grid AI Assistant
535
+
536
+ ```tsx
537
+
538
+ <YuktaiGrid
539
+ data={data}
540
+ columns={columns}
541
+ locale="te-IN"
542
+ ai={true}
543
+ pagination={{
544
+ pageSize: 20,
545
+ showSizeChanger: true,
546
+ sizeOptions: [10, 20, 50, 100],
547
+ }}
548
+ />
549
+
550
+ ```
551
+
552
+ Grid AI supports:
553
+
554
+ - language="en-US" or language="te-IN" for AI UI and responses
555
+
556
+ - inputLanguage="en-US" or inputLanguage="te-IN" for voice input
557
+
558
+ - embedded mode for rendering AI inside the Grid
559
+
560
+ - Local intent parsing for search, sort, count, highest, lowest, average, total, and lookup
561
+
562
+ ---
563
+
480
564
  ## Module 3 — In-Tab RAG (Ask This Page)
481
565
 
482
566
  Retrieval-Augmented Generation running entirely in the browser. Extracts semantic chunks from the current DOM, embeds them, finds the best match for the user's question, and answers — offline, no API key.
@@ -561,63 +645,91 @@ No AI writes a single line. Pure template engineering. Same reusable-utility thi
561
645
 
562
646
  ---
563
647
 
564
- ## Voice + Chat Assistant
648
+ ## Grid AI Assistant — Voice + Chat
649
+
650
+ The Grid AI Assistant can run embedded inside YuktaiGrid or as a standalone component.
651
+
652
+ Voice input uses the browser Web Speech API. AI responses can be spoken with SpeechSynthesis. Intent parsing runs locally for the supported Grid operations.
653
+
654
+ Supports:
655
+
656
+ - Search
565
657
 
566
- A floating 🤖 button bottom-right opens a chat panel. Voice in via Web Speech API. TTS out via SpeechSynthesis. Intent parsing runs locally — no LLM, no API.
658
+ - Sort
567
659
 
568
- Understands:
660
+ - Count
569
661
 
570
- - "highest salary" → analyzes visible grid rows
662
+ - Highest / maximum
571
663
 
572
- - "how many employees" → counts
664
+ - Lowest / minimum
573
665
 
574
- - "average age" → calculates
666
+ - Average
575
667
 
576
- - "who is Sandeep" → looks up
668
+ - Total
577
669
 
578
- - "search for developer" → filters grid
670
+ - Row lookup
579
671
 
580
- - "sort by salary descending" → sorts
672
+ - English and Telugu AI UI
581
673
 
582
- Chrome + Edge give the best voice recognition. Firefox needs a flag. iOS Safari is limited.
674
+ - English voice input by default
675
+
676
+ - Telugu voice input with inputLanguage="te-IN"
677
+
678
+ Example:
679
+
680
+ ```tsx
681
+
682
+ <YuktaiGridAI
683
+ data={data}
684
+ columns={columns}
685
+ onSearch={handleSearch}
686
+ onSort={handleSort}
687
+ language="te-IN"
688
+ inputLanguage="en-US"
689
+ embedded
690
+ />
691
+
692
+ ```
693
+
694
+ Voice recognition depends on browser Web Speech API support.
583
695
 
584
696
  ---
585
697
 
586
698
  ## Icon library
587
699
 
588
- 7 custom SVG icons. Zero external dependency.
700
+ 7 custom SVG icons. Zero external dependency. All seven remain part of the public package API.
589
701
 
590
702
  ```tsx
591
703
 
592
704
  import {
593
705
 
594
- SearchIcon,
706
+   SearchIcon,
595
707
 
596
- SortUpIcon,
708
+   SortUpIcon,
597
709
 
598
- SortDownIcon,
710
+   SortDownIcon,
599
711
 
600
- ChevronLeftIcon,
712
+   ChevronLeftIcon,
601
713
 
602
- ChevronRightIcon,
714
+   ChevronRightIcon,
603
715
 
604
- CheckIcon,
716
+   CheckIcon,
605
717
 
606
- CloseIcon,
718
+   CloseIcon,
607
719
 
608
720
  } from "@yuktishaalaa/yuktai";
609
721
 
610
- <SearchIcon size={20} />
722
+ <SearchIcon        size={20} />
611
723
 
612
- <SortUpIcon size={20} color="#0D9488" />
724
+ <SortUpIcon        size={20} color="#0D9488" />
613
725
 
614
- <CheckIcon size={20} color="#10b981" label="Task complete" />
726
+ <CheckIcon         size={20} color="#10b981" label="Task complete" />
615
727
 
616
- <CloseIcon size={20} color="#dc2626" />
728
+ <CloseIcon         size={20} color="#dc2626" />
617
729
 
618
- <ChevronLeftIcon size={24} label="Previous" />
730
+ <ChevronLeftIcon   size={24} label="Previous" />
619
731
 
620
- <ChevronRightIcon size={24} label="Next" />
732
+ <ChevronRightIcon  size={24} label="Next" />
621
733
 
622
734
  ```
623
735
 
@@ -657,31 +769,31 @@ import { wcagPlugin, A11yConfig } from "@yuktishaalaa/yuktai";
657
769
 
658
770
  const config: A11yConfig = {
659
771
 
660
- enabled: true, // required
772
+   enabled:             true,   // required
661
773
 
662
- highContrast: false,
774
+   highContrast:        false,
663
775
 
664
- darkMode: false,
776
+   darkMode:            false,
665
777
 
666
- reduceMotion: false,
778
+   reduceMotion:        false,
667
779
 
668
- largeTargets: false,
780
+   largeTargets:        false,
669
781
 
670
- speechEnabled: false,
782
+   speechEnabled:       false,
671
783
 
672
- colorBlindMode: "none", // none | deuteranopia | protanopia | tritanopia | achromatopsia
784
+   colorBlindMode:      "none", // none | deuteranopia | protanopia | tritanopia | achromatopsia
673
785
 
674
- autoFix: true,
786
+   autoFix:             true,
675
787
 
676
- showPreferencePanel: true,
788
+   showPreferencePanel: true,
677
789
 
678
- showSkipLinks: true,
790
+   showSkipLinks:       true,
679
791
 
680
- showAuditBadge: false, // dev only (localhost)
792
+   showAuditBadge:      false,  // dev only (localhost)
681
793
 
682
- fontSizeMultiplier: 1,
794
+   fontSizeMultiplier:  1,
683
795
 
684
- timeoutWarning: 0, // seconds (0 = off)
796
+   timeoutWarning:      0,      // seconds (0 = off)
685
797
 
686
798
  };
687
799
 
@@ -755,13 +867,11 @@ Chrome 90+ · Firefox 90+ · Safari 15+ · Edge 90+ · Samsung Internet 14+
755
867
 
756
868
  ## Roadmap
757
869
 
758
- Shipped: v4.1.2 (grid polish)
759
-
760
- Next: v4.2.0 — Voice search inside `YuktaiGrid` (mic button + Web Speech API)
870
+ Shipped: v4.6.4 — YuktaiGrid Agentic AI + WebMCP integration, embedded Grid AI Assistant, English/Telugu Grid UI, functional page-size switching, and Grid icon polish.
761
871
 
762
- After that: v4.3.0 — AI Summary button, TTS row reader
872
+ Next: expand Grid Agent tools and WebMCP capabilities.
763
873
 
764
- Long term: v5.0.0 — WebLLM + WebMCP + multimodal
874
+ Long term: richer browser-native AI and multimodal Grid experiences.
765
875
 
766
876
  ---
767
877