@gemina/elements 0.13.1 → 0.13.3

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.d.cts CHANGED
@@ -5,6 +5,6 @@ import 'react';
5
5
  import '@gemina/sdk';
6
6
 
7
7
  /** Package version. Keep in sync with package.json. */
8
- declare const VERSION = "0.13.1";
8
+ declare const VERSION = "0.13.3";
9
9
 
10
10
  export { VERSION };
package/dist/index.d.ts CHANGED
@@ -5,6 +5,6 @@ import 'react';
5
5
  import '@gemina/sdk';
6
6
 
7
7
  /** Package version. Keep in sync with package.json. */
8
- declare const VERSION = "0.13.1";
8
+ declare const VERSION = "0.13.3";
9
9
 
10
10
  export { VERSION };
package/dist/index.js CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-CUOHJGPN.js";
4
4
  import {
5
5
  GeminaChat
6
- } from "./chunk-6KHHCUSJ.js";
6
+ } from "./chunk-MPBZCA44.js";
7
7
  import {
8
8
  GeminaVerification
9
- } from "./chunk-A5PZTHDE.js";
9
+ } from "./chunk-XEWKY2DW.js";
10
10
  import {
11
11
  VERSION
12
- } from "./chunk-X5TSIIUP.js";
12
+ } from "./chunk-GWTTD7QH.js";
13
13
  export {
14
14
  GeminaChat,
15
15
  GeminaTokenManager,
@@ -929,8 +929,16 @@ function forEachRowUnit(tables, plannedTables, visit) {
929
929
  const meta = row?.[ROW_META_KEY];
930
930
  return meta?.confidence ?? null;
931
931
  };
932
+ const planFor = (tablePointer) => {
933
+ const exact = plannedTables.get(tablePointer);
934
+ if (exact !== void 0) return exact;
935
+ for (const [serverPointer, planned] of plannedTables) {
936
+ if (matchesTablePointer(serverPointer, tablePointer)) return planned;
937
+ }
938
+ return void 0;
939
+ };
932
940
  for (const table of tables) {
933
- const planned = plannedTables.get(table.pointer);
941
+ const planned = planFor(table.pointer);
934
942
  if (planned) {
935
943
  for (const row of planned) {
936
944
  const { source } = row.entry;
@@ -2066,35 +2074,42 @@ function HeaderSection(props) {
2066
2074
  }
2067
2075
  function EntitySection(props) {
2068
2076
  const { entity, shared } = props;
2069
- const visibleItems = entity.items.map((item) => Object.fromEntries(
2070
- Object.entries(item).filter(([, cellValue]) => !shared.hidden.fields.has(cellValue.pointer))
2071
- )).filter((item) => Object.keys(item).length > 0);
2077
+ const visibleItems = entity.items.map((item, index) => ({
2078
+ index,
2079
+ cells: Object.fromEntries(
2080
+ Object.entries(item).filter(([, cellValue]) => !shared.hidden.fields.has(cellValue.pointer))
2081
+ )
2082
+ })).filter(({ cells }) => Object.keys(cells).length > 0);
2072
2083
  const label = formatLabel(entity.key);
2073
2084
  const singular = label.replace(/s$/, "");
2074
2085
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "gemina-verification__section", "aria-label": label, children: [
2075
2086
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "gemina-verification__section-header", children: [
2076
2087
  label,
2077
2088
  " (",
2078
- visibleItems.length,
2089
+ entity.items.length,
2079
2090
  ")"
2080
2091
  ] }),
2081
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "gemina-verification__section-body", children: visibleItems.map((item, itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "gemina-verification__card", children: [
2082
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "gemina-verification__card-header", children: [
2083
- singular,
2084
- " ",
2085
- itemIndex + 1
2086
- ] }),
2087
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dl", { className: "gemina-verification__dl", children: Object.entries(item).map(([fieldKey, cell]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2088
- FieldPair,
2089
- {
2090
- label: formatLabel(fieldKey),
2091
- ariaLabel: `${singular} ${itemIndex + 1} \u2014 ${formatLabel(fieldKey)}`,
2092
- cell,
2093
- shared
2094
- },
2095
- fieldKey
2096
- )) })
2097
- ] }, itemIndex)) })
2092
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "gemina-verification__section-body", children: visibleItems.map(({ index, cells }) => (
2093
+ // Keyed by the original index, never the filtered position, or React
2094
+ // reuses a hidden card's DOM (and its focus) for its successor.
2095
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "gemina-verification__card", children: [
2096
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "gemina-verification__card-header", children: [
2097
+ singular,
2098
+ " ",
2099
+ index + 1
2100
+ ] }),
2101
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dl", { className: "gemina-verification__dl", children: Object.entries(cells).map(([fieldKey, cell]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2102
+ FieldPair,
2103
+ {
2104
+ label: formatLabel(fieldKey),
2105
+ ariaLabel: `${singular} ${index + 1} \u2014 ${formatLabel(fieldKey)}`,
2106
+ cell,
2107
+ shared
2108
+ },
2109
+ fieldKey
2110
+ )) })
2111
+ ] }, index)
2112
+ )) })
2098
2113
  ] });
2099
2114
  }
2100
2115
  function TableRowView(props) {
@@ -2285,6 +2300,7 @@ function TableSection(props) {
2285
2300
  needsReview > 0 ? ` \xB7 ${needsReview} need review` : "",
2286
2301
  ")"
2287
2302
  ] }),
2303
+ shared.filterOn && mutable !== void 0 && !shared.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "gemina-verification__filter-note", children: "Row editing is off while filtering" }) : null,
2288
2304
  table.overallConfidence ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "gemina-verification__overall-confidence", children: [
2289
2305
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Overall confidence" }),
2290
2306
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ConfidenceDot, { confidence: table.overallConfidence })
@@ -2453,7 +2469,7 @@ function VerificationForm(props) {
2453
2469
  }
2454
2470
 
2455
2471
  // src/version.ts
2456
- var VERSION = "0.13.1";
2472
+ var VERSION = "0.13.3";
2457
2473
 
2458
2474
  // src/verification/styles.ts
2459
2475
  var DARK_VARS = `
@@ -3036,6 +3052,10 @@ var VERIFICATION_CSS = `
3036
3052
  font-size: 12px;
3037
3053
  color: var(--gemina-verification-muted);
3038
3054
  }
3055
+ .gemina-verification__filter-note {
3056
+ font-size: 12px;
3057
+ color: var(--gemina-verification-muted);
3058
+ }
3039
3059
  .gemina-verification__all-scored {
3040
3060
  margin: 0;
3041
3061
  padding: 12px;
@@ -3754,6 +3774,7 @@ function GeminaVerification(props) {
3754
3774
  [classified, rendered, plannedTables, unmatched]
3755
3775
  );
3756
3776
  const visibleUnits = totalUnits - hidden.fields.size - hidden.rows.size;
3777
+ const allClear = filterOn && totalUnits > 0 && visibleUnits === 0;
3757
3778
  const invalidCount = (0, import_react4.useMemo)(() => {
3758
3779
  const rowLevel = pairErrors.size;
3759
3780
  if (edits.size === 0) {
@@ -3914,7 +3935,7 @@ function GeminaVerification(props) {
3914
3935
  onImageExpired: handleImageExpired
3915
3936
  }
3916
3937
  ),
3917
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3938
+ allClear ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "gemina-verification__all-scored", role: "status", children: `Nothing needs review \u2014 all ${totalUnits} fields scored high.` }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3918
3939
  VerificationForm,
3919
3940
  {
3920
3941
  classified,