@paro.io/expert-shared-components 1.14.66 → 1.14.68

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 (83) hide show
  1. package/lib/components/DocumentCenter/MultiFileUploadSection.js +220 -121
  2. package/lib/components/TaxAxis/TaxAxisApi.d.ts +0 -1
  3. package/lib/components/TaxAxis/TaxAxisShell.js +5 -80
  4. package/lib/components/shared/UploadClient.d.ts +2 -1
  5. package/lib/components/shared/UploadClient.js +6 -2
  6. package/lib/index.d.ts +1 -13
  7. package/lib/index.js +1 -27
  8. package/lib/tax-axis/components/clientReport/ExecutiveSummary.d.ts +4 -1
  9. package/lib/tax-axis/components/clientReport/ExecutiveSummary.js +10 -6
  10. package/lib/tax-axis/components/clientReport/Methodology.js +2 -2
  11. package/lib/tax-axis/components/clientReport/RecommendedStrategies.d.ts +6 -1
  12. package/lib/tax-axis/components/clientReport/RecommendedStrategies.js +26 -24
  13. package/lib/tax-axis/components/clientReport/StrategyCard.d.ts +1 -1
  14. package/lib/tax-axis/components/clientReport/StrategyCard.js +39 -23
  15. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.d.ts +5 -2
  16. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.js +9 -7
  17. package/lib/tax-axis/components/dashboard/DashboardActions.js +6 -5
  18. package/lib/tax-axis/components/dashboard/DashboardSummary.d.ts +6 -1
  19. package/lib/tax-axis/components/dashboard/DashboardSummary.js +19 -10
  20. package/lib/tax-axis/components/dashboard/StrategyDetailPanel.d.ts +1 -1
  21. package/lib/tax-axis/components/dashboard/StrategyDetailPanel.js +122 -95
  22. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.d.ts +58 -4
  23. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.js +375 -56
  24. package/lib/tax-axis/components/documents/DocumentCard.d.ts +6 -3
  25. package/lib/tax-axis/components/documents/DocumentCard.js +72 -15
  26. package/lib/tax-axis/components/documents/DocumentReviewModal.d.ts +3 -2
  27. package/lib/tax-axis/components/documents/DocumentReviewModal.js +109 -295
  28. package/lib/tax-axis/components/documents/DocumentTier.d.ts +5 -4
  29. package/lib/tax-axis/components/documents/DocumentTier.js +2 -2
  30. package/lib/tax-axis/components/documents/TaxAxisDocuments.d.ts +28 -8
  31. package/lib/tax-axis/components/documents/TaxAxisDocuments.js +335 -172
  32. package/lib/tax-axis/components/documents/qbo/QboAvailableReportsModal.d.ts +13 -0
  33. package/lib/tax-axis/components/documents/qbo/QboAvailableReportsModal.js +180 -0
  34. package/lib/tax-axis/components/documents/qbo/QboClientSelectorModal.d.ts +10 -0
  35. package/lib/tax-axis/components/documents/qbo/QboClientSelectorModal.js +155 -0
  36. package/lib/tax-axis/components/documents/qbo/QboConnectBanner.d.ts +9 -0
  37. package/lib/tax-axis/components/documents/qbo/QboConnectBanner.js +55 -0
  38. package/lib/tax-axis/components/documents/qbo/QboDocumentMappingModal.d.ts +10 -0
  39. package/lib/tax-axis/components/documents/qbo/QboDocumentMappingModal.js +202 -0
  40. package/lib/tax-axis/components/documents/qbo/QboImportingModal.d.ts +8 -0
  41. package/lib/tax-axis/components/documents/qbo/QboImportingModal.js +75 -0
  42. package/lib/tax-axis/components/documents/qbo/QboPermissionsModal.d.ts +8 -0
  43. package/lib/tax-axis/components/documents/qbo/QboPermissionsModal.js +126 -0
  44. package/lib/tax-axis/components/documents/qbo/index.d.ts +8 -0
  45. package/lib/tax-axis/components/documents/qbo/index.js +17 -0
  46. package/lib/tax-axis/components/documents/qbo/qboConstants.d.ts +24 -0
  47. package/lib/tax-axis/components/documents/qbo/qboConstants.js +71 -0
  48. package/lib/tax-axis/components/documents/qbo/types.d.ts +43 -0
  49. package/lib/tax-axis/components/documents/qbo/types.js +3 -0
  50. package/lib/tax-axis/components/documents/qbo/useQboFlow.d.ts +19 -0
  51. package/lib/tax-axis/components/documents/qbo/useQboFlow.js +207 -0
  52. package/lib/tax-axis/components/intake/ClientParametersSection.js +11 -30
  53. package/lib/tax-axis/components/intake/CpaIntakeQuestionsSection.js +3 -3
  54. package/lib/tax-axis/components/intake/IntakeCtaCards.d.ts +1 -2
  55. package/lib/tax-axis/components/intake/IntakeCtaCards.js +6 -13
  56. package/lib/tax-axis/components/intake/RefineAnalysisSection.js +7 -7
  57. package/lib/tax-axis/components/intake/StrategyRadar.js +25 -4
  58. package/lib/tax-axis/components/intake/TaxAxisIntake.js +7 -95
  59. package/lib/tax-axis/components/intake/intakeSchema.d.ts +3 -3
  60. package/lib/tax-axis/components/intake/intakeSchema.js +4 -4
  61. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.d.ts +23 -4
  62. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.js +15 -4
  63. package/lib/tax-axis/components/processing/TaxAxisProcessing.d.ts +2 -1
  64. package/lib/tax-axis/components/processing/TaxAxisProcessing.js +102 -31
  65. package/lib/tax-axis/components/prospectReport/ProspectPrintView.js +0 -2
  66. package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.d.ts +1 -8
  67. package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.js +5 -5
  68. package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.d.ts +1 -27
  69. package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.js +25 -43
  70. package/lib/tax-axis/index.d.ts +3 -1
  71. package/lib/tax-axis/index.js +4 -3
  72. package/lib/tax-axis/lib/adapters/useEngineOutput.d.ts +60 -21
  73. package/lib/tax-axis/lib/adapters/useEngineOutput.js +51 -7
  74. package/lib/tax-axis/lib/compute/index.js +6 -0
  75. package/lib/tax-axis/lib/data/documents.d.ts +3 -2
  76. package/lib/tax-axis/lib/data/documents.js +225 -25
  77. package/lib/tax-axis/lib/data/strategies.js +53 -55
  78. package/lib/tax-axis/lib/documentFieldCatalog.d.ts +5 -10
  79. package/lib/tax-axis/lib/documentFieldCatalog.js +193 -8
  80. package/lib/tax-axis/lib/types/index.d.ts +14 -2
  81. package/package.json +1 -1
  82. package/lib/README.md +0 -2
  83. package/lib/package.json +0 -68
