@vantageos/mosaic-blocks 0.5.37-alpha → 0.5.38-alpha

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 (55) hide show
  1. package/dist/index.cjs +141 -127
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +7 -2
  4. package/dist/index.d.ts +7 -2
  5. package/dist/index.js +142 -128
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/r/mosaic-adaptive-grid.json +1 -1
  9. package/r/mosaic-adaptive-modal.json +1 -1
  10. package/r/mosaic-adaptive-navigation.json +1 -1
  11. package/r/mosaic-add-memory-form.json +3 -3
  12. package/r/mosaic-admin-only-guard.json +1 -1
  13. package/r/mosaic-agent-chat.json +4 -4
  14. package/r/mosaic-agent-composer.json +1 -1
  15. package/r/mosaic-agent-editor.json +3 -3
  16. package/r/mosaic-agent-list.json +4 -4
  17. package/r/mosaic-app-sidebar.json +1 -1
  18. package/r/mosaic-artifact-checklist.json +1 -1
  19. package/r/mosaic-artifact-data-table.json +1 -1
  20. package/r/mosaic-artifact-library.json +1 -1
  21. package/r/mosaic-artifact-save-as-memory-form.json +2 -2
  22. package/r/mosaic-chat-message.json +1 -1
  23. package/r/mosaic-dashboard-content.json +1 -1
  24. package/r/mosaic-dashboard-header.json +1 -1
  25. package/r/mosaic-dashboard-layout.json +3 -3
  26. package/r/mosaic-document-table.json +6 -6
  27. package/r/mosaic-edit-memory-dialog.json +3 -3
  28. package/r/mosaic-edit-session-dialog.json +3 -3
  29. package/r/mosaic-editable-cell.json +1 -1
  30. package/r/mosaic-filter-bar.json +1 -1
  31. package/r/mosaic-filter-sidebar.json +1 -1
  32. package/r/mosaic-grille-registre.json +2 -2
  33. package/r/mosaic-main-nav.json +1 -1
  34. package/r/mosaic-marketplace-card.json +2 -2
  35. package/r/mosaic-marketplace-list.json +3 -3
  36. package/r/mosaic-match-input.json +1 -1
  37. package/r/mosaic-memory-dashboard.json +1 -1
  38. package/r/mosaic-memory-search.json +1 -1
  39. package/r/mosaic-mention-input.json +1 -1
  40. package/r/mosaic-message-list.json +2 -2
  41. package/r/mosaic-message-search.json +1 -1
  42. package/r/mosaic-module-library.json +1 -1
  43. package/r/mosaic-org-context-display.json +1 -1
  44. package/r/mosaic-org-panel.json +2 -2
  45. package/r/mosaic-preferences-panel.json +1 -1
  46. package/r/mosaic-profile-panel.json +1 -1
  47. package/r/mosaic-quick-actions-menu.json +1 -1
  48. package/r/mosaic-quick-agent-selector.json +2 -2
  49. package/r/mosaic-save-chat-as-memory-form.json +3 -3
  50. package/r/mosaic-save-template-modal.json +5 -5
  51. package/r/mosaic-selector-modal.json +1 -1
  52. package/r/mosaic-session-card.json +2 -2
  53. package/r/mosaic-template-gallery.json +3 -3
  54. package/r/mosaic-template-management-panel.json +3 -3
  55. package/r/use-effective-workspace-id.json +1 -1
package/dist/index.d.cts CHANGED
@@ -26,7 +26,7 @@ import * as ag_grid_community from 'ag-grid-community';
26
26
  import { ColDef, Theme as Theme$1, GridReadyEvent, CellValueChangedEvent, RowClassParams, RowStyle, CellClickedEvent, GridSizeChangedEvent, SizeColumnsToFitGridStrategy } from 'ag-grid-community';
27
27
  export { Tooltip } from '@base-ui/react/tooltip';
28
28
 
29
- declare const version = "0.5.37-alpha";
29
+ declare const version = "0.5.38-alpha";
30
30
 
31
31
  /**
32
32
  * Placeholder component — infra scaffold only.
@@ -11746,8 +11746,13 @@ interface GrilleRegistreProps<T> {
11746
11746
  domLayout?: "normal" | "autoHeight" | "print";
11747
11747
  /** Refit columns on a size change — `refitColumns` on an autoHeight grid. */
