@ingestro/importer-react 4.9.8 → 4.10.0

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/index.d.ts CHANGED
@@ -299,6 +299,17 @@ export type IHeaderStepHandler = (params: {
299
299
  stay: IStayFn;
300
300
  }) => Promise<void> | void;
301
301
 
302
+ export type IPreProcessingStepUpdateDataFn = IHeaderStepUpdateDataFn;
303
+
304
+ export type IPreProcessingStepHandler = (params: {
305
+ data: ISheetData[];
306
+ updateData: IPreProcessingStepUpdateDataFn;
307
+ alert: IAlertFn;
308
+ block: IBlockFn;
309
+ proceed: IProceedFn;
310
+ stay: IStayFn;
311
+ }) => Promise<void> | void;
312
+
302
313
  export type IReviewData = Record<
303
314
  string,
304
315
  {
@@ -320,6 +331,7 @@ export type IReviewStepHandler = (params: {
320
331
 
321
332
  export type IStepHandler = {
322
333
  uploadStep?: IUploadStepHandler;
334
+ preProcessingStep?: IPreProcessingStepHandler;
323
335
  mappingStep?: IMappingStepHandler;
324
336
  headerStep?: IHeaderStepHandler;
325
337
  reviewStep?: IReviewStepHandler;
@@ -574,6 +586,8 @@ export type ColumnAPI = {
574
586
 
575
587
  export type I18nOverrides =
576
588
  | {
589
+ ar?: Record<string, string>;
590
+ he?: Record<string, string>;
577
591
  en?: Record<string, string>;
578
592
  de?: Record<string, string>;
579
593
  es?: Record<string, string>;
@@ -597,6 +611,10 @@ export type I18nOverrides =
597
611
  type IAdditionalInfo = {
598
612
  uploadStep?: boolean;
599
613
  sheetSelectionStep?: boolean;
614
+ preProcessingStep?: boolean;
615
+ preProcessingModal?: boolean;
616
+ xmlModal?: boolean;
617
+ pdfModal?: boolean;
600
618
  headerStep?: boolean;
601
619
  mappingStep?: boolean;
602
620
  reviewStep?: boolean;
@@ -617,6 +635,7 @@ export type ISkipConfigurationMapping = {
617
635
  automaticMapping?: boolean;
618
636
  applyColumnMapping?: IApplyMappingMode;
619
637
  applyOptionMapping?: IApplyMappingMode;
638
+ requireConfirmation?: boolean;
620
639
  };
621
640
 
622
641
  export type ISkipConfiguration = {
@@ -698,6 +717,7 @@ export type SettingsAPI = {
698
717
  transpose?: boolean;
699
718
  mergeHeaders?: boolean;
700
719
  metadataSelection?: boolean;
720
+ preProcessing?: boolean;
701
721
  collapseMatchedColumns?: boolean;
702
722
  skipConfiguration?: ISkipConfiguration;
703
723
  disableColumnRemapping?: boolean;
@@ -787,6 +807,18 @@ export type EntryChangeRow = {
787
807
  info: RowInfo;
788
808
  };
789
809
 
810
+ export type DatasetRow = {
811
+ rowIndex: number;
812
+ data: Row;
813
+ info: RowInfo;
814
+ };
815
+
816
+ export type EntryChangeDataset = {
817
+ readonly rowCount: number;
818
+ getRow: (index: number) => DatasetRow | undefined;
819
+ forEachRow: (cb: (row: DatasetRow, index: number) => void) => void;
820
+ };
821
+
790
822
  export type RowResult = Record<string, HookedRecordResult | FieldValue>;
791
823
 
792
824
  export type EntryChangeResult = {
@@ -803,7 +835,8 @@ export type ResultOnEntryChange =
803
835
 
804
836
  export type OnEntryChange = (
805
837
  rows: EntryChangeRow[],
806
- logs: OnEntryChangeLogs
838
+ logs: OnEntryChangeLogs,
839
+ dataset: EntryChangeDataset
807
840
  ) => ResultOnEntryChange;
808
841
 
809
842
  export type HookedRecordRowResult = [HookedRecordResult, number];
@@ -973,6 +1006,7 @@ export type ThemeAPI = {
973
1006
  };
974
1007
  loader?: LoaderThemeAPI;
975
1008
  headerSelect?: HeaderMatchAPI;
1009
+ preProcessing?: PreProcessingThemeAPI;
976
1010
  dropzone?: DropzoneThemeAPI;
977
1011
  progressBar?: ProgressBarThemeAPI;
978
1012
  joinSheet?: JoinSheetThemeAPI;
@@ -1089,7 +1123,7 @@ type HeaderMatchScrollbarAPI = {
1089
1123
  backgroundColor?: string;
1090
1124
  };
1091
1125
 
1092
- type HeaderMatchSurfaceAPI = {
1126
+ export type HeaderMatchSurfaceAPI = {
1093
1127
  root?: CSSInterpolation;
1094
1128
  backgroundColor?: string;
1095
1129
  borderColor?: string;
@@ -1124,7 +1158,9 @@ type HeaderMatchSheetTabAPI = {
1124
1158
  type HeaderMatchButtonThemeAPI = CSSInterpolation;
1125
1159
 
1126
1160
  type HeaderMatchDeleteButtonThemeAPI = CSSInterpolation & {
1127
- // trash icon color (read as an inline style on the SVG, not via CSS spread on the button)
1161
+ // trash icon stroke color (Lucide `color` prop) — not spread onto the button wrapper
1162
+ color?: string;
1163
+ // icon sizing only (width, height, strokeWidth); use top-level `color` for stroke
1128
1164
  icon?: CSSInterpolation;
1129
1165
  };
1130
1166
 
@@ -1139,6 +1175,55 @@ type HeaderMatchQuickFillButtonThemeAPI = CSSInterpolation & {
1139
1175
  icon?: CSSInterpolation;
1140
1176
  };
1141
1177
 
1178
+ export type MetadataSelectionThemeAPI = {
1179
+ root?: CSSInterpolation;
1180
+ iconButton?: CSSInterpolation;
1181
+ iconColor?: string;
1182
+ valuePreview?: {
1183
+ root?: CSSInterpolation;
1184
+ label?: CSSInterpolation;
1185
+ value?: CSSInterpolation;
1186
+ };
1187
+ };
1188
+
1189
+ export type FormPopoverInputThemeAPI = {
1190
+ root?: CSSInterpolation;
1191
+ color?: string;
1192
+ backgroundColor?: string;
1193
+ borderColor?: string;
1194
+ borderRadius?: string;
1195
+ fontSize?: string;
1196
+ placeholderColor?: string;
1197
+ focusBorderColor?: string;
1198
+ };
1199
+
1200
+ export type FormPopoverControlsThemeAPI = {
1201
+ input?: FormPopoverInputThemeAPI;
1202
+ quickFillButton?: HeaderMatchQuickFillButtonThemeAPI;
1203
+ };
1204
+
1205
+ export type FormPopoverThemeAPI = HeaderMatchSurfaceAPI & {
1206
+ width?: string;
1207
+ header?: HeaderMatchDividerSectionAPI;
1208
+ title?: HeaderMatchTextStyleAPI;
1209
+ description?: HeaderMatchTextStyleAPI;
1210
+ content?: CSSInterpolation;
1211
+ footer?: HeaderMatchDividerSectionAPI;
1212
+ controls?: FormPopoverControlsThemeAPI;
1213
+ };
1214
+
1215
+ export type PreProcessingFormPopoverThemeAPI = Omit<
1216
+ FormPopoverThemeAPI,
1217
+ 'controls'
1218
+ > & {
1219
+ controls?: Pick<FormPopoverControlsThemeAPI, 'input'>;
1220
+ };
1221
+
1222
+ export type FormButtonsThemeAPI = {
1223
+ primary?: HeaderMatchButtonThemeAPI;
1224
+ secondary?: HeaderMatchButtonThemeAPI;
1225
+ };
1226
+
1142
1227
  export type HeaderMatchAPI = {
1143
1228
  // core — always rendered, no settings flag
1144
1229
  root?: CSSInterpolation;
@@ -1153,8 +1238,6 @@ export type HeaderMatchAPI = {
1153
1238
  td?: CSSInterpolation;
1154
1239
  selectRowColor?: string;
1155
1240
  hoverRowColor?: string;
1156
- // background/text color for a row that is both selected and hovered (defaults to a darkened selectRowColor)
1157
- highlightRowColor?: string;
1158
1241
  textColor?: string;
1159
1242
  mergedCell?: CSSInterpolation;
1160
1243
  scrollbar?: HeaderMatchScrollbarAPI;
@@ -1167,10 +1250,7 @@ export type HeaderMatchAPI = {
1167
1250
 
1168
1251
  // gated behind settings.transpose / settings.mergeHeaders / settings.metadataSelection
1169
1252
  features?: {
1170
- buttons?: {
1171
- primary?: HeaderMatchButtonThemeAPI;
1172
- secondary?: HeaderMatchButtonThemeAPI;
1173
- };
1253
+ buttons?: FormButtonsThemeAPI;
1174
1254
  toolbar?: HeaderMatchSurfaceAPI & {
1175
1255
  dividerColor?: string;
1176
1256
  spinnerColor?: string;
@@ -1186,41 +1266,94 @@ export type HeaderMatchAPI = {
1186
1266
  item?: HeaderMatchDropdownItemThemeAPI;
1187
1267
  };
1188
1268
  };
1189
- metadataSelection?: {
1269
+ metadataSelection?: MetadataSelectionThemeAPI;
1270
+ formPopover?: FormPopoverThemeAPI;
1271
+ };
1272
+ };
1273
+
1274
+ /** Shared by headerSelect.features and preProcessing.preview.features (toolbar + merge edit bar). */
1275
+ export type HeaderMatchFeaturesThemeAPI = NonNullable<
1276
+ HeaderMatchAPI['features']
1277
+ >;
1278
+
1279
+ export type PreProcessingThemeAPI = {
1280
+ accent?: {
1281
+ color?: string;
1282
+ };
1283
+ root?: CSSInterpolation;
1284
+ pageHeader?: HeaderThemeAPI;
1285
+ footer?: FooterThemeAPI;
1286
+ content?: CSSInterpolation;
1287
+ inventory?: {
1288
+ root?: CSSInterpolation;
1289
+ fileChip?: CSSInterpolation & {
1290
+ focused?: CSSInterpolation;
1291
+ configureButton?: CSSInterpolation;
1292
+ parsedBadge?: CSSInterpolation;
1293
+ };
1294
+ sheetRow?: CSSInterpolation & {
1295
+ selected?: CSSInterpolation;
1296
+ viewing?: CSSInterpolation;
1297
+ processedTag?: CSSInterpolation;
1298
+ };
1299
+ addFileButton?: CSSInterpolation;
1300
+ };
1301
+ preview?: {
1302
+ root?: CSSInterpolation;
1303
+ title?: CSSInterpolation;
1304
+ combineRequired?: CSSInterpolation;
1305
+ table?: HeaderMatchAPI['table'];
1306
+ features?: Pick<HeaderMatchFeaturesThemeAPI, 'toolbar' | 'buttons'>;
1307
+ };
1308
+ modal?: {
1309
+ root?: CSSInterpolation;
1310
+ overlay?: CSSInterpolation;
1311
+ header?: CSSInterpolation;
1312
+ footer?: CSSInterpolation;
1313
+ additionalInfo?: IAdditionalInfoTheme;
1314
+ buttons?: FormButtonsThemeAPI;
1315
+ tabs?: {
1316
+ root?: CSSInterpolation;
1317
+ tab?: CSSInterpolation;
1318
+ activeTab?: CSSInterpolation;
1319
+ };
1320
+ recipe?: {
1190
1321
  root?: CSSInterpolation;
1191
- selectedBorderColor?: string;
1192
- hoverBackground?: string;
1193
- // metadata +/- button container
1194
- iconButton?: CSSInterpolation;
1195
- // metadata +/- SVG color (falls back to selectedBorderColor)
1196
- iconColor?: string;
1197
- valuePreview?: {
1198
- root?: CSSInterpolation;
1322
+ step?: CSSInterpolation;
1323
+ stepEditing?: CSSInterpolation;
1324
+ stepGenerated?: CSSInterpolation;
1325
+ generatedBadge?: CSSInterpolation;
1326
+ empty?: CSSInterpolation;
1327
+ addStep?: CSSInterpolation;
1328
+ addStepOption?: CSSInterpolation;
1329
+ field?: {
1199
1330
  label?: CSSInterpolation;
1200
- value?: CSSInterpolation;
1331
+ input?: CSSInterpolation;
1332
+ };
1333
+ dropdown?: {
1334
+ button?: CSSInterpolation;
1335
+ option?: CSSInterpolation;
1336
+ selectedOption?: CSSInterpolation;
1201
1337
  };
1202
1338
  };
1203
- formPopover?: HeaderMatchSurfaceAPI & {
1204
- width?: string;
1205
- header?: HeaderMatchDividerSectionAPI;
1206
- title?: HeaderMatchTextStyleAPI;
1207
- description?: HeaderMatchTextStyleAPI;
1208
- content?: CSSInterpolation;
1209
- footer?: HeaderMatchDividerSectionAPI;
1210
- controls?: {
1211
- input?: {
1212
- root?: CSSInterpolation;
1213
- color?: string;
1214
- backgroundColor?: string;
1215
- borderColor?: string;
1216
- borderRadius?: string;
1217
- fontSize?: string;
1218
- placeholderColor?: string;
1219
- focusBorderColor?: string;
1220
- };
1221
- quickFillButton?: HeaderMatchQuickFillButtonThemeAPI;
1339
+ combine?: {
1340
+ toggle?: CSSInterpolation;
1341
+ toggleSelected?: CSSInterpolation;
1342
+ mapping?: CSSInterpolation;
1343
+ matchStatus?: {
1344
+ success?: CSSInterpolation;
1345
+ warning?: CSSInterpolation;
1222
1346
  };
1223
1347
  };
1348
+ aiAssist?: {
1349
+ root?: CSSInterpolation;
1350
+ input?: CSSInterpolation;
1351
+ mentionList?: CSSInterpolation;
1352
+ mentionItem?: CSSInterpolation;
1353
+ mentionItemActive?: CSSInterpolation;
1354
+ };
1355
+ metadataSelection?: MetadataSelectionThemeAPI;
1356
+ formPopover?: PreProcessingFormPopoverThemeAPI;
1224
1357
  };
1225
1358
  };
1226
1359
 
@@ -1983,6 +2116,8 @@ export type ContextualEngineThemeAPI = {
1983
2116
  };
1984
2117
 
1985
2118
  export type LanguageType =
2119
+ | 'ar'
2120
+ | 'he'
1986
2121
  | 'de'
1987
2122
  | 'en'
1988
2123
  | 'es'
@@ -2021,6 +2156,7 @@ export declare const useDataImporter: (
2021
2156
  export type DynamicStepValues =
2022
2157
  | 'header'
2023
2158
  | 'mapping'
2159
+ | 'preProcessing'
2024
2160
  | 'review'
2025
2161
  | 'sheetSelection';
2026
2162
 
@@ -2041,14 +2177,22 @@ export type IParseFileXmlConfiguration = {
2041
2177
  };
2042
2178
  };
2043
2179
 
2180
+ export type IParseFilePdfConfiguration = {
2181
+ sourcePdfFile?: File;
2182
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2183
+ pdfDocument?: any;
2184
+ selectedPdfTableIds?: string[];
2185
+ };
2186
+
2044
2187
  export type SheetSelectionUploadFile = {
2045
- fileName: string;
2188
+ fileName?: string;
2046
2189
  sheets: {
2047
- sheetName: string;
2190
+ sheetName?: string;
2048
2191
  data: UploadData;
2049
2192
  visibility?: SheetVisibility;
2050
2193
  }[];
2051
2194
  xmlConfiguration?: IParseFileXmlConfiguration;
2195
+ pdfConfiguration?: IParseFilePdfConfiguration;
2052
2196
  };
2053
2197
 
2054
2198
  export type SheetSelectionUploadData = SheetSelectionUploadFile[];
@@ -2071,6 +2215,7 @@ export type IParseFile = {
2071
2215
  fileName: string;
2072
2216
  sheets: IParseSheet[];
2073
2217
  xmlConfiguration?: IParseFileXmlConfiguration;
2218
+ pdfConfiguration?: IParseFilePdfConfiguration;
2074
2219
  };
2075
2220
 
2076
2221
  export type OnEntryChangeLogs = {