@@ -22,19 +22,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
25
34
  Object.defineProperty(exports, "__esModule", { value: true });
26
35
  exports.SAVE_FIELD_EDIT_MUTATION = exports.EXTRACTED_FIELDS_QUERY = void 0;
27
36
  exports.DocumentReviewModal = DocumentReviewModal;
28
37
  const react_1 = __importStar(require("react"));
29
38
  const extractedData_1 = require("../../lib/data/extractedData");
30
- // ═══════════════════════════════════════════════════════════════════
31
- // DocumentReviewModal — inspect and edit parser-extracted fields.
32
- // Opens from the document row "Review" button. Sections, flagged
33
- // fields, inline editing with debounced auto-save.
34
- //
35
- // Data: stub-backed from EXTRACTED_DATA for now. GraphQL query and
36
- // mutation constants are exported for future wiring by consuming apps.
37
- // ═══════════════════════════════════════════════════════════════════
39
+ const documentFieldCatalog_1 = require("../../lib/documentFieldCatalog");
38
40
  // ── GraphQL contracts (for consuming apps to use once resolvers land) ──
39
41
  exports.EXTRACTED_FIELDS_QUERY = `
40
42
  query ExtractedDocumentFields($jobId: ID!, $documentId: ID!) {
@@ -64,69 +66,58 @@ exports.SAVE_FIELD_EDIT_MUTATION = `
64
66
  }
65
67
  }
