@vantageos/mosaic-blocks 0.5.37-alpha → 0.5.39-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 +149 -127
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +18 -2
  4. package/dist/index.d.ts +18 -2
  5. package/dist/index.js +150 -128
  6. package/dist/index.js.map +1 -1
  7. package/package.json +2 -2
  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.cjs CHANGED
@@ -52,7 +52,7 @@ function _interopNamespace(e) {
52
52
  var React30__namespace = /*#__PURE__*/_interopNamespace(React30);
53
53
 
54
54
  // src/version.ts
55
- var version = "0.5.37-alpha";
55
+ var version = "0.5.39-alpha";
56
56
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
57
57
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
58
58
  }
@@ -18228,6 +18228,94 @@ function MosaicAdminOnlyGuard(props) {
18228
18228
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
18229
18229
  }
18230
18230
  MosaicAdminOnlyGuard.displayName = "MosaicAdminOnlyGuard";
18231
+ var registreGridTheme = agGridCommunity.themeQuartz.withParams({
18232
+ accentColor: "var(--accent)",
18233
+ backgroundColor: "var(--surface)",
18234
+ foregroundColor: "var(--foreground)",
18235
+ textColor: "var(--foreground)",
18236
+ borderColor: "var(--border)",
18237
+ headerBackgroundColor: "var(--surface-secondary)",
18238
+ headerTextColor: "var(--surface-secondary-foreground)",
18239
+ headerFontWeight: 600,
18240
+ fontFamily: "var(--font-sans)",
18241
+ fontSize: 14,
18242
+ headerFontSize: 13,
18243
+ rowHeight: 40,
18244
+ headerHeight: 44,
18245
+ spacing: 8,
18246
+ wrapperBorderRadius: 8,
18247
+ rowHoverColor: "var(--surface-hover)"
18248
+ // No `selectedRowBackgroundColor`: the grid does not use the native AG Grid row
18249
+ // selection. A host highlights its selected row through `getRowStyle`.
18250
+ });
18251
+ var fitGridWidthStrategy = {
18252
+ type: "fitGridWidth"
18253
+ };
18254
+ function refitColumns(e) {
18255
+ e.api.sizeColumnsToFit();
18256
+ }
18257
+ var modulesRegistered = false;
18258
+ function ensureModules() {
18259
+ if (modulesRegistered) return;
18260
+ agGridCommunity.ModuleRegistry.registerModules([agGridCommunity.AllCommunityModule]);
18261
+ modulesRegistered = true;
18262
+ }
18263
+ var DEFAUTS = {
18264
+ resizable: true,
18265
+ sortable: true,
18266
+ filter: true,
18267
+ floatingFilter: true
18268
+ };
18269
+ function GrilleRegistre({
18270
+ lignes,
18271
+ columnDefs,
18272
+ getRowId,
18273
+ filtreGlobal,
18274
+ theme = registreGridTheme,
18275
+ onGridReady,
18276
+ onCelluleEditee,
18277
+ getRowStyle,
18278
+ tooltipShowDelay,
18279
+ suppressCellFocus,
18280
+ onCellClicked,
18281
+ rowHeight,
18282
+ domLayout,
18283
+ onGridSizeChanged,
18284
+ messageVide,
18285
+ pagination,
18286
+ paginationPageSize,
18287
+ paginationPageSizeSelector,
18288
+ localeText
18289
+ }) {
18290
+ ensureModules();
18291
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "isolate h-full min-h-0 w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
18292
+ agGridReact.AgGridReact,
18293
+ {
18294
+ theme,
18295
+ autoSizeStrategy: fitGridWidthStrategy,
18296
+ rowData: lignes,
18297
+ columnDefs,
18298
+ defaultColDef: DEFAUTS,
18299
+ quickFilterText: filtreGlobal,
18300
+ getRowId: (p) => getRowId(p.data),
18301
+ onGridReady,
18302
+ onCellValueChanged: onCelluleEditee,
18303
+ onCellClicked,
18304
+ getRowStyle,
18305
+ tooltipShowDelay,
18306
+ suppressCellFocus,
18307
+ rowHeight,
18308
+ domLayout,
18309
+ onGridSizeChanged,
18310
+ overlayComponentParams: messageVide === void 0 ? void 0 : { noRows: { overlayText: messageVide } },
18311
+ pagination,
18312
+ paginationPageSize,
18313
+ paginationPageSizeSelector,
18314
+ localeText,
18315
+ animateRows: true
18316
+ }
18317
+ ) });
18318
+ }
18231
18319
 
18232
18320
  // src/components/document-review/panel-tab.ts