11748
11748
  onGridSizeChanged?: (e: GridSizeChangedEvent<T>) => void;
11749
+ /**
11750
+ * Text of the grid's no-rows overlay, shown when `lignes` is empty. The host
11751
+ * owns the language; omitted, AG Grid shows its own default overlay text.
11752
+ */
11753
+ messageVide?: string;
11749
11754
  }
11750
- declare function GrilleRegistre<T>({ lignes, columnDefs, getRowId, filtreGlobal, theme, onGridReady, onCelluleEditee, getRowStyle, tooltipShowDelay, suppressCellFocus, onCellClicked, rowHeight, domLayout, onGridSizeChanged, }: GrilleRegistreProps<T>): React.JSX.Element;
11755
+ declare function GrilleRegistre<T>({ lignes, columnDefs, getRowId, filtreGlobal, theme, onGridReady, onCelluleEditee, getRowStyle, tooltipShowDelay, suppressCellFocus, onCellClicked, rowHeight, domLayout, onGridSizeChanged, messageVide, }: GrilleRegistreProps<T>): React.JSX.Element;
11751
11756
 
11752
11757
  interface PanneauRegistreShellLabels {
11753
11758
  /** Accessible name of the left-edge resize handle. */
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ import * as ag_grid_community from 'ag-grid-community';
26
26
  import { ColDef, Theme as Theme$1, GridReadyEvent, CellValueChangedEvent, RowClassParams, RowStyle, CellClickedEvent, GridSizeChangedEvent, SizeColumnsToFitGridStrategy } from 'ag-grid-community';
27
27
  export { Tooltip } from '@base-ui/react/tooltip';
28
28
 
29
- declare const version = "0.5.37-alpha";
29
+ declare const version = "0.5.38-alpha";
30
30
 
31
31
  /**
32
32
  * Placeholder component — infra scaffold only.
@@ -11746,8 +11746,13 @@ interface GrilleRegistreProps<T> {
11746
11746
  domLayout?: "normal" | "autoHeight" | "print";
11747
11747
  /** Refit columns on a size change — `refitColumns` on an autoHeight grid. */
11748
11748
  onGridSizeChanged?: (e: GridSizeChangedEvent<T>) => void;
11749
+ /**
11750
+ * Text of the grid's no-rows overlay, shown when `lignes` is empty. The host
11751
+ * owns the language; omitted, AG Grid shows its own default overlay text.
11752
+ */
11753
+ messageVide?: string;
11749
11754
  }
11750
- declare function GrilleRegistre<T>({ lignes, columnDefs, getRowId, filtreGlobal, theme, onGridReady, onCelluleEditee, getRowStyle, tooltipShowDelay, suppressCellFocus, onCellClicked, rowHeight, domLayout, onGridSizeChanged, }: GrilleRegistreProps<T>): React.JSX.Element;
11755
+ declare function GrilleRegistre<T>({ lignes, columnDefs, getRowId, filtreGlobal, theme, onGridReady, onCelluleEditee, getRowStyle, tooltipShowDelay, suppressCellFocus, onCellClicked, rowHeight, domLayout, onGridSizeChanged, messageVide, }: GrilleRegistreProps<T>): React.JSX.Element;
11751
11756
 