66
68
  `;
67
- // ── Stub section data (maps EXTRACTED_DATA grouped sections) ──
68
- const STUB_SECTIONS = {
69
- pnl: [
70
- {
71
- head: "Revenue",
72
- fields: [
73
- { key: "pnl-gross-revenue", label: "Gross Revenue", value: "$1,847,200", sourceRef: "Line 1a", confidence: 0.95 },
74
- { key: "pnl-cogs", label: "Cost of Goods Sold", value: "$412,500", sourceRef: "Line 2", confidence: 0.92 },
75
- { key: "pnl-gross-profit", label: "Gross Profit", value: "$1,434,700", sourceRef: "Computed", confidence: 0.99 },
76
- { key: "pnl-other-income", label: "Other Income", value: "$18,400", sourceRef: "Line 6", confidence: 0.62 },
77
- ],
78
- },
79
- {
80
- head: "Operating Expenses",
81
- fields: [
82
- { key: "pnl-wages", label: "Wages & Salaries", value: "$487,000", sourceRef: "Line 13", confidence: 0.94 },
83
- { key: "pnl-officer-comp", label: "Officer Compensation", value: "$180,000", sourceRef: "Line 7", confidence: 0.91 },
84
- { key: "pnl-rent", label: "Rent / Lease", value: "$84,000", sourceRef: "Line 15", confidence: 0.88 },
85
- { key: "pnl-meals", label: "Meals & Entertainment", value: "$8,400", sourceRef: "Line 19", confidence: 0.85 },
86
- { key: "pnl-prof-fees", label: "Professional Fees", value: "$24,000", sourceRef: "Line 17", confidence: 0.93 },
87
- { key: "pnl-depreciation", label: "Depreciation", value: "$62,300", sourceRef: "Line 14", confidence: 0.96 },
88
- ],
89
- },
90
- {
91
- head: "Net Income",
92
- fields: [
93
- { key: "pnl-net-ordinary", label: "Net Ordinary Income", value: "$598,000", sourceRef: "Line 21", confidence: 0.97 },
94
- { key: "pnl-tax-income", label: "Taxable Income", value: "$580,200", sourceRef: "Line 28", confidence: 0.90 },
95
- { key: "pnl-net-income", label: "Net Income", value: "$142,000", sourceRef: "Line 30", confidence: 0.93 },
96
- ],
97
- },
98
- ],
99
- balance: [
100
- {
101
- head: "Assets",
102
- fields: [
103
- { key: "bs-cash", label: "Cash & Equivalents", value: "$128,400", sourceRef: "Line 1", confidence: 0.97 },
104
- { key: "bs-ar", label: "Accounts Receivable", value: "$42,000", sourceRef: "Line 2", confidence: 0.94 },
105
- { key: "bs-inventory", label: "Inventory", value: "$45,000", sourceRef: "Line 3", confidence: 0.91 },
106
- { key: "bs-total-assets", label: "Total Assets", value: "$340,000", sourceRef: "Line 11", confidence: 0.98 },
107
- ],
108
- },
109
- {
110
- head: "Liabilities",
111
- fields: [
112
- { key: "bs-ap", label: "Accounts Payable", value: "$31,200", sourceRef: "Line 15", confidence: 0.93 },
113
- { key: "bs-loans", label: "Loans Payable", value: "$78,000", sourceRef: "Line 17", confidence: 0.90 },
114
- { key: "bs-total-liab", label: "Total Liabilities", value: "$109,200", sourceRef: "Line 22", confidence: 0.96 },
115
- ],
116
- },
117
- {
118
- head: "Equity",
119
- fields: [
120
- { key: "bs-retained", label: "Retained Earnings", value: "$188,800", sourceRef: "Line 24", confidence: 0.92 },
121
- { key: "bs-total-equity", label: "Total Equity", value: "$230,800", sourceRef: "Line 27", confidence: 0.95 },
122
- ],
123
- },
124
- ],
125
- };
69
+ // ── Format a raw value for display ──
70
+ function formatValue(v) {
71
+ if (v === null || v === undefined)
72
+ return "";
73
+ if (typeof v === "number")
74
+ return `$${v.toLocaleString()}`;
75
+ if (typeof v === "boolean")
76
+ return v ? "Yes" : "No";
77
+ return String(v);
78
+ }
79
+ // ── Build ReviewSection[] from real parsedData using the catalog ──
80
+ function buildSectionsFromCatalog(documentType, fields) {
81
+ const catalog = documentFieldCatalog_1.DOCUMENT_FIELD_CATALOG[documentType];
82
+ if (!catalog) {
83
+ // Unknown doc type — render all non-null scalar fields in one flat section
84
+ const flatFields = Object.entries(fields)
85
+ .filter(([, v]) => v !== null && v !== undefined && typeof v !== "object")
86
+ .map(([key, val]) => ({
87
+ key,
88
+ label: key.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()),
89
+ value: formatValue(val),
90
+ sourceRef: "",
91
+ confidence: 0.9,
92
+ }));
93
+ return flatFields.length > 0 ? [{ head: "Extracted Fields", fields: flatFields }] : [];
94
+ }
95
+ return catalog.sections
96
+ .map((section) => {
97
+ const sectionFields = section.fields
98
+ .filter((key) => {
99
+ const v = fields[key];
100
+ // Include all scalar fields from the catalog — show empty string for null/undefined.
101
+ // Skip only object/array values (dicts, arrays) which can't be inline-edited.
102
+ return typeof v !== "object" || v === null || v === undefined;
103
+ })
104
+ .map((key) => {
105
+ var _a, _b;
106
+ const def = catalog.fields[key];
107
+ return {
108
+ key,
109
+ label: (_a = def === null || def === void 0 ? void 0 : def.label) !== null && _a !== void 0 ? _a : key.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()),
110
+ value: formatValue(fields[key]),
111
+ sourceRef: (_b = def === null || def === void 0 ? void 0 : def.sourceRef) !== null && _b !== void 0 ? _b : "",
112
+ confidence: 0.9,
113
+ };
114
+ });
115
+ return { head: section.head, fields: sectionFields };
116
+ })
117
+ .filter((s) => s.fields.length > 0);
118
+ }
119
+ // ── Stub fallback when no real parsedData is available ──
126
120
  function getStubSections(documentId) {
127
- if (STUB_SECTIONS[documentId])
128
- return STUB_SECTIONS[documentId];
129
- // Fallback: build sections from EXTRACTED_DATA if available
130
121
  const doc = extractedData_1.EXTRACTED_DATA.find((d) => d.docId === documentId);
131
122
  if (!doc)
132
123
  return [];
@@ -143,53 +134,25 @@ function getStubSections(documentId) {
143
134
  },
144
135
  ];
145
136
  }
146
- function humanizeFieldKey(key) {
147
- return key.replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
148
- }
149
- function formatFieldValue(value) {
150
- if (typeof value === 'number') {
151
- return Math.abs(value) >= 1
152
- ? `$${value.toLocaleString('en-US', { maximumFractionDigits: 0 })}`
153
- : String(value);
154
- }
155
- return String(value !== null && value !== void 0 ? value : '');
156
- }
157
- function parsedDataToSections(data) {
158
- const fields = data.fields;
159
- if (!fields || typeof fields !== 'object')
160
- return [];
161
- const entries = Object.entries(fields)
162
- .filter(([key]) => !key.startsWith('_'));
163
- if (entries.length === 0)
164
- return [];
165
- return [{
166
- head: humanizeFieldKey(String(data.documentType || 'Extracted Fields')),
167
- fields: entries.map(([key, value]) => ({
168
- key,
169
- label: humanizeFieldKey(key),
170
- value: formatFieldValue(value),
171
- sourceRef: 'Extracted',
172
- confidence: 0.92,
173
- })),
174
- }];
175
- }
176
137
  function getTotalFieldCount(sections) {
177
138
  return sections.reduce((sum, s) => sum + s.fields.length, 0);
178
139
  }
179
140
  // ── Component ──
180
- function DocumentReviewModal({ documentId, documentName, fileName, jobId: _jobId, onClose, parsedData, }) {
141
+ function DocumentReviewModal({ documentId, documentName, fileName, jobId: _jobId, parsedData, onSaveReviewedData, onClose, }) {
181
142
  const [loading, setLoading] = (0, react_1.useState)(true);
182
143
  const [sections, setSections] = (0, react_1.useState)([]);
183
144
  const [saveStatus, setSaveStatus] = (0, react_1.useState)("idle");
184
145
  const debounceTimers = (0, react_1.useRef)({});
185
- // Load sections from real parsedData when available, fall back to stubs
186
146
  (0, react_1.useEffect)(() => {
187
- if (parsedData && typeof parsedData === 'object' && parsedData.fields) {
188
- setSections(parsedDataToSections(parsedData));
147
+ var _a;
148
+ if (parsedData && typeof parsedData === "object") {
149
+ const fields = ((_a = parsedData.fields) !== null && _a !== void 0 ? _a : parsedData);
150
+ const documentType = parsedData.documentType || documentId;
151
+ setSections(buildSectionsFromCatalog(documentType, fields));
189
152
  setLoading(false);
190
153
  return;
191
154
  }
192
- // Fallback: stub data with simulated delay
155
+ // Fallback: stub loading delay
193
156
  const t = setTimeout(() => {
194
157
  setSections(getStubSections(documentId));
195
158
  setLoading(false);
@@ -200,234 +163,85 @@ function DocumentReviewModal({ documentId, documentName, fileName, jobId: _jobId
200
163
  setSections((prev) => prev.map((sec, si) => si === sectionIdx
201
164
  ? Object.assign(Object.assign({}, sec), { fields: sec.fields.map((f, fi) => fi === fieldIdx ? Object.assign(Object.assign({}, f), { value: newValue }) : f) }) : sec));
202
165
  const timerKey = `${sectionIdx}-${fieldIdx}`;
203
- if (debounceTimers.current[timerKey]) {
204
- clearTimeout(debounceTimers.current[timerKey]);
205
- }
166
+ clearTimeout(debounceTimers.current[timerKey]);
206
167
  setSaveStatus("saving");
207
168
  debounceTimers.current[timerKey] = setTimeout(() => {
208
- // Stub save — replace with GraphQL mutation when resolvers are ready
209
169
  setSaveStatus("saved");
210
170
  setTimeout(() => setSaveStatus("idle"), 1500);
211
171
  }, 900);
212
- }, []);
213
- // Cleanup debounce timers on unmount
172
+ }, [sections]);
173
+ const handleDone = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
174
+ if (onSaveReviewedData && sections.length > 0) {
175
+ const allFields = {};
176
+ sections.forEach((sec) => sec.fields.forEach((f) => { allFields[f.key] = f.value; }));
177
+ try {
178
+ yield onSaveReviewedData(allFields);
179
+ }
180
+ catch ( /* non-fatal */_a) { /* non-fatal */ }
181
+ }
182
+ onClose();
183
+ }), [onSaveReviewedData, sections, onClose]);
214
184
  (0, react_1.useEffect)(() => {
215
185
  const timers = debounceTimers.current;
216
- return () => {
217
- Object.values(timers).forEach(clearTimeout);
218
- };
186
+ return () => { Object.values(timers).forEach(clearTimeout); };
219
187
  }, []);
220
188
  const totalFields = getTotalFieldCount(sections);
221
189
  const isFlagged = (f) => f.confidence < 0.8;
222
- return (
223
- // Overlay
224
- react_1.default.createElement("div", { onClick: onClose, style: {
225
- position: "fixed",
226
- inset: 0,
227
- zIndex: 9999,
228
- background: "rgba(0,0,0,0.65)",
229
- display: "flex",
230
- alignItems: "center",
231
- justifyContent: "center",
232
- } },
233
- react_1.default.createElement("div", { onClick: (e) => e.stopPropagation(), style: {
234
- width: 520,
235
- maxHeight: "85vh",
236
- background: "#111827",
237
- border: "1px solid #1f2937",
238
- borderRadius: 16,
239
- display: "flex",
240
- flexDirection: "column",
241
- boxShadow: "0 25px 60px rgba(0,0,0,0.5)",
242
- } },
243
- react_1.default.createElement("div", { style: {
244
- padding: "20px 24px 16px",
245
- borderBottom: "1px solid #1f2937",
246
- display: "flex",
247
- alignItems: "flex-start",
248
- gap: 14,
249
- } },
250
- react_1.default.createElement("div", { style: {
251
- width: 40,
252
- height: 40,
253
- borderRadius: 10,
254
- background: "rgba(99,102,241,0.12)",
255
- border: "1px solid rgba(99,102,241,0.25)",
256
- display: "flex",
257
- alignItems: "center",
258
- justifyContent: "center",
259
- flexShrink: 0,
260
- } },
190
+ return (react_1.default.createElement("div", { onClick: onClose, style: { position: "fixed", inset: 0, zIndex: 9999, background: "rgba(0,0,0,0.65)", display: "flex", alignItems: "center", justifyContent: "center" } },
191
+ react_1.default.createElement("div", { onClick: (e) => e.stopPropagation(), style: { width: 520, maxHeight: "85vh", background: "#111827", border: "1px solid #1f2937", borderRadius: 16, display: "flex", flexDirection: "column", boxShadow: "0 25px 60px rgba(0,0,0,0.5)" } },
192
+ react_1.default.createElement("div", { style: { padding: "20px 24px 16px", borderBottom: "1px solid #1f2937", display: "flex", alignItems: "flex-start", gap: 14 } },
193
+ react_1.default.createElement("div", { style: { width: 40, height: 40, borderRadius: 10, background: "rgba(99,102,241,0.12)", border: "1px solid rgba(99,102,241,0.25)", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 } },
261
194
  react_1.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" },
262
195
  react_1.default.createElement("rect", { x: "3", y: "2", width: "12", height: "14", rx: "2", stroke: "#818cf8", strokeWidth: "1.5" }),
263
196
  react_1.default.createElement("path", { d: "M6 6h6M6 9h6M6 12h4", stroke: "#818cf8", strokeWidth: "1.2", strokeLinecap: "round" }))),
264
197
  react_1.default.createElement("div", { style: { flex: 1, minWidth: 0 } },
265
- react_1.default.createElement("div", { className: "font-tax-axis-body", style: {
266
- fontSize: 15,
267
- fontWeight: 600,
268
- color: "#f3f4f6",
269
- marginBottom: 3,
270
- } },
198
+ react_1.default.createElement("div", { className: "font-tax-axis-body", style: { fontSize: 15, fontWeight: 600, color: "#f3f4f6", marginBottom: 3 } },
271
199
  documentName,
272
200
  " \u2014 Extracted Fields"),
273
201
  react_1.default.createElement("div", { className: "font-tax-axis-body", style: { fontSize: 12, color: "#9ca3af" } },
274
202
  fileName,
275
- !loading && (react_1.default.createElement(react_1.default.Fragment, null,
203
+ !loading && react_1.default.createElement(react_1.default.Fragment, null,
276
204
  " ",
277
205
  "\u00B7 ",
278
206
  totalFields,
279
- " fields \u00B7 Review and correct parsed values")))),
280
- react_1.default.createElement("button", { onClick: onClose, style: {
281
- background: "transparent",
282
- border: "none",
283
- color: "#6b7280",
284
- fontSize: 20,
285
- cursor: "pointer",
286
- padding: "2px 6px",
287
- lineHeight: 1,
288
- } }, "\u00D7")),
289
- react_1.default.createElement("div", { style: {
290
- flex: 1,
291
- overflowY: "auto",
292
- padding: "16px 24px 8px",
293
- } }, loading ? (react_1.default.createElement(LoadingSkeleton, null)) : (sections.map((section, si) => (react_1.default.createElement("div", { key: section.head, style: { marginBottom: 20 } },
294
- react_1.default.createElement("div", { style: {
295
- display: "flex",
296
- alignItems: "center",
297
- gap: 10,
298
- marginBottom: 10,
299
- } },
300
- react_1.default.createElement("span", { className: "font-tax-axis-mono", style: {
301
- fontSize: 10,
302
- fontWeight: 700,
303
- letterSpacing: "0.08em",
304
- textTransform: "uppercase",
305
- color: "#6b7280",
306
- } }, section.head),
307
- react_1.default.createElement("div", { style: {
308
- flex: 1,
309
- height: 1,
310
- background: "#1f2937",
311
- } })),
312
- react_1.default.createElement("div", { style: {
313
- background: "#0d1117",
314
- borderRadius: 10,
315
- border: "1px solid #1f2937",
316
- overflow: "hidden",
317
- } }, section.fields.map((field, fi) => {
207
+ " fields \u00B7 Review and correct parsed values"))),
208
+ react_1.default.createElement("button", { onClick: onClose, style: { background: "transparent", border: "none", color: "#6b7280", fontSize: 20, cursor: "pointer", padding: "2px 6px", lineHeight: 1 } }, "\u00D7")),
209
+ react_1.default.createElement("div", { style: { flex: 1, overflowY: "auto", padding: "16px 24px 8px" } }, loading ? (react_1.default.createElement(LoadingSkeleton, null)) : sections.length === 0 ? (react_1.default.createElement("div", { style: { color: "#6b7280", fontSize: 13, textAlign: "center", padding: "32px 0" } }, "No extracted fields available for this document.")) : (sections.map((section, si) => (react_1.default.createElement("div", { key: section.head, style: { marginBottom: 20 } },
210
+ react_1.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: 10, marginBottom: 10 } },
211
+ react_1.default.createElement("span", { className: "font-tax-axis-mono", style: { fontSize: 10, fontWeight: 700, letterSpacing: "0.08em", textTransform: "uppercase", color: "#6b7280" } }, section.head),
212
+ react_1.default.createElement("div", { style: { flex: 1, height: 1, background: "#1f2937" } })),
213
+ react_1.default.createElement("div", { style: { background: "#0d1117", borderRadius: 10, border: "1px solid #1f2937", overflow: "hidden" } }, section.fields.map((field, fi) => {
318
214
  const flagged = isFlagged(field);
319
- return (react_1.default.createElement("div", { key: field.key, style: {
320
- display: "grid",
321
- gridTemplateColumns: "140px 1fr auto",
322
- alignItems: "center",
323
- padding: "10px 14px",
324
- borderBottom: fi < section.fields.length - 1
325
- ? "1px solid #1f2937"
326
- : "none",
327
- gap: 12,
328
- } },
329
- react_1.default.createElement("span", { className: "font-tax-axis-body", style: {
330
- fontSize: 12,
331
- color: flagged ? "#fbbf24" : "#9ca3af",
332
- display: "flex",
333
- alignItems: "center",
334
- gap: 5,
335
- } },
215
+ return (react_1.default.createElement("div", { key: field.key, style: { display: "grid", gridTemplateColumns: "160px 1fr auto", alignItems: "center", padding: "10px 14px", borderBottom: fi < section.fields.length - 1 ? "1px solid #1f2937" : "none", gap: 12 } },
216
+ react_1.default.createElement("span", { className: "font-tax-axis-body", style: { fontSize: 12, color: flagged ? "#fbbf24" : "#9ca3af", display: "flex", alignItems: "center", gap: 5 } },
336
217
  flagged && (react_1.default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
337
218
  react_1.default.createElement("path", { d: "M6 1L11 10H1L6 1Z", stroke: "#fbbf24", strokeWidth: "1.2", strokeLinejoin: "round" }),
338
219
  react_1.default.createElement("path", { d: "M6 4.5V6.5M6 8V8.01", stroke: "#fbbf24", strokeWidth: "1.1", strokeLinecap: "round" }))),
339
220
  field.label),
340
- react_1.default.createElement("input", { type: "text", value: field.value, onChange: (e) => handleFieldChange(si, fi, e.target.value), style: {
341
- background: "#0d1117",
342
- border: `1px solid ${flagged ? "rgba(251,191,36,0.4)" : "#1f2937"}`,
343
- borderRadius: 6,
344
- padding: "7px 10px",
345
- color: "#e5e7eb",
346
- fontSize: 13,
347
- fontFamily: "monospace",
348
- outline: "none",
349
- width: "100%",
350
- boxSizing: "border-box",
351
- } }),
352
- react_1.default.createElement("span", { className: "font-tax-axis-mono", style: {
353
- fontSize: 11,
354
- color: flagged ? "#fbbf24" : "#4ade80",
355
- whiteSpace: "nowrap",
356
- display: "flex",
357
- alignItems: "center",
358
- gap: 4,
359
- } },
360
- field.sourceRef,
221
+ react_1.default.createElement("input", { type: "text", value: field.value, onChange: (e) => handleFieldChange(si, fi, e.target.value), style: { background: "#0d1117", border: `1px solid ${flagged ? "rgba(251,191,36,0.4)" : "#1f2937"}`, borderRadius: 6, padding: "7px 10px", color: "#e5e7eb", fontSize: 13, fontFamily: "monospace", outline: "none", width: "100%", boxSizing: "border-box" } }),
222
+ react_1.default.createElement("span", { className: "font-tax-axis-mono", style: { fontSize: 11, color: flagged ? "#fbbf24" : "#4ade80", whiteSpace: "nowrap", display: "flex", alignItems: "center", gap: 4 } },
223
+ field.sourceRef || "",
361
224
  " ",
362
- flagged ? (react_1.default.createElement("span", { style: { fontSize: 10 } }, "\u25B2")) : (react_1.default.createElement("span", { style: { color: "#4ade80", fontSize: 12 } }, "\u2713")))));
225
+ flagged ? react_1.default.createElement("span", { style: { fontSize: 10 } }, "\u25B2") : react_1.default.createElement("span", { style: { fontSize: 12 } }, "\u2713"))));
363
226
  }))))))),
364
- react_1.default.createElement("div", { style: {
365
- padding: "14px 24px",
366
- borderTop: "1px solid #1f2937",
367
- display: "flex",
368
- alignItems: "center",
369
- justifyContent: "space-between",
370
- } },
371
- react_1.default.createElement("span", { className: "font-tax-axis-body", style: {
372
- fontSize: 11,
373
- color: "#6b7280",
374
- display: "flex",
375
- alignItems: "center",
376
- gap: 6,
377
- } },
227
+ react_1.default.createElement("div", { style: { padding: "14px 24px", borderTop: "1px solid #1f2937", display: "flex", alignItems: "center", justifyContent: "space-between" } },
228
+ react_1.default.createElement("span", { className: "font-tax-axis-body", style: { fontSize: 11, color: "#6b7280", display: "flex", alignItems: "center", gap: 6 } },
378
229
  saveStatus === "idle" && (react_1.default.createElement(react_1.default.Fragment, null,
379
230
  react_1.default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
380
231
  react_1.default.createElement("circle", { cx: "6", cy: "6", r: "5", stroke: "#6b7280", strokeWidth: "1.2" }),
381
232
  react_1.default.createElement("path", { d: "M6 3.5V6.5L8 7.5", stroke: "#6b7280", strokeWidth: "1.1", strokeLinecap: "round" })),
382
233
  "Changes save automatically")),
383
234
  saveStatus === "saving" && (react_1.default.createElement(react_1.default.Fragment, null,
384
- react_1.default.createElement("div", { style: {
385
- width: 10,
386
- height: 10,
387
- borderRadius: "50%",
388
- border: "2px solid transparent",
389
- borderTopColor: "#818cf8",
390
- animation: "spin 0.6s linear infinite",
391
- } }),
235
+ react_1.default.createElement("div", { style: { width: 10, height: 10, borderRadius: "50%", border: "2px solid transparent", borderTopColor: "#818cf8", animation: "spin 0.6s linear infinite" } }),
392
236
  "Saving\u2026")),
393
- saveStatus === "saved" && (react_1.default.createElement("span", { style: { color: "#4ade80" } }, "Saved \u2713"))),
394
- react_1.default.createElement("button", { onClick: onClose, className: "font-tax-axis-body", style: {
395
- background: "rgba(99,102,241,0.9)",
396
- border: "none",
397
- borderRadius: 8,
398
- padding: "9px 28px",
399
- color: "#fff",
400
- fontSize: 13,
401
- fontWeight: 600,
402
- cursor: "pointer",
403
- } }, "Done"))),
404
- react_1.default.createElement("style", null, `
405
- @keyframes spin {
406
- to { transform: rotate(360deg); }
407
- }
408
- `)));
237
+ saveStatus === "saved" && react_1.default.createElement("span", { style: { color: "#4ade80" } }, "Saved \u2713")),
238
+ react_1.default.createElement("button", { onClick: handleDone, className: "font-tax-axis-body", style: { background: "rgba(99,102,241,0.9)", border: "none", borderRadius: 8, padding: "9px 28px", color: "#fff", fontSize: 13, fontWeight: 600, cursor: "pointer" } }, "Done"))),
239
+ react_1.default.createElement("style", null, `@keyframes spin { to { transform: rotate(360deg); } }`)));
409
240
  }
410
- // ── Loading skeleton ──
411
241
  function LoadingSkeleton() {
412
242
  return (react_1.default.createElement("div", null, [1, 2].map((i) => (react_1.default.createElement("div", { key: i, style: { marginBottom: 20 } },
413
- react_1.default.createElement("div", { style: {
414
- width: 100,
415
- height: 10,
416
- background: "#1f2937",
417
- borderRadius: 4,
418
- marginBottom: 10,
419
- } }),
420
- react_1.default.createElement("div", { style: {
421
- background: "#0d1117",
422
- borderRadius: 10,
423
- border: "1px solid #1f2937",
424
- padding: 14,
425
- } }, [1, 2, 3].map((j) => (react_1.default.createElement("div", { key: j, style: {
426
- display: "grid",
427
- gridTemplateColumns: "140px 1fr 60px",
428
- gap: 12,
429
- marginBottom: j < 3 ? 12 : 0,
430
- } },
243
+ react_1.default.createElement("div", { style: { width: 100, height: 10, background: "#1f2937", borderRadius: 4, marginBottom: 10 } }),
244
+ react_1.default.createElement("div", { style: { background: "#0d1117", borderRadius: 10, border: "1px solid #1f2937", padding: 14 } }, [1, 2, 3].map((j) => (react_1.default.createElement("div", { key: j, style: { display: "grid", gridTemplateColumns: "160px 1fr 60px", gap: 12, marginBottom: j < 3 ? 12 : 0 } },
431
245
  react_1.default.createElement("div", { style: { height: 14, background: "#1f2937", borderRadius: 4 } }),
432
246
  react_1.default.createElement("div", { style: { height: 32, background: "#1f2937", borderRadius: 6 } }),
433
247
  react_1.default.createElement("div", { style: { height: 14, background: "#1f2937", borderRadius: 4 } }))))))))));
@@ -14,10 +14,11 @@ interface DocumentTierProps {
14
14
  tier: TierDef;
15
15
  docs: DocState[];
16
16
  helpOverrides: Record<string, string>;
17
- fieldCounts: Record<string, number>;
18
- onUpload: (idx: number) => void;
17
+ fieldCounts?: Record<string, number>;
18
+ onUpload: (idx: number, file: File) => void;
19
19
  onClear: (idx: number) => void;
20
- onReview: (docId: string) => void;
20
+ onRemove?: (idx: number) => void;
21
+ onReview?: (docId: string) => void;
21
22
  }
22
- export declare function DocumentTier({ tier, docs, helpOverrides, fieldCounts, onUpload, onClear, onReview, }: DocumentTierProps): React.JSX.Element | null;
23
+ export declare function DocumentTier({ tier, docs, helpOverrides, fieldCounts, onUpload, onClear, onRemove, onReview, }: DocumentTierProps): React.JSX.Element | null;
23
24
  export {};
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DocumentTier = DocumentTier;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const DocumentCard_1 = require("./DocumentCard");
9
- function DocumentTier({ tier, docs, helpOverrides, fieldCounts, onUpload, onClear, onReview, }) {
9
+ function DocumentTier({ tier, docs, helpOverrides, fieldCounts, onUpload, onClear, onRemove, onReview, }) {
10
10
  const tierDocs = tier.ids
11
11
  .map((id) => {
12
12
  const idx = docs.findIndex((d) => d.id === id);
@@ -19,5 +19,5 @@ function DocumentTier({ tier, docs, helpOverrides, fieldCounts, onUpload, onClea
19
19
  react_1.default.createElement("div", { className: "flex items-center gap-2 mb-2" },
20
20
  react_1.default.createElement("span", { className: "text-[10px] font-bold uppercase tracking-widest font-tax-axis-mono", style: { color: tier.labelColor } }, tier.label),
21
21
  react_1.default.createElement("span", { className: "text-[10px] text-tax-axis-text-4 font-tax-axis-body" }, tier.sublabel)),
22
- react_1.default.createElement("div", { className: "grid gap-1.5" }, tierDocs.map(({ doc, idx }) => (react_1.default.createElement(DocumentCard_1.DocumentCard, { key: doc.id, doc: doc, tierBorderColor: tier.borderColor, tierBadgeColor: tier.badgeColor, tierBadgeText: tier.badgeText, helpOverride: helpOverrides[doc.id], fieldCount: fieldCounts[doc.id], onUpload: () => onUpload(idx), onClear: () => onClear(idx), onReview: () => onReview(doc.id) }))))));
22
+ react_1.default.createElement("div", { className: "grid gap-1.5" }, tierDocs.map(({ doc, idx }) => (react_1.default.createElement(DocumentCard_1.DocumentCard, { key: doc.id, doc: doc, tierBorderColor: tier.borderColor, tierBadgeColor: tier.badgeColor, tierBadgeText: tier.badgeText, helpOverride: helpOverrides[doc.id], fieldCount: fieldCounts === null || fieldCounts === void 0 ? void 0 : fieldCounts[doc.id], onUpload: (file) => onUpload(idx, file), onClear: () => onClear(idx), onRemove: onRemove ? () => onRemove(idx) : undefined, onReview: onReview ? () => onReview(doc.id) : undefined }))))));
23
23
  }
@@ -1,23 +1,43 @@
1
1
  import React from "react";
2
2
  import { ClientProfile, TaxAxisScreenProps } from "../../lib/types";
3
+ import { TaxAxisEntityTypeKey } from "../../lib/data/documents";
4
+ import { DocState } from "./DocumentCard";
3
5
  export interface TaxAxisDocumentsProps extends TaxAxisScreenProps {
4
6
  profile: ClientProfile;
7
+ entityType?: TaxAxisEntityTypeKey | string | null;
5
8
  onContinue: () => void;
6
9
  onBack: () => void;
7
- entityType?: string;
8
- onUploadDocument?: (doc: {
9
- id: string;
10
- }, file: File) => Promise<any>;
10
+ onUploadDocument?: (doc: DocState, file: File) => Promise<void | {
11
+ documentId?: string;
12
+ fileName?: string;
13
+ status?: string;
14
+ documentType?: string;
15
+ parseError?: string | null;
16
+ }>;
11
17
  onDeleteDocument?: (documentId: string) => Promise<void>;
12
- fetchUploadedDocuments?: () => Promise<any[]>;
18
+ fetchUploadedDocuments?: () => Promise<Array<{
19
+ documentId?: string;
20
+ fileName: string;
21
+ status: string;
22
+ documentType?: string | null;
23
+ parseError?: string | null;
24
+ updatedAt?: string | null;
25
+ parsedData?: Record<string, unknown> | null;
26
+ reviewedData?: Record<string, unknown> | null;
27
+ }>>;
28
+ parsedFieldCounts?: Record<string, number>;
13
29
  jobId?: string;
14
30
  onSaveReviewedField?: (documentId: string, reviewedData: Record<string, unknown>) => Promise<void>;
15
31
  qboConnected?: boolean;
16
32
  qboCompanyName?: string | null;
17
33
  qboAuthorizeUrl?: string;
18
- qboClientConfirmed?: boolean;
19
- onImportQboReport?: (...args: any[]) => Promise<any>;
34
+ onImportQboReport?: (sessionId: string, realmId: string, reportType: string, accountingMethod: string) => Promise<any>;
20
35
  onQboConnected?: (companyName: string) => void;
21
36
  onQboDisconnected?: () => void;
37
+ onQboImport?: (mappedDocs: {
38
+ slot: string;
39
+ fileName: string;
40
+ }[]) => void;
41
+ qboClientConfirmed?: boolean;
22
42
  }
23
- export declare function TaxAxisDocuments({ profile, onContinue, onBack, onUploadDocument, onDeleteDocument, fetchUploadedDocuments, jobId, userContext: _userContext, }: TaxAxisDocumentsProps): React.JSX.Element;
43
+ export declare function TaxAxisDocuments({ profile, entityType, onContinue, onBack, onUploadDocument, onDeleteDocument, fetchUploadedDocuments, parsedFieldCounts, jobId, onSaveReviewedField, userContext: _userContext, qboConnected, qboCompanyName, qboAuthorizeUrl, onImportQboReport, onQboConnected, onQboDisconnected, onQboImport, qboClientConfirmed, }: TaxAxisDocumentsProps): React.JSX.Element;