18233
18321
  var REVIEW_PANEL_TABS = ["compare", "document", "row"];
@@ -18308,6 +18396,22 @@ function correctionOutcome(result) {
18308
18396
  if (!result.ok) return "failed";
18309
18397
  return result.confirmed ? "ok" : "uncertain";
18310
18398
  }
18399
+ var SelectedRowIdContext = React30.createContext(null);
18400
+ function OpenRowButton({ value, node }) {
18401
+ const selectedRowId = React30.useContext(SelectedRowIdContext);
18402
+ const isSelected = node.id !== void 0 && node.id === selectedRowId;
18403
+ return /* @__PURE__ */ jsxRuntime.jsx(
18404
+ "button",
18405
+ {
18406
+ type: "button",
18407
+ "data-slot": "document-table-open",
18408
+ "aria-current": isSelected ? "true" : void 0,
18409
+ "data-selected": isSelected ? "true" : void 0,
18410
+ className: "text-left underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
18411
+ children: value
18412
+ }
18413
+ );
18414
+ }
18311
18415
  function MosaicDocumentTable({
18312
18416
  columns,
18313
18417
  rows,
@@ -18326,57 +18430,53 @@ function MosaicDocumentTable({
18326
18430
  if (!isControlled) setInternalSelectedRowId(rowId);
18327
18431
  onSelectedRowChange?.(rowId);
18328
18432
  }
18329
- const shown = visibleColumns(columns, columnVisibility ?? initialColumnVisibility(columns));
18330
- const tableColumns = shown.map((column, columnIndex) => ({
18331
- key: column.id,
18332
- header: column.label,
18333
- render: (row) => {
18334
- const value = column.accessor(row);
18335
- const text = value === null ? "" : String(value);
18336
- if (columnIndex !== 0) return text;
18337
- const isSelected = getRowId(row) === selectedRowId;
18338
- return /* @__PURE__ */ jsxRuntime.jsx(
18339
- "button",
18340
- {
18341
- type: "button",
18342
- "data-slot": "document-table-open",
18343
- "aria-current": isSelected ? "true" : void 0,
18344
- "data-selected": isSelected ? "true" : void 0,
18345
- className: "text-left underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
18346
- children: text
18347
- }
18348
- );
18349
- }
18350
- }));
18351
- function handleClick(event) {
18352
- const tr = event.target.closest("tr[data-slot='data-table-row']");
18353
- if (!(tr instanceof HTMLTableRowElement)) return;
18354
- const row = rows[tr.sectionRowIndex];
18355
- if (row !== void 0) select(getRowId(row));
18433
+ const columnDefs = React30.useMemo(
18434
+ () => visibleColumns(columns, columnVisibility ?? initialColumnVisibility(columns)).map(
18435
+ (column, columnIndex) => ({
18436
+ colId: column.id,
18437
+ headerName: column.label,
18438
+ // The column model's value, as text: null reads as an empty cell.
18439
+ valueGetter: (params) => {
18440
+ if (params.data === void 0) return "";
18441
+ const value = column.accessor(params.data);
18442
+ return value === null ? "" : String(value);
18443
+ },
18444
+ // No type inference: a boolean stays text, never a grid checkbox.
18445
+ cellDataType: false,
18446
+ sortable: false,
18447
+ filter: false,
18448
+ floatingFilter: false,
18449
+ ...columnIndex === 0 ? { cellRenderer: OpenRowButton } : {}
18450
+ })
18451
+ ),
18452
+ [columns, columnVisibility]
18453
+ );
18454
+ function handleCellClicked(event) {
18455
+ if (event.data !== void 0) select(getRowId(event.data));
18356
18456
  }
18357
18457
  const orderedRowIds = rows.map(getRowId);
18358
18458
  const selectedRow = selectedRowId === null ? void 0 : rows.find((row) => getRowId(row) === selectedRowId);
18359
- return (
18360
- // 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
18361
- /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "document-table", className, onClick: handleClick, children: [
18362
- /* @__PURE__ */ jsxRuntime.jsx(
18363
- MosaicDataTable,
18364
- {
18365
- columns: tableColumns,
18366
- rows,
18367
- getRowKey: (row) => getRowId(row),
18368
- sortable: false,
18369
- emptyMessage
18370
- }
18371
- ),
18372
- selectedRow !== void 0 && renderPanel ? renderPanel(selectedRow, {
18373
- rowId: getRowId(selectedRow),
18374
- orderedRowIds,
18375
- selectRow: (rowId) => select(rowId),
18376
- closeRow: () => select(null)
18377
- }) : null
18378
- ] })
18379
- );
18459
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "document-table", className, children: [
18460
+ /* @__PURE__ */ jsxRuntime.jsx(SelectedRowIdContext.Provider, { value: selectedRowId, children: /* @__PURE__ */ jsxRuntime.jsx(
18461
+ GrilleRegistre,
18462
+ {
18463
+ lignes: rows,
18464
+ columnDefs,
18465
+ getRowId,
18466
+ onCellClicked: handleCellClicked,
18467
+ suppressCellFocus: true,
18468
+ domLayout: "autoHeight",
18469
+ onGridSizeChanged: refitColumns,
18470
+ messageVide: emptyMessage
18471
+ }
18472
+ ) }),
18473
+ selectedRow !== void 0 && renderPanel ? renderPanel(selectedRow, {
18474
+ rowId: getRowId(selectedRow),
18475
+ orderedRowIds,
18476
+ selectRow: (rowId) => select(rowId),
18477
+ closeRow: () => select(null)
18478
+ }) : null
18479
+ ] });
18380
18480
  }
