@ai-matrx/records-ui 0.113.22 → 0.113.24

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.js CHANGED
@@ -13247,6 +13247,7 @@ function EmptyRecords({ words: words2 }) {
13247
13247
 
13248
13248
  // src/gridControls.tsx
13249
13249
  import { copyText as writeClipboardText, readText as readClipboardText } from "@ai-matrx/kit/clipboard";
13250
+ import { onRecordChanged } from "@ai-matrx/records/core";
13250
13251
  import { useCallback as useCallback18, useEffect as useEffect37, useMemo as useMemo22, useRef as useRef26, useState as useState46 } from "react";
13251
13252
  import { tableShapeChanged as tableShapeChanged5, useFieldMutation as useFieldMutation2, useRecordsClient as useRecordsClient25, useReverseColumns as useReverseColumns2 } from "@ai-matrx/records/react";
13252
13253
  import {
@@ -15851,7 +15852,7 @@ function gridRefusalForPastedCell(field2, value) {
15851
15852
 
15852
15853
  // src/gridControls.tsx
15853
15854
  import { Fragment as Fragment16, jsx as jsx57, jsxs as jsxs52 } from "react/jsx-runtime";
15854
- var VALUE_COUNTS_FRESH_MS = 1500;
15855
+ var VALUE_COUNTS_FRESH_MS = 1e4;
15855
15856
  var CLEAN_TABLE_LABEL = "Clean table\u2026";
15856
15857
  function filterForValue(field2, value) {
15857
15858
  const empty = value === null || value === void 0 || value === "";
@@ -15974,6 +15975,7 @@ function useMergedGridControls(args) {
15974
15975
  const fieldsRef = useRef26(fields);
15975
15976
  fieldsRef.current = fields;
15976
15977
  const [choiceCounts, setChoiceCounts] = useState46({});
15978
+ useEffect37(() => onRecordChanged(() => forgetAsked(client, `value_counts:${tableId}:`)), [client, tableId]);
15977
15979
  useEffect37(() => {
15978
15980
  if (!enabled || choiceKeys.length === 0) {
15979
15981
  setChoiceCounts({});
@@ -47507,7 +47509,7 @@ import {
47507
47509
  useTable as useTable33,
47508
47510
  useRowActions as useRowActions2
47509
47511
  } from "@ai-matrx/records/react";
47510
- import { onRecordChanged } from "@ai-matrx/records/core";
47512
+ import { onRecordChanged as onRecordChanged2 } from "@ai-matrx/records/core";
47511
47513
  import { BasicInput as BasicInput35, Button as Button99, Checkbox as Checkbox17, Skeleton as Skeleton36, cn as cn88 } from "@ai-matrx/design-system";
47512
47514
  import { Fragment as Fragment61, jsx as jsx149, jsxs as jsxs138 } from "react/jsx-runtime";
47513
47515
  var EDIT_LEVELS = /* @__PURE__ */ new Set(["edit_content", "editor", "admin", "owner"]);
@@ -47923,7 +47925,7 @@ function ListBlockView({
47923
47925
  ...sort.length > 0 ? { sort } : {}
47924
47926
  });
47925
47927
  const reload = page.reload;
47926
- useEffect108(() => onRecordChanged(() => reload()), [reload]);
47928
+ useEffect108(() => onRecordChanged2(() => reload()), [reload]);
47927
47929
  const rows = nobodyIsMe ? [] : page.data?.rows ?? [];
47928
47930
  const columns = block.columns && block.columns.length > 0 ? block.columns.map((k) => all.find((f) => f.key === k)).filter((f) => !!f) : [...all].sort((a, b) => (a.sort ?? 100) - (b.sort ?? 100)).slice(0, DEFAULT_COLUMNS);
47929
47931
  const firstId = rows[0]?.id ?? null;