@incodetech/core 0.0.0-dev-20260427-b544b2e → 0.0.0-dev-20260427-c244d1d

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/home.d.ts CHANGED
@@ -2,7 +2,7 @@ import { t as Manager } from "./Manager-BmmucBrC.js";
2
2
  import "./camera-CXfeCsaz.js";
3
3
  import "./types-BxjVn8Ry.js";
4
4
  import { t as EmptyConfig } from "./types-BelKmTqU.js";
5
- import * as xstate598 from "xstate";
5
+ import * as xstate375 from "xstate";
6
6
 
7
7
  //#region src/modules/home/types.d.ts
8
8
  type HomeConfig = EmptyConfig;
@@ -34,41 +34,41 @@ type HomeContext = {
34
34
  type HomeInput = {
35
35
  config: EmptyConfig;
36
36
  };
37
- declare const homeMachine: xstate598.StateMachine<HomeContext, {
37
+ declare const homeMachine: xstate375.StateMachine<HomeContext, {
38
38
  type: "LOAD";
39
39
  } | {
40
40
  type: "COMPLETE";
41
41
  } | {
42
42
  type: "RESET";
43
- }, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate598.NonReducibleUnknown, xstate598.EventObject, xstate598.MetaObject, {
43
+ }, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate375.NonReducibleUnknown, xstate375.EventObject, xstate375.MetaObject, {
44
44
  readonly id: "home";
45
45
  readonly initial: "idle";
46
46
  readonly context: ({
47
47
  input
48
48
  }: {
49
49
  spawn: {
50
- <TSrc extends never>(logic: TSrc, ...[options]: never): xstate598.ActorRefFromLogic<never>;
51
- <TLogic extends xstate598.AnyActorLogic>(src: TLogic, ...[options]: xstate598.ConditionalRequired<[options?: ({
50
+ <TSrc extends never>(logic: TSrc, ...[options]: never): xstate375.ActorRefFromLogic<never>;
51
+ <TLogic extends xstate375.AnyActorLogic>(src: TLogic, ...[options]: xstate375.ConditionalRequired<[options?: ({
52
52
  id?: never;
53
53
  systemId?: string;
54
- input?: xstate598.InputFrom<TLogic> | undefined;
54
+ input?: xstate375.InputFrom<TLogic> | undefined;
55
55
  syncSnapshot?: boolean;
56
- } & { [K in xstate598.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate598.IsNotNever<xstate598.RequiredLogicInput<TLogic>>>): xstate598.ActorRefFromLogic<TLogic>;
56
+ } & { [K in xstate375.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate375.IsNotNever<xstate375.RequiredLogicInput<TLogic>>>): xstate375.ActorRefFromLogic<TLogic>;
57
57
  };
58
58
  input: HomeInput;
59
- self: xstate598.ActorRef<xstate598.MachineSnapshot<HomeContext, {
59
+ self: xstate375.ActorRef<xstate375.MachineSnapshot<HomeContext, {
60
60
  type: "LOAD";
61
61
  } | {
62
62
  type: "COMPLETE";
63
63
  } | {
64
64
  type: "RESET";
65
- }, Record<string, xstate598.AnyActorRef | undefined>, xstate598.StateValue, string, unknown, any, any>, {
65
+ }, Record<string, xstate375.AnyActorRef | undefined>, xstate375.StateValue, string, unknown, any, any>, {
66
66
  type: "LOAD";
67
67
  } | {
68
68
  type: "COMPLETE";
69
69
  } | {
70
70
  type: "RESET";
71
- }, xstate598.AnyEventObject>;
71
+ }, xstate375.AnyEventObject>;
72
72
  }) => {
73
73
  config: EmptyConfig;
74
74
  };
package/dist/id-ocr.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-BmmucBrC.js";
2
2
  import "./Actor-gwS4PQSi.js";
3
- import * as xstate457 from "xstate";
3
+ import * as xstate302 from "xstate";
4
4
 
5
5
  //#region src/modules/id-ocr/types.d.ts
6
6
  type IdOcrConfig = {
@@ -177,7 +177,7 @@ type IdOcrContext = {
177
177
  type IdOcrInput = {
178
178
  config: IdOcrConfig;
179
179
  };
180
- declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
180
+ declare const idOcrStateMachine: xstate302.StateMachine<IdOcrContext, {
181
181
  type: "LOAD";
182
182
  } | {
183
183
  type: "DATA_CHANGED";
@@ -189,68 +189,68 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
189
189
  } | {
190
190
  type: "CONTINUE";
191
191
  } | {
192
- type: "RESET";
192
+ type: "RETRY";
193
193
  }, {
194
- [x: string]: xstate457.ActorRefFromLogic<xstate457.PromiseActorLogic<OcrData, {
194
+ [x: string]: xstate302.ActorRefFromLogic<xstate302.PromiseActorLogic<OcrData, {
195
195
  isSecondId: boolean;
196
- }, xstate457.EventObject>> | xstate457.ActorRefFromLogic<xstate457.PromiseActorLogic<UpdateOcrResponse, {
196
+ }, xstate302.EventObject>> | xstate302.ActorRefFromLogic<xstate302.PromiseActorLogic<UpdateOcrResponse, {
197
197
  params: UpdateOcrDataParams;
198
198
  isSecondId: boolean;
199
- }, xstate457.EventObject>> | undefined;
200
- }, xstate457.Values<{
199
+ }, xstate302.EventObject>> | undefined;
200
+ }, xstate302.Values<{
201
201
  getOcrData: {
202
202
  src: "getOcrData";
203
- logic: xstate457.PromiseActorLogic<OcrData, {
203
+ logic: xstate302.PromiseActorLogic<OcrData, {
204
204
  isSecondId: boolean;
205
- }, xstate457.EventObject>;
205
+ }, xstate302.EventObject>;
206
206
  id: string | undefined;
207
207
  };
208
208
  updateOcrData: {
209
209
  src: "updateOcrData";
210
- logic: xstate457.PromiseActorLogic<UpdateOcrResponse, {
210
+ logic: xstate302.PromiseActorLogic<UpdateOcrResponse, {
211
211
  params: UpdateOcrDataParams;
212
212
  isSecondId: boolean;
213
- }, xstate457.EventObject>;
213
+ }, xstate302.EventObject>;
214
214
  id: string | undefined;
215
215
  };
216
- }>, xstate457.Values<{
216
+ }>, xstate302.Values<{
217
217
  setError: {
218
218
  type: "setError";
219
- params: xstate457.NonReducibleUnknown;
219
+ params: xstate302.NonReducibleUnknown;
220
220
  };
221
221
  setInitialData: {
222
222
  type: "setInitialData";
223
- params: xstate457.NonReducibleUnknown;
223
+ params: xstate302.NonReducibleUnknown;
224
224
  };
225
225
  updateField: {
226
226
  type: "updateField";
227
- params: xstate457.NonReducibleUnknown;
227
+ params: xstate302.NonReducibleUnknown;
228
228
  };
229
229
  clearFieldValidationError: {
230
230
  type: "clearFieldValidationError";
231
- params: xstate457.NonReducibleUnknown;
231
+ params: xstate302.NonReducibleUnknown;
232
232
  };
233
233
  setOcrValidationErrors: {
234
234
  type: "setOcrValidationErrors";
235
- params: xstate457.NonReducibleUnknown;
235
+ params: xstate302.NonReducibleUnknown;
236
236
  };
237
237
  validateFormField: {
238
238
  type: "validateFormField";
239
- params: xstate457.NonReducibleUnknown;
239
+ params: xstate302.NonReducibleUnknown;
240
240
  };
241
241
  beginSecondIdOcrPhase: {
242
242
  type: "beginSecondIdOcrPhase";
243
- params: xstate457.NonReducibleUnknown;
243
+ params: xstate302.NonReducibleUnknown;
244
244
  };
245
245
  resetForRetry: {
246
246
  type: "resetForRetry";
247
- params: xstate457.NonReducibleUnknown;
247
+ params: xstate302.NonReducibleUnknown;
248
248
  };
249
249
  computeValidationResult: {
250
250
  type: "computeValidationResult";
251
- params: xstate457.NonReducibleUnknown;
251
+ params: xstate302.NonReducibleUnknown;
252
252
  };
253
- }>, xstate457.Values<{
253
+ }>, xstate302.Values<{
254
254
  isOcrEditable: {
255
255
  type: "isOcrEditable";
256
256
  params: unknown;
@@ -271,7 +271,7 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
271
271
  type: "shouldProceedWithoutSubmitToSecondId";
272
272
  params: unknown;
273
273
  };
274
- }>, never, "error" | "idle" | "finished" | "loading" | "submitting" | "inputting" | "readonly" | "validatingContinue", string, IdOcrInput, xstate457.NonReducibleUnknown, xstate457.EventObject, xstate457.MetaObject, {
274
+ }>, never, "error" | "idle" | "success" | "finished" | "loading" | "submitting" | "inputting" | "readonly" | "validatingContinue", string, IdOcrInput, xstate302.NonReducibleUnknown, xstate302.EventObject, xstate302.MetaObject, {
275
275
  readonly id: "idOcr";
276
276
  readonly initial: "idle";
277
277
  readonly context: ({
@@ -280,70 +280,70 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
280
280
  spawn: {
281
281
  <TSrc extends "getOcrData" | "updateOcrData">(logic: TSrc, ...[options]: ({
282
282
  src: "getOcrData";
283
- logic: xstate457.PromiseActorLogic<OcrData, {
283
+ logic: xstate302.PromiseActorLogic<OcrData, {
284
284
  isSecondId: boolean;
285
- }, xstate457.EventObject>;
285
+ }, xstate302.EventObject>;
286
286
  id: string | undefined;
287
287
  } extends infer T ? T extends {
288
288
  src: "getOcrData";
289
- logic: xstate457.PromiseActorLogic<OcrData, {
289
+ logic: xstate302.PromiseActorLogic<OcrData, {
290
290
  isSecondId: boolean;
291
- }, xstate457.EventObject>;
291
+ }, xstate302.EventObject>;
292
292
  id: string | undefined;
293
293
  } ? T extends {
294
294
  src: TSrc;
295
- } ? xstate457.ConditionalRequired<[options?: ({
295
+ } ? xstate302.ConditionalRequired<[options?: ({
296
296
  id?: T["id"] | undefined;
297
297
  systemId?: string;
298
- input?: xstate457.InputFrom<T["logic"]> | undefined;
298
+ input?: xstate302.InputFrom<T["logic"]> | undefined;
299
299
  syncSnapshot?: boolean;
300
- } & { [K in xstate457.RequiredActorOptions<T>]: unknown }) | undefined], xstate457.IsNotNever<xstate457.RequiredActorOptions<T>>> : never : never : never) | ({
300
+ } & { [K in xstate302.RequiredActorOptions<T>]: unknown }) | undefined], xstate302.IsNotNever<xstate302.RequiredActorOptions<T>>> : never : never : never) | ({
301
301
  src: "updateOcrData";
302
- logic: xstate457.PromiseActorLogic<UpdateOcrResponse, {
302
+ logic: xstate302.PromiseActorLogic<UpdateOcrResponse, {
303
303
  params: UpdateOcrDataParams;
304
304
  isSecondId: boolean;
305
- }, xstate457.EventObject>;
305
+ }, xstate302.EventObject>;
306
306
  id: string | undefined;
307
307
  } extends infer T_1 ? T_1 extends {
308
308
  src: "updateOcrData";
309
- logic: xstate457.PromiseActorLogic<UpdateOcrResponse, {
309
+ logic: xstate302.PromiseActorLogic<UpdateOcrResponse, {
310
310
  params: UpdateOcrDataParams;
311
311
  isSecondId: boolean;
312
- }, xstate457.EventObject>;
312
+ }, xstate302.EventObject>;
313
313
  id: string | undefined;
314
314
  } ? T_1 extends {
315
315
  src: TSrc;
316
- } ? xstate457.ConditionalRequired<[options?: ({
316
+ } ? xstate302.ConditionalRequired<[options?: ({
317
317
  id?: T_1["id"] | undefined;
318
318
  systemId?: string;
319
- input?: xstate457.InputFrom<T_1["logic"]> | undefined;
319
+ input?: xstate302.InputFrom<T_1["logic"]> | undefined;
320
320
  syncSnapshot?: boolean;
321
- } & { [K_1 in xstate457.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate457.IsNotNever<xstate457.RequiredActorOptions<T_1>>> : never : never : never)): xstate457.ActorRefFromLogic<xstate457.GetConcreteByKey<xstate457.Values<{
321
+ } & { [K_1 in xstate302.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate302.IsNotNever<xstate302.RequiredActorOptions<T_1>>> : never : never : never)): xstate302.ActorRefFromLogic<xstate302.GetConcreteByKey<xstate302.Values<{
322
322
  getOcrData: {
323
323
  src: "getOcrData";
324
- logic: xstate457.PromiseActorLogic<OcrData, {
324
+ logic: xstate302.PromiseActorLogic<OcrData, {
325
325
  isSecondId: boolean;
326
- }, xstate457.EventObject>;
326
+ }, xstate302.EventObject>;
327
327
  id: string | undefined;
328
328
  };
329
329
  updateOcrData: {
330
330
  src: "updateOcrData";
331
- logic: xstate457.PromiseActorLogic<UpdateOcrResponse, {
331
+ logic: xstate302.PromiseActorLogic<UpdateOcrResponse, {
332
332
  params: UpdateOcrDataParams;
333
333
  isSecondId: boolean;
334
- }, xstate457.EventObject>;
334
+ }, xstate302.EventObject>;
335
335
  id: string | undefined;
336
336
  };
337
337
  }>, "src", TSrc>["logic"]>;
338
- <TLogic extends xstate457.AnyActorLogic>(src: TLogic, ...[options]: xstate457.ConditionalRequired<[options?: ({
338
+ <TLogic extends xstate302.AnyActorLogic>(src: TLogic, ...[options]: xstate302.ConditionalRequired<[options?: ({
339
339
  id?: never;
340
340
  systemId?: string;
341
- input?: xstate457.InputFrom<TLogic> | undefined;
341
+ input?: xstate302.InputFrom<TLogic> | undefined;
342
342
  syncSnapshot?: boolean;
343
- } & { [K in xstate457.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate457.IsNotNever<xstate457.RequiredLogicInput<TLogic>>>): xstate457.ActorRefFromLogic<TLogic>;
343
+ } & { [K in xstate302.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate302.IsNotNever<xstate302.RequiredLogicInput<TLogic>>>): xstate302.ActorRefFromLogic<TLogic>;
344
344
  };
345
345
  input: IdOcrInput;
346
- self: xstate457.ActorRef<xstate457.MachineSnapshot<IdOcrContext, {
346
+ self: xstate302.ActorRef<xstate302.MachineSnapshot<IdOcrContext, {
347
347
  type: "LOAD";
348
348
  } | {
349
349
  type: "DATA_CHANGED";
@@ -355,8 +355,8 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
355
355
  } | {
356
356
  type: "CONTINUE";
357
357
  } | {
358
- type: "RESET";
359
- }, Record<string, xstate457.AnyActorRef | undefined>, xstate457.StateValue, string, unknown, any, any>, {
358
+ type: "RETRY";
359
+ }, Record<string, xstate302.AnyActorRef | undefined>, xstate302.StateValue, string, unknown, any, any>, {
360
360
  type: "LOAD";
361
361
  } | {
362
362
  type: "DATA_CHANGED";
@@ -368,8 +368,8 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
368
368
  } | {
369
369
  type: "CONTINUE";
370
370
  } | {
371
- type: "RESET";
372
- }, xstate457.AnyEventObject>;
371
+ type: "RETRY";
372
+ }, xstate302.AnyEventObject>;
373
373
  }) => {
374
374
  config: IdOcrConfig;
375
375
  formData: UpdateOcrDataParams;
@@ -403,9 +403,9 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
403
403
  } | {
404
404
  type: "CONTINUE";
405
405
  } | {
406
- type: "RESET";
406
+ type: "RETRY";
407
407
  };
408
- self: xstate457.ActorRef<xstate457.MachineSnapshot<IdOcrContext, {
408
+ self: xstate302.ActorRef<xstate302.MachineSnapshot<IdOcrContext, {
409
409
  type: "LOAD";
410
410
  } | {
411
411
  type: "DATA_CHANGED";
@@ -417,8 +417,8 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
417
417
  } | {
418
418
  type: "CONTINUE";
419
419
  } | {
420
- type: "RESET";
421
- }, Record<string, xstate457.AnyActorRef>, xstate457.StateValue, string, unknown, any, any>, {
420
+ type: "RETRY";
421
+ }, Record<string, xstate302.AnyActorRef>, xstate302.StateValue, string, unknown, any, any>, {
422
422
  type: "LOAD";
423
423
  } | {
424
424
  type: "DATA_CHANGED";
@@ -430,8 +430,8 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
430
430
  } | {
431
431
  type: "CONTINUE";
432
432
  } | {
433
- type: "RESET";
434
- }, xstate457.AnyEventObject>;
433
+ type: "RETRY";
434
+ }, xstate302.AnyEventObject>;
435
435
  }) => {
436
436
  isSecondId: boolean;
437
437
  };
@@ -456,7 +456,7 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
456
456
  readonly guard: "shouldLoadSecondOcrAfterFirst";
457
457
  readonly actions: "beginSecondIdOcrPhase";
458
458
  }, {
459
- readonly target: "finished";
459
+ readonly target: "success";
460
460
  }];
461
461
  };
462
462
  };
@@ -508,9 +508,9 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
508
508
  } | {
509
509
  type: "CONTINUE";
510
510
  } | {
511
- type: "RESET";
511
+ type: "RETRY";
512
512
  };
513
- self: xstate457.ActorRef<xstate457.MachineSnapshot<IdOcrContext, {
513
+ self: xstate302.ActorRef<xstate302.MachineSnapshot<IdOcrContext, {
514
514
  type: "LOAD";
515
515
  } | {
516
516
  type: "DATA_CHANGED";
@@ -522,8 +522,8 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
522
522
  } | {
523
523
  type: "CONTINUE";
524
524
  } | {
525
- type: "RESET";
526
- }, Record<string, xstate457.AnyActorRef>, xstate457.StateValue, string, unknown, any, any>, {
525
+ type: "RETRY";
526
+ }, Record<string, xstate302.AnyActorRef>, xstate302.StateValue, string, unknown, any, any>, {
527
527
  type: "LOAD";
528
528
  } | {
529
529
  type: "DATA_CHANGED";
@@ -535,8 +535,8 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
535
535
  } | {
536
536
  type: "CONTINUE";
537
537
  } | {
538
- type: "RESET";
539
- }, xstate457.AnyEventObject>;
538
+ type: "RETRY";
539
+ }, xstate302.AnyEventObject>;
540
540
  }) => {
541
541
  params: UpdateOcrDataParams;
542
542
  isSecondId: boolean;
@@ -546,7 +546,7 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
546
546
  readonly guard: "shouldLoadSecondOcrAfterFirst";
547
547
  readonly actions: "beginSecondIdOcrPhase";
548
548
  }, {
549
- readonly target: "finished";
549
+ readonly target: "success";
550
550
  }];
551
551
  readonly onError: {
552
552
  readonly target: "error";
@@ -554,17 +554,22 @@ declare const idOcrStateMachine: xstate457.StateMachine<IdOcrContext, {
554
554
  };
555
555
  };
556
556
  };
557
- readonly finished: {
558
- readonly type: "final";
559
- };
560
557
  readonly error: {
561
558
  readonly on: {
562
- readonly RESET: {
563
- readonly target: "idle";
559
+ readonly RETRY: {
560
+ readonly target: "loading";
564
561
  readonly actions: "resetForRetry";
565
562
  };
566
563
  };
567
564
  };
565
+ readonly success: {
566
+ readonly after: {
567
+ readonly 3000: "finished";
568
+ };
569
+ };
570
+ readonly finished: {
571
+ readonly type: "final";
572
+ };
568
573
  };
569
574
  }>;
570
575
  //#endregion
@@ -590,7 +595,7 @@ type IdOcrReadonlyState = {
590
595
  type IdOcrInputtingState = {
591
596
  status: 'inputting';
592
597
  formData: UpdateOcrDataParams;
593
- diff: UpdateOcrDataParams;
598
+ editedFields: UpdateOcrDataParams;
594
599
  editableOcr: boolean;
595
600
  ocrDocument: IdOcrOcrDocument;
596
601
  validationErrors?: Partial<Record<keyof UpdateOcrDataParams, string>>;
@@ -606,13 +611,16 @@ type IdOcrErrorState = {
606
611
  status: 'error';
607
612
  error: string;
608
613
  };
609
- type IdOcrState = IdOcrIdleState | IdOcrLoadingState | IdOcrReadonlyState | IdOcrInputtingState | IdOcrSubmittingState | IdOcrFinishedState | IdOcrErrorState;
614
+ type IdOcrSuccessState = {
615
+ status: 'success';
616
+ };
617
+ type IdOcrState = IdOcrIdleState | IdOcrLoadingState | IdOcrReadonlyState | IdOcrInputtingState | IdOcrSubmittingState | IdOcrFinishedState | IdOcrErrorState | IdOcrSuccessState;
610
618
  declare function createIdOcrManager(options: CreateIdOcrActorOptions): Manager<IdOcrState> & {
611
619
  load(): void;
612
620
  setField(field: keyof UpdateOcrDataParams, value: string): void;
613
621
  validateField(field: keyof UpdateOcrDataParams): void;
614
622
  continue(): void;
615
- reset(): void;
623
+ retry(): void;
616
624
  };
617
625
  type IdOcrManager = ReturnType<typeof createIdOcrManager>;
618
626
  //#endregion
@@ -332,7 +332,7 @@ const idOcrStateMachine = setup({
332
332
  target: "loading",
333
333
  guard: "shouldLoadSecondOcrAfterFirst",
334
334
  actions: "beginSecondIdOcrPhase"
335
- }, { target: "finished" }] } },
335
+ }, { target: "success" }] } },
336
336
  inputting: { on: {
337
337
  DATA_CHANGED: { actions: ["updateField", "clearFieldValidationError"] },
338
338
  VALIDATE_FIELD: { actions: "validateFormField" },
@@ -367,17 +367,18 @@ const idOcrStateMachine = setup({
367
367
  target: "loading",
368
368
  guard: "shouldLoadSecondOcrAfterFirst",
369
369
  actions: "beginSecondIdOcrPhase"
370
- }, { target: "finished" }],
370
+ }, { target: "success" }],
371
371
  onError: {
372
372
  target: "error",
373
373
  actions: "setError"
374
374
  }
375
375
  } },
376
- finished: { type: "final" },
377
- error: { on: { RESET: {
378
- target: "idle",
376
+ error: { on: { RETRY: {
377
+ target: "loading",
379
378
  actions: "resetForRetry"
380
- } } }
379
+ } } },
380
+ success: { after: { 3e3: "finished" } },
381
+ finished: { type: "final" }
381
382
  }
382
383
  });
383
384
 
@@ -406,7 +407,7 @@ function mapState(snapshot) {
406
407
  if (snapshot.matches("inputting")) return {
407
408
  status: "inputting",
408
409
  formData: context.formData,
409
- diff: context.editedFields,
410
+ editedFields: context.editedFields,
410
411
  editableOcr,
411
412
  ocrDocument: context.activeOcrDocument,
412
413
  validationErrors: context.validationErrors
@@ -415,6 +416,7 @@ function mapState(snapshot) {
415
416
  status: "submitting",
416
417
  ocrDocument: context.activeOcrDocument
417
418
  };
419
+ if (snapshot.matches("success")) return { status: "success" };
418
420
  if (snapshot.matches("finished")) return { status: "finished" };
419
421
  if (snapshot.matches("error")) return {
420
422
  status: "error",
@@ -444,8 +446,8 @@ function createApi({ actor, trackElementClicked }) {
444
446
  actor.send({ type: "CONTINUE" });
445
447
  trackElementClicked?.("continue");
446
448
  },
447
- reset() {
448
- actor.send({ type: "RESET" });
449
+ retry() {
450
+ actor.send({ type: "RETRY" });
449
451
  }
450
452
  };
451
453
  }