18381
18481
  MosaicDocumentTable.displayName = "MosaicDocumentTable";
18382
18482
  function MosaicDocumentCriteriaPanel({
@@ -18509,84 +18609,6 @@ function MosaicDocumentCriteriaPanel({
18509
18609
  );
18510
18610
  }
18511
18611
  MosaicDocumentCriteriaPanel.displayName = "MosaicDocumentCriteriaPanel";
18512
- var registreGridTheme = agGridCommunity.themeQuartz.withParams({
18513
- accentColor: "var(--accent)",
18514
- backgroundColor: "var(--surface)",
18515
- foregroundColor: "var(--foreground)",
18516
- textColor: "var(--foreground)",
18517
- borderColor: "var(--border)",
18518
- headerBackgroundColor: "var(--surface-secondary)",
18519
- headerTextColor: "var(--surface-secondary-foreground)",
18520
- headerFontWeight: 600,
18521
- fontFamily: "var(--font-sans)",
18522
- fontSize: 14,
18523
- headerFontSize: 13,
18524
- rowHeight: 40,
18525
- headerHeight: 44,
18526
- spacing: 8,
18527
- wrapperBorderRadius: 8,
18528
- rowHoverColor: "var(--surface-hover)"
18529
- // No `selectedRowBackgroundColor`: the grid does not use the native AG Grid row
18530
- // selection. A host highlights its selected row through `getRowStyle`.
18531
- });
18532
- var fitGridWidthStrategy = {
18533
- type: "fitGridWidth"
18534
- };
18535
- function refitColumns(e) {
18536
- e.api.sizeColumnsToFit();
18537
- }
18538
- var modulesRegistered = false;
18539
- function ensureModules() {
18540
- if (modulesRegistered) return;
18541
- agGridCommunity.ModuleRegistry.registerModules([agGridCommunity.AllCommunityModule]);
18542
- modulesRegistered = true;
18543
- }
18544
- var DEFAUTS = {
18545
- resizable: true,
18546
- sortable: true,
18547
- filter: true,
18548
- floatingFilter: true
18549
- };
18550
- function GrilleRegistre({
18551
- lignes,
18552
- columnDefs,
18553
- getRowId,
18554
- filtreGlobal,
18555
- theme = registreGridTheme,
18556
- onGridReady,
18557
- onCelluleEditee,
18558
- getRowStyle,
18559
- tooltipShowDelay,
18560
- suppressCellFocus,
18561
- onCellClicked,
18562
- rowHeight,
18563
- domLayout,
18564
- onGridSizeChanged
18565
- }) {
18566
- ensureModules();
18567
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "isolate h-full min-h-0 w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
18568
- agGridReact.AgGridReact,
18569
- {
18570
- theme,
18571
- autoSizeStrategy: fitGridWidthStrategy,
18572
- rowData: lignes,
18573
- columnDefs,
18574
- defaultColDef: DEFAUTS,
18575
- quickFilterText: filtreGlobal,
18576
- getRowId: (p) => getRowId(p.data),
18577
- onGridReady,
18578
- onCellValueChanged: onCelluleEditee,
18579
- onCellClicked,
18580
- getRowStyle,
18581
- tooltipShowDelay,
18582
- suppressCellFocus,
18583
- rowHeight,
18584
- domLayout,
18585
- onGridSizeChanged,
18586
- animateRows: true
18587
- }
18588
- ) });
18589
- }
18590
18612
  var DEFAULT_WIDTH_RATIO = 0.45;
18591
18613
  var MIN_WIDTH_PX = 360;
18592
18614
  var MAX_WIDTH_RATIO = 0.9;