11752
11757
  interface PanneauRegistreShellLabels {
11753
11758
  /** Accessible name of the left-edge resize handle. */
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { Button } from '@base-ui/react/button';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import * as React30 from 'react';
6
- import { useState, useEffect, useRef, useId, useLayoutEffect, useCallback, useMemo } from 'react';
6
+ import { createContext, useState, useEffect, useRef, useId, useLayoutEffect, useCallback, useMemo, useContext } from 'react';
7
7
  import { Accordion } from '@base-ui/react/accordion';
8
8
  export { Accordion } from '@base-ui/react/accordion';
9
9
  import { Checkbox } from '@base-ui/react/checkbox';
@@ -33,7 +33,7 @@ import { Drawer, Button as Button$1, Popover as Popover$1, Checkbox as Checkbox$
33
33
  import { ChevronUp, ChevronDown, Minimize2, Maximize2, Pencil } from 'lucide-react';
34
34
 
35
35
  // src/version.ts
36
- var version = "0.5.37-alpha";
36
+ var version = "0.5.38-alpha";
37
37
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
38
38
  return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
39
39
  }
@@ -18209,6 +18209,86 @@ function MosaicAdminOnlyGuard(props) {
18209
18209
  return /* @__PURE__ */ jsx(Fragment, { children });
18210
18210
  }
18211
18211
  MosaicAdminOnlyGuard.displayName = "MosaicAdminOnlyGuard";
18212
+ var registreGridTheme = themeQuartz.withParams({
18213
+ accentColor: "var(--accent)",
18214
+ backgroundColor: "var(--surface)",
18215
+ foregroundColor: "var(--foreground)",
18216
+ textColor: "var(--foreground)",
18217
+ borderColor: "var(--border)",
18218
+ headerBackgroundColor: "var(--surface-secondary)",
18219
+ headerTextColor: "var(--surface-secondary-foreground)",
18220
+ headerFontWeight: 600,
18221
+ fontFamily: "var(--font-sans)",
18222
+ fontSize: 14,
18223
+ headerFontSize: 13,
18224
+ rowHeight: 40,
18225
+ headerHeight: 44,
18226
+ spacing: 8,
18227
+ wrapperBorderRadius: 8,
18228
+ rowHoverColor: "var(--surface-hover)"
18229
+ // No `selectedRowBackgroundColor`: the grid does not use the native AG Grid row
18230
+ // selection. A host highlights its selected row through `getRowStyle`.
18231
+ });
18232
+ var fitGridWidthStrategy = {
18233
+ type: "fitGridWidth"
18234
+ };
18235
+ function refitColumns(e) {
18236
+ e.api.sizeColumnsToFit();
18237
+ }
18238
+ var modulesRegistered = false;
18239
+ function ensureModules() {
18240
+ if (modulesRegistered) return;
18241
+ ModuleRegistry.registerModules([AllCommunityModule]);
18242
+ modulesRegistered = true;
18243
+ }
18244
+ var DEFAUTS = {
18245
+ resizable: true,
18246
+ sortable: true,
18247
+ filter: true,
18248
+ floatingFilter: true
18249
+ };
18250
+ function GrilleRegistre({
18251
+ lignes,
18252
+ columnDefs,
18253
+ getRowId,
18254
+ filtreGlobal,
18255
+ theme = registreGridTheme,
18256
+ onGridReady,
18257
+ onCelluleEditee,
18258
+ getRowStyle,
18259
+ tooltipShowDelay,
18260
+ suppressCellFocus,
18261
+ onCellClicked,
18262
+ rowHeight,
18263
+ domLayout,
18264
+ onGridSizeChanged,
18265
+ messageVide
18266
+ }) {
18267
+ ensureModules();
18268
+ return /* @__PURE__ */ jsx("div", { className: "isolate h-full min-h-0 w-full", children: /* @__PURE__ */ jsx(
18269
+ AgGridReact,
18270
+ {
18271
+ theme,
18272
+ autoSizeStrategy: fitGridWidthStrategy,
18273
+ rowData: lignes,
18274
+ columnDefs,
18275
+ defaultColDef: DEFAUTS,
18276
+ quickFilterText: filtreGlobal,
18277
+ getRowId: (p) => getRowId(p.data),
18278
+ onGridReady,
18279
+ onCellValueChanged: onCelluleEditee,
18280
+ onCellClicked,
18281
+ getRowStyle,
18282
+ tooltipShowDelay,
18283
+ suppressCellFocus,
18284
+ rowHeight,
18285
+ domLayout,
18286
+ onGridSizeChanged,
18287
+ overlayComponentParams: messageVide === void 0 ? void 0 : { noRows: { overlayText: messageVide } },
18288
+ animateRows: true
18289
+ }
18290
+ ) });
18291
+ }
18212
18292
 
18213
18293
  // src/components/document-review/panel-tab.ts
18214
18294
  var REVIEW_PANEL_TABS = ["compare", "document", "row"];
@@ -18289,6 +18369,22 @@ function correctionOutcome(result) {
18289
18369
  if (!result.ok) return "failed";
18290
18370
  return result.confirmed ? "ok" : "uncertain";
18291
18371
  }
18372
+ var SelectedRowIdContext = createContext(null);
18373
+ function OpenRowButton({ value, node }) {
18374
+ const selectedRowId = useContext(SelectedRowIdContext);
18375
+ const isSelected = node.id !== void 0 && node.id === selectedRowId;
18376
+ return /* @__PURE__ */ jsx(
18377
+ "button",
18378
+ {
18379
+ type: "button",
18380
+ "data-slot": "document-table-open",
18381
+ "aria-current": isSelected ? "true" : void 0,
18382
+ "data-selected": isSelected ? "true" : void 0,
18383
+ className: "text-left underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
18384
+ children: value
18385
+ }
18386
+ );
18387
+ }
18292
18388
  function MosaicDocumentTable({
18293
18389
  columns,
18294
18390
  rows,
@@ -18307,57 +18403,53 @@ function MosaicDocumentTable({
18307
18403
  if (!isControlled) setInternalSelectedRowId(rowId);
18308
18404
  onSelectedRowChange?.(rowId);
18309
18405
  }
18310
- const shown = visibleColumns(columns, columnVisibility ?? initialColumnVisibility(columns));
18311
- const tableColumns = shown.map((column, columnIndex) => ({
18312
- key: column.id,
18313
- header: column.label,
18314
- render: (row) => {
18315
- const value = column.accessor(row);
18316
- const text = value === null ? "" : String(value);
18317
- if (columnIndex !== 0) return text;
18318
- const isSelected = getRowId(row) === selectedRowId;
18319
- return /* @__PURE__ */ jsx(
18320
- "button",
18321
- {
18322
- type: "button",
18323
- "data-slot": "document-table-open",
18324
- "aria-current": isSelected ? "true" : void 0,
18325
- "data-selected": isSelected ? "true" : void 0,
18326
- className: "text-left underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
18327
- children: text
18328
- }
18329
- );
18330
- }
18331
- }));
18332
- function handleClick(event) {
18333
- const tr = event.target.closest("tr[data-slot='data-table-row']");
18334
- if (!(tr instanceof HTMLTableRowElement)) return;
18335
- const row = rows[tr.sectionRowIndex];
18336
- if (row !== void 0) select(getRowId(row));
18406
+ const columnDefs = useMemo(
18407
+ () => visibleColumns(columns, columnVisibility ?? initialColumnVisibility(columns)).map(
18408
+ (column, columnIndex) => ({
18409
+ colId: column.id,
18410
+ headerName: column.label,
18411
+ // The column model's value, as text: null reads as an empty cell.
18412
+ valueGetter: (params) => {
18413
+ if (params.data === void 0) return "";
18414
+ const value = column.accessor(params.data);
18415
+ return value === null ? "" : String(value);
18416
+ },
18417
+ // No type inference: a boolean stays text, never a grid checkbox.
18418
+ cellDataType: false,
18419
+ sortable: false,
18420
+ filter: false,
18421
+ floatingFilter: false,
18422
+ ...columnIndex === 0 ? { cellRenderer: OpenRowButton } : {}
18423
+ })
18424
+ ),
18425
+ [columns, columnVisibility]
18426
+ );
18427
+ function handleCellClicked(event) {
18428
+ if (event.data !== void 0) select(getRowId(event.data));
18337
18429
  }
18338
18430
  const orderedRowIds = rows.map(getRowId);
18339
18431
  const selectedRow = selectedRowId === null ? void 0 : rows.find((row) => getRowId(row) === selectedRowId);
18340
- return (
18341
- // biome-ignore lint/a11y/useKeyWithClickEvents: keyboard path is the first column's real <button>; this only resolves mouse clicks on other cells to their row
18342
- /* @__PURE__ */ jsxs("div", { "data-slot": "document-table", className, onClick: handleClick, children: [
18343
- /* @__PURE__ */ jsx(
18344
- MosaicDataTable,
18345
- {
18346
- columns: tableColumns,
18347
- rows,
18348
- getRowKey: (row) => getRowId(row),
18349
- sortable: false,
18350
- emptyMessage
18351
- }
18352
- ),
18353
- selectedRow !== void 0 && renderPanel ? renderPanel(selectedRow, {
18354
- rowId: getRowId(selectedRow),
18355
- orderedRowIds,
18356
- selectRow: (rowId) => select(rowId),
18357
- closeRow: () => select(null)
18358
- }) : null
18359
- ] })
18360
- );
18432
+ return /* @__PURE__ */ jsxs("div", { "data-slot": "document-table", className, children: [
18433
+ /* @__PURE__ */ jsx(SelectedRowIdContext.Provider, { value: selectedRowId, children: /* @__PURE__ */ jsx(
18434
+ GrilleRegistre,
18435
+ {
18436
+ lignes: rows,
18437
+ columnDefs,
18438
+ getRowId,
18439
+ onCellClicked: handleCellClicked,
18440
+ suppressCellFocus: true,
18441
+ domLayout: "autoHeight",
18442
+ onGridSizeChanged: refitColumns,
18443
+ messageVide: emptyMessage
18444
+ }
18445
+ ) }),
18446
+ selectedRow !== void 0 && renderPanel ? renderPanel(selectedRow, {
18447
+ rowId: getRowId(selectedRow),
18448
+ orderedRowIds,
18449
+ selectRow: (rowId) => select(rowId),
18450
+ closeRow: () => select(null)
18451
+ }) : null
18452
+ ] });
18361
18453
  }
18362
18454
  MosaicDocumentTable.displayName = "MosaicDocumentTable";
18363
18455
  function MosaicDocumentCriteriaPanel({
@@ -18490,84 +18582,6 @@ function MosaicDocumentCriteriaPanel({
18490
18582
  );
18491
18583
  }
18492
18584
  MosaicDocumentCriteriaPanel.displayName = "MosaicDocumentCriteriaPanel";
18493
- var registreGridTheme = themeQuartz.withParams({
18494
- accentColor: "var(--accent)",
18495
- backgroundColor: "var(--surface)",
18496
- foregroundColor: "var(--foreground)",
18497
- textColor: "var(--foreground)",
18498
- borderColor: "var(--border)",
18499
- headerBackgroundColor: "var(--surface-secondary)",
18500
- headerTextColor: "var(--surface-secondary-foreground)",
18501
- headerFontWeight: 600,
18502
- fontFamily: "var(--font-sans)",
18503
- fontSize: 14,
18504
- headerFontSize: 13,
18505
- rowHeight: 40,
18506
- headerHeight: 44,
18507
- spacing: 8,
18508
- wrapperBorderRadius: 8,
18509
- rowHoverColor: "var(--surface-hover)"
18510
- // No `selectedRowBackgroundColor`: the grid does not use the native AG Grid row
18511
- // selection. A host highlights its selected row through `getRowStyle`.
18512
- });
18513
- var fitGridWidthStrategy = {
18514
- type: "fitGridWidth"
18515
- };
18516
- function refitColumns(e) {
18517
- e.api.sizeColumnsToFit();
18518
- }
18519
- var modulesRegistered = false;
18520
- function ensureModules() {
18521
- if (modulesRegistered) return;
18522
- ModuleRegistry.registerModules([AllCommunityModule]);
18523
- modulesRegistered = true;
18524
- }
18525
- var DEFAUTS = {
18526
- resizable: true,
18527
- sortable: true,
18528
- filter: true,
18529
- floatingFilter: true
18530
- };
18531
- function GrilleRegistre({
18532
- lignes,
18533
- columnDefs,
18534
- getRowId,
18535
- filtreGlobal,
18536
- theme = registreGridTheme,
18537
- onGridReady,
18538
- onCelluleEditee,
18539
- getRowStyle,
18540
- tooltipShowDelay,
18541
- suppressCellFocus,
18542
- onCellClicked,
18543
- rowHeight,
18544
- domLayout,
18545
- onGridSizeChanged
18546
- }) {
18547
- ensureModules();
18548
- return /* @__PURE__ */ jsx("div", { className: "isolate h-full min-h-0 w-full", children: /* @__PURE__ */ jsx(
18549
- AgGridReact,
18550
- {
18551
- theme,
18552
- autoSizeStrategy: fitGridWidthStrategy,
18553
- rowData: lignes,
18554
- columnDefs,
18555
- defaultColDef: DEFAUTS,
18556
- quickFilterText: filtreGlobal,
18557
- getRowId: (p) => getRowId(p.data),
18558
- onGridReady,
18559
- onCellValueChanged: onCelluleEditee,
18560
- onCellClicked,
18561
- getRowStyle,
18562
- tooltipShowDelay,
18563
- suppressCellFocus,
18564
- rowHeight,
18565
- domLayout,
18566
- onGridSizeChanged,
18567
- animateRows: true
18568
- }
18569
- ) });
18570
- }
18571
18585
  var DEFAULT_WIDTH_RATIO = 0.45;
18572
18586
  var MIN_WIDTH_PX = 360;
18573
18587
  var MAX_WIDTH_RATIO = 0.9;