document-model 1.1.0-debug.2 → 1.1.0-experimental.2
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/browser/cjs/document-model.js +1 -21
- package/dist/browser/cjs/document.js +1 -15
- package/dist/browser/cjs/index.js +1 -18
- package/dist/browser/cjs/internal/index-DLodkpOq.js +22 -0
- package/dist/browser/cjs/internal/index-azT4DEce.js +1 -0
- package/dist/browser/cjs/internal/object-CMr-_AP8.js +25 -0
- package/dist/browser/es/document-model.js +15 -16
- package/dist/browser/es/document.js +9 -10
- package/dist/browser/es/index.js +11 -13
- package/dist/browser/es/internal/index-BzNpRs2a.js +44 -0
- package/dist/browser/es/internal/index-CL_1ivGq.js +2104 -0
- package/dist/browser/es/internal/object-FFc9n_3I.js +2789 -0
- package/dist/browser/src/document/object.d.ts +35 -0
- package/dist/browser/src/document/types.d.ts +6 -0
- package/dist/browser/src/document/utils/base.d.ts +5 -4
- package/dist/browser/src/document/utils/document-helpers.d.ts +1 -1
- package/dist/browser/src/document/utils/index.d.ts +1 -1
- package/dist/node/cjs/document-model.js +1 -25
- package/dist/node/cjs/document.js +1 -19
- package/dist/node/cjs/index.js +1 -22
- package/dist/node/cjs/internal/index-CPeTtUsk.js +22 -0
- package/dist/node/cjs/internal/index-CTavCc1t.js +1 -0
- package/dist/node/cjs/internal/object-DhI24-1e.js +20 -0
- package/dist/node/es/document-model.js +14 -15
- package/dist/node/es/document.js +9 -10
- package/dist/node/es/index.js +11 -13
- package/dist/node/es/internal/index-8lUz8qED.js +44 -0
- package/dist/node/es/internal/index-A880In4b.js +2108 -0
- package/dist/node/es/internal/object-C9n9Ijnt.js +1687 -0
- package/dist/node/src/document/object.d.ts +35 -0
- package/dist/node/src/document/types.d.ts +6 -0
- package/dist/node/src/document/utils/base.d.ts +5 -4
- package/dist/node/src/document/utils/document-helpers.d.ts +1 -1
- package/dist/node/src/document/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -19
- package/dist/browser/cjs/document-model.js.map +0 -1
- package/dist/browser/cjs/document.js.map +0 -1
- package/dist/browser/cjs/index.js.map +0 -1
- package/dist/browser/cjs/internal/index-CaJbS06G.js +0 -2339
- package/dist/browser/cjs/internal/index-CaJbS06G.js.map +0 -1
- package/dist/browser/cjs/internal/index-kKIg6qNB.js +0 -44
- package/dist/browser/cjs/internal/index-kKIg6qNB.js.map +0 -1
- package/dist/browser/cjs/internal/object-B6dSDhtS.js +0 -4109
- package/dist/browser/cjs/internal/object-B6dSDhtS.js.map +0 -1
- package/dist/browser/es/document-model.js.map +0 -1
- package/dist/browser/es/document.js.map +0 -1
- package/dist/browser/es/index.js.map +0 -1
- package/dist/browser/es/internal/index-B1lQN59e.js +0 -2340
- package/dist/browser/es/internal/index-B1lQN59e.js.map +0 -1
- package/dist/browser/es/internal/index-Bu0CkmrW.js +0 -45
- package/dist/browser/es/internal/index-Bu0CkmrW.js.map +0 -1
- package/dist/browser/es/internal/object-9mR1JlXD.js +0 -4110
- package/dist/browser/es/internal/object-9mR1JlXD.js.map +0 -1
- package/dist/node/cjs/document-model.js.map +0 -1
- package/dist/node/cjs/document.js.map +0 -1
- package/dist/node/cjs/index.js.map +0 -1
- package/dist/node/cjs/internal/index-AqiVmL0w.js +0 -44
- package/dist/node/cjs/internal/index-AqiVmL0w.js.map +0 -1
- package/dist/node/cjs/internal/index-ajqhOWQ1.js +0 -2343
- package/dist/node/cjs/internal/index-ajqhOWQ1.js.map +0 -1
- package/dist/node/cjs/internal/object-D_9h7jBN.js +0 -2111
- package/dist/node/cjs/internal/object-D_9h7jBN.js.map +0 -1
- package/dist/node/es/document-model.js.map +0 -1
- package/dist/node/es/document.js.map +0 -1
- package/dist/node/es/index.js.map +0 -1
- package/dist/node/es/internal/index-Bh_09edy.js +0 -2344
- package/dist/node/es/internal/index-Bh_09edy.js.map +0 -1
- package/dist/node/es/internal/index-s6NFw7Kq.js +0 -45
- package/dist/node/es/internal/index-s6NFw7Kq.js.map +0 -1
- package/dist/node/es/internal/object-CbITi4iq.js +0 -2112
- package/dist/node/es/internal/object-CbITi4iq.js.map +0 -1
- package/dist/src/document/actions/creators.d.ts +0 -47
- package/dist/src/document/actions/index.d.ts +0 -14
- package/dist/src/document/actions/types.d.ts +0 -15
- package/dist/src/document/index.d.ts +0 -6
- package/dist/src/document/object.d.ts +0 -1175
- package/dist/src/document/reducer.d.ts +0 -43
- package/dist/src/document/schema/index.d.ts +0 -2
- package/dist/src/document/schema/types.d.ts +0 -176
- package/dist/src/document/schema/zod.d.ts +0 -113
- package/dist/src/document/signal.d.ts +0 -29
- package/dist/src/document/types.d.ts +0 -249
- package/dist/src/document/utils/base.d.ts +0 -85
- package/dist/src/document/utils/document-helpers.d.ts +0 -53
- package/dist/src/document/utils/file.d.ts +0 -48
- package/dist/src/document/utils/index.d.ts +0 -5
- package/dist/src/document/utils/node.d.ts +0 -9
- package/dist/src/document/utils/validation.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/header.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/module.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/operation-error.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/operation-example.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/operation.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/state.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/versioning.d.ts +0 -7
- package/dist/src/document-model/custom/utils.d.ts +0 -7
- package/dist/src/document-model/gen/actions.d.ts +0 -15
- package/dist/src/document-model/gen/creators.d.ts +0 -7
- package/dist/src/document-model/gen/document-model.d.ts +0 -2
- package/dist/src/document-model/gen/header/actions.d.ts +0 -9
- package/dist/src/document-model/gen/header/creators.d.ts +0 -8
- package/dist/src/document-model/gen/header/object.d.ts +0 -12
- package/dist/src/document-model/gen/header/operations.d.ts +0 -10
- package/dist/src/document-model/gen/index.d.ts +0 -5
- package/dist/src/document-model/gen/module/actions.d.ts +0 -8
- package/dist/src/document-model/gen/module/creators.d.ts +0 -7
- package/dist/src/document-model/gen/module/object.d.ts +0 -11
- package/dist/src/document-model/gen/module/operations.d.ts +0 -9
- package/dist/src/document-model/gen/object.d.ts +0 -28
- package/dist/src/document-model/gen/operation/actions.d.ts +0 -13
- package/dist/src/document-model/gen/operation/creators.d.ts +0 -12
- package/dist/src/document-model/gen/operation/object.d.ts +0 -16
- package/dist/src/document-model/gen/operation/operations.d.ts +0 -14
- package/dist/src/document-model/gen/operation-error/actions.d.ts +0 -10
- package/dist/src/document-model/gen/operation-error/creators.d.ts +0 -9
- package/dist/src/document-model/gen/operation-error/object.d.ts +0 -13
- package/dist/src/document-model/gen/operation-error/operations.d.ts +0 -11
- package/dist/src/document-model/gen/operation-example/actions.d.ts +0 -7
- package/dist/src/document-model/gen/operation-example/creators.d.ts +0 -6
- package/dist/src/document-model/gen/operation-example/object.d.ts +0 -10
- package/dist/src/document-model/gen/operation-example/operations.d.ts +0 -8
- package/dist/src/document-model/gen/reducer.d.ts +0 -5
- package/dist/src/document-model/gen/schema/index.d.ts +0 -2
- package/dist/src/document-model/gen/schema/types.d.ts +0 -453
- package/dist/src/document-model/gen/schema/zod.d.ts +0 -453
- package/dist/src/document-model/gen/state/actions.d.ts +0 -9
- package/dist/src/document-model/gen/state/creators.d.ts +0 -8
- package/dist/src/document-model/gen/state/object.d.ts +0 -12
- package/dist/src/document-model/gen/state/operations.d.ts +0 -10
- package/dist/src/document-model/gen/types.d.ts +0 -8
- package/dist/src/document-model/gen/utils.d.ts +0 -6
- package/dist/src/document-model/gen/versioning/actions.d.ts +0 -8
- package/dist/src/document-model/gen/versioning/creators.d.ts +0 -7
- package/dist/src/document-model/gen/versioning/object.d.ts +0 -11
- package/dist/src/document-model/gen/versioning/operations.d.ts +0 -9
- package/dist/src/document-model/index.d.ts +0 -80
- package/dist/src/index.d.ts +0 -25
- package/dist/vite.config.d.ts +0 -2
- package/dist/vitest.config.d.ts +0 -2
|
@@ -89,6 +89,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
89
89
|
readonly hash: string;
|
|
90
90
|
readonly skip: number;
|
|
91
91
|
readonly error?: string | undefined;
|
|
92
|
+
readonly resultingState?: unknown;
|
|
92
93
|
} | {
|
|
93
94
|
readonly type: "PRUNE";
|
|
94
95
|
readonly input: {
|
|
@@ -122,6 +123,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
122
123
|
readonly hash: string;
|
|
123
124
|
readonly skip: number;
|
|
124
125
|
readonly error?: string | undefined;
|
|
126
|
+
readonly resultingState?: unknown;
|
|
125
127
|
} | {
|
|
126
128
|
readonly type: "REDO";
|
|
127
129
|
readonly input: number;
|
|
@@ -152,6 +154,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
152
154
|
readonly hash: string;
|
|
153
155
|
readonly skip: number;
|
|
154
156
|
readonly error?: string | undefined;
|
|
157
|
+
readonly resultingState?: unknown;
|
|
155
158
|
} | {
|
|
156
159
|
readonly type: "SET_NAME";
|
|
157
160
|
readonly input: string;
|
|
@@ -182,6 +185,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
182
185
|
readonly hash: string;
|
|
183
186
|
readonly skip: number;
|
|
184
187
|
readonly error?: string | undefined;
|
|
188
|
+
readonly resultingState?: unknown;
|
|
185
189
|
} | {
|
|
186
190
|
readonly type: "UNDO";
|
|
187
191
|
readonly input: number;
|
|
@@ -212,6 +216,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
212
216
|
readonly hash: string;
|
|
213
217
|
readonly skip: number;
|
|
214
218
|
readonly error?: string | undefined;
|
|
219
|
+
readonly resultingState?: unknown;
|
|
215
220
|
} | {
|
|
216
221
|
readonly type: "NOOP";
|
|
217
222
|
readonly input: unknown;
|
|
@@ -242,12 +247,14 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
242
247
|
readonly hash: string;
|
|
243
248
|
readonly skip: number;
|
|
244
249
|
readonly error?: string | undefined;
|
|
250
|
+
readonly resultingState?: unknown;
|
|
245
251
|
} | import("immer").Immutable<A & {
|
|
246
252
|
index: number;
|
|
247
253
|
timestamp: string;
|
|
248
254
|
hash: string;
|
|
249
255
|
skip: number;
|
|
250
256
|
error?: string | undefined;
|
|
257
|
+
resultingState?: unknown;
|
|
251
258
|
}>)[];
|
|
252
259
|
readonly local: readonly ({
|
|
253
260
|
readonly type: "LOAD_STATE";
|
|
@@ -285,6 +292,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
285
292
|
readonly hash: string;
|
|
286
293
|
readonly skip: number;
|
|
287
294
|
readonly error?: string | undefined;
|
|
295
|
+
readonly resultingState?: unknown;
|
|
288
296
|
} | {
|
|
289
297
|
readonly type: "PRUNE";
|
|
290
298
|
readonly input: {
|
|
@@ -318,6 +326,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
318
326
|
readonly hash: string;
|
|
319
327
|
readonly skip: number;
|
|
320
328
|
readonly error?: string | undefined;
|
|
329
|
+
readonly resultingState?: unknown;
|
|
321
330
|
} | {
|
|
322
331
|
readonly type: "REDO";
|
|
323
332
|
readonly input: number;
|
|
@@ -348,6 +357,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
348
357
|
readonly hash: string;
|
|
349
358
|
readonly skip: number;
|
|
350
359
|
readonly error?: string | undefined;
|
|
360
|
+
readonly resultingState?: unknown;
|
|
351
361
|
} | {
|
|
352
362
|
readonly type: "SET_NAME";
|
|
353
363
|
readonly input: string;
|
|
@@ -378,6 +388,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
378
388
|
readonly hash: string;
|
|
379
389
|
readonly skip: number;
|
|
380
390
|
readonly error?: string | undefined;
|
|
391
|
+
readonly resultingState?: unknown;
|
|
381
392
|
} | {
|
|
382
393
|
readonly type: "UNDO";
|
|
383
394
|
readonly input: number;
|
|
@@ -408,6 +419,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
408
419
|
readonly hash: string;
|
|
409
420
|
readonly skip: number;
|
|
410
421
|
readonly error?: string | undefined;
|
|
422
|
+
readonly resultingState?: unknown;
|
|
411
423
|
} | {
|
|
412
424
|
readonly type: "NOOP";
|
|
413
425
|
readonly input: unknown;
|
|
@@ -438,12 +450,14 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
438
450
|
readonly hash: string;
|
|
439
451
|
readonly skip: number;
|
|
440
452
|
readonly error?: string | undefined;
|
|
453
|
+
readonly resultingState?: unknown;
|
|
441
454
|
} | import("immer").Immutable<A & {
|
|
442
455
|
index: number;
|
|
443
456
|
timestamp: string;
|
|
444
457
|
hash: string;
|
|
445
458
|
skip: number;
|
|
446
459
|
error?: string | undefined;
|
|
460
|
+
resultingState?: unknown;
|
|
447
461
|
}>)[];
|
|
448
462
|
};
|
|
449
463
|
/**
|
|
@@ -553,6 +567,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
553
567
|
readonly hash: string;
|
|
554
568
|
readonly skip: number;
|
|
555
569
|
readonly error?: string | undefined;
|
|
570
|
+
readonly resultingState?: unknown;
|
|
556
571
|
} | {
|
|
557
572
|
readonly type: "PRUNE";
|
|
558
573
|
readonly input: {
|
|
@@ -586,6 +601,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
586
601
|
readonly hash: string;
|
|
587
602
|
readonly skip: number;
|
|
588
603
|
readonly error?: string | undefined;
|
|
604
|
+
readonly resultingState?: unknown;
|
|
589
605
|
} | {
|
|
590
606
|
readonly type: "REDO";
|
|
591
607
|
readonly input: number;
|
|
@@ -616,6 +632,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
616
632
|
readonly hash: string;
|
|
617
633
|
readonly skip: number;
|
|
618
634
|
readonly error?: string | undefined;
|
|
635
|
+
readonly resultingState?: unknown;
|
|
619
636
|
} | {
|
|
620
637
|
readonly type: "SET_NAME";
|
|
621
638
|
readonly input: string;
|
|
@@ -646,6 +663,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
646
663
|
readonly hash: string;
|
|
647
664
|
readonly skip: number;
|
|
648
665
|
readonly error?: string | undefined;
|
|
666
|
+
readonly resultingState?: unknown;
|
|
649
667
|
} | {
|
|
650
668
|
readonly type: "UNDO";
|
|
651
669
|
readonly input: number;
|
|
@@ -676,6 +694,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
676
694
|
readonly hash: string;
|
|
677
695
|
readonly skip: number;
|
|
678
696
|
readonly error?: string | undefined;
|
|
697
|
+
readonly resultingState?: unknown;
|
|
679
698
|
} | {
|
|
680
699
|
readonly type: "NOOP";
|
|
681
700
|
readonly input: unknown;
|
|
@@ -706,12 +725,14 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
706
725
|
readonly hash: string;
|
|
707
726
|
readonly skip: number;
|
|
708
727
|
readonly error?: string | undefined;
|
|
728
|
+
readonly resultingState?: unknown;
|
|
709
729
|
} | import("immer").Immutable<A & {
|
|
710
730
|
index: number;
|
|
711
731
|
timestamp: string;
|
|
712
732
|
hash: string;
|
|
713
733
|
skip: number;
|
|
714
734
|
error?: string | undefined;
|
|
735
|
+
resultingState?: unknown;
|
|
715
736
|
}>)[];
|
|
716
737
|
readonly local: readonly ({
|
|
717
738
|
readonly type: "LOAD_STATE";
|
|
@@ -749,6 +770,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
749
770
|
readonly hash: string;
|
|
750
771
|
readonly skip: number;
|
|
751
772
|
readonly error?: string | undefined;
|
|
773
|
+
readonly resultingState?: unknown;
|
|
752
774
|
} | {
|
|
753
775
|
readonly type: "PRUNE";
|
|
754
776
|
readonly input: {
|
|
@@ -782,6 +804,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
782
804
|
readonly hash: string;
|
|
783
805
|
readonly skip: number;
|
|
784
806
|
readonly error?: string | undefined;
|
|
807
|
+
readonly resultingState?: unknown;
|
|
785
808
|
} | {
|
|
786
809
|
readonly type: "REDO";
|
|
787
810
|
readonly input: number;
|
|
@@ -812,6 +835,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
812
835
|
readonly hash: string;
|
|
813
836
|
readonly skip: number;
|
|
814
837
|
readonly error?: string | undefined;
|
|
838
|
+
readonly resultingState?: unknown;
|
|
815
839
|
} | {
|
|
816
840
|
readonly type: "SET_NAME";
|
|
817
841
|
readonly input: string;
|
|
@@ -842,6 +866,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
842
866
|
readonly hash: string;
|
|
843
867
|
readonly skip: number;
|
|
844
868
|
readonly error?: string | undefined;
|
|
869
|
+
readonly resultingState?: unknown;
|
|
845
870
|
} | {
|
|
846
871
|
readonly type: "UNDO";
|
|
847
872
|
readonly input: number;
|
|
@@ -872,6 +897,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
872
897
|
readonly hash: string;
|
|
873
898
|
readonly skip: number;
|
|
874
899
|
readonly error?: string | undefined;
|
|
900
|
+
readonly resultingState?: unknown;
|
|
875
901
|
} | {
|
|
876
902
|
readonly type: "NOOP";
|
|
877
903
|
readonly input: unknown;
|
|
@@ -902,12 +928,14 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
902
928
|
readonly hash: string;
|
|
903
929
|
readonly skip: number;
|
|
904
930
|
readonly error?: string | undefined;
|
|
931
|
+
readonly resultingState?: unknown;
|
|
905
932
|
} | import("immer").Immutable<A & {
|
|
906
933
|
index: number;
|
|
907
934
|
timestamp: string;
|
|
908
935
|
hash: string;
|
|
909
936
|
skip: number;
|
|
910
937
|
error?: string | undefined;
|
|
938
|
+
resultingState?: unknown;
|
|
911
939
|
}>)[];
|
|
912
940
|
};
|
|
913
941
|
readonly initialState: {
|
|
@@ -968,6 +996,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
968
996
|
readonly hash: string;
|
|
969
997
|
readonly skip: number;
|
|
970
998
|
readonly error?: string | undefined;
|
|
999
|
+
readonly resultingState?: unknown;
|
|
971
1000
|
} | {
|
|
972
1001
|
readonly type: "PRUNE";
|
|
973
1002
|
readonly input: {
|
|
@@ -1001,6 +1030,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
1001
1030
|
readonly hash: string;
|
|
1002
1031
|
readonly skip: number;
|
|
1003
1032
|
readonly error?: string | undefined;
|
|
1033
|
+
readonly resultingState?: unknown;
|
|
1004
1034
|
} | {
|
|
1005
1035
|
readonly type: "REDO";
|
|
1006
1036
|
readonly input: number;
|
|
@@ -1031,6 +1061,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
1031
1061
|
readonly hash: string;
|
|
1032
1062
|
readonly skip: number;
|
|
1033
1063
|
readonly error?: string | undefined;
|
|
1064
|
+
readonly resultingState?: unknown;
|
|
1034
1065
|
} | {
|
|
1035
1066
|
readonly type: "SET_NAME";
|
|
1036
1067
|
readonly input: string;
|
|
@@ -1061,6 +1092,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
1061
1092
|
readonly hash: string;
|
|
1062
1093
|
readonly skip: number;
|
|
1063
1094
|
readonly error?: string | undefined;
|
|
1095
|
+
readonly resultingState?: unknown;
|
|
1064
1096
|
} | {
|
|
1065
1097
|
readonly type: "UNDO";
|
|
1066
1098
|
readonly input: number;
|
|
@@ -1091,6 +1123,7 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
1091
1123
|
readonly hash: string;
|
|
1092
1124
|
readonly skip: number;
|
|
1093
1125
|
readonly error?: string | undefined;
|
|
1126
|
+
readonly resultingState?: unknown;
|
|
1094
1127
|
} | {
|
|
1095
1128
|
readonly type: "NOOP";
|
|
1096
1129
|
readonly input: unknown;
|
|
@@ -1121,12 +1154,14 @@ export declare abstract class BaseDocument<T, A extends Action, L = unknown> {
|
|
|
1121
1154
|
readonly hash: string;
|
|
1122
1155
|
readonly skip: number;
|
|
1123
1156
|
readonly error?: string | undefined;
|
|
1157
|
+
readonly resultingState?: unknown;
|
|
1124
1158
|
} | import("immer").Immutable<A & {
|
|
1125
1159
|
index: number;
|
|
1126
1160
|
timestamp: string;
|
|
1127
1161
|
hash: string;
|
|
1128
1162
|
skip: number;
|
|
1129
1163
|
error?: string | undefined;
|
|
1164
|
+
resultingState?: unknown;
|
|
1130
1165
|
}>)[];
|
|
1131
1166
|
};
|
|
1132
1167
|
/**
|
|
@@ -52,6 +52,10 @@ export type ReducerOptions = {
|
|
|
52
52
|
ignoreSkipOperations?: boolean;
|
|
53
53
|
/** if true reuses the provided action hash */
|
|
54
54
|
reuseHash?: boolean;
|
|
55
|
+
/** if true reuses the provided action resulting state instead of replaying it */
|
|
56
|
+
reuseOperationResultingState?: boolean;
|
|
57
|
+
/** Optional parser for the operation resulting state, uses JSON.parse by default */
|
|
58
|
+
operationResultingStateParser?: (state: unknown) => object;
|
|
55
59
|
};
|
|
56
60
|
/**
|
|
57
61
|
* A pure function that takes an action and the previous state
|
|
@@ -102,6 +106,8 @@ export type Operation<A extends Action = Action> = A & {
|
|
|
102
106
|
skip: number;
|
|
103
107
|
/** Error message for a failed action */
|
|
104
108
|
error?: string;
|
|
109
|
+
/** The resulting state after the operation */
|
|
110
|
+
resultingState?: unknown;
|
|
105
111
|
};
|
|
106
112
|
/**
|
|
107
113
|
* The base attributes of a {@link Document}.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { baseReducer } from '../reducer';
|
|
2
|
-
import { Action, BaseAction, UndoRedoAction, Document, ExtendedState, ImmutableStateReducer, Reducer, Immutable, OperationScope, State, CreateState, PartialState, DocumentOperations, DocumentHeader, DocumentOperationsIgnoreMap, Operation, MappedOperation } from '../types';
|
|
2
|
+
import { Action, BaseAction, UndoRedoAction, Document, ExtendedState, ImmutableStateReducer, Reducer, Immutable, OperationScope, State, CreateState, PartialState, DocumentOperations, DocumentHeader, DocumentOperationsIgnoreMap, Operation, MappedOperation, ReducerOptions } from '../types';
|
|
3
3
|
import { SignalDispatch } from '../signal';
|
|
4
4
|
export declare function isNoopOperation(op: Partial<Operation>): boolean;
|
|
5
5
|
export declare function isUndoRedo(action: Action): action is UndoRedoAction;
|
|
@@ -74,12 +74,13 @@ export declare function mapSkippedOperations<A extends Action>(operations: Opera
|
|
|
74
74
|
export declare function calculateSkipsLeft<A extends Action>(operations: Operation<BaseAction | A>[], currentIndex: number, skip: number): number;
|
|
75
75
|
export declare function sortOperations<A extends Action>(operations: DocumentOperations<A>): Operation<BaseAction | A>[];
|
|
76
76
|
export declare function sortMappedOperations<A extends Action>(operations: DocumentOperationsIgnoreMap<A>): MappedOperation<A>[];
|
|
77
|
-
export declare function replayOperations<T, A extends Action, L>(initialState: ExtendedState<T, L>, clearedOperations: DocumentOperations<A>, reducer: ImmutableStateReducer<T, A, L>, dispatch?: SignalDispatch, header?: DocumentHeader, documentReducer?: typeof baseReducer, skipHeaderOperations?: SkipHeaderOperations, options?:
|
|
78
|
-
checkHashes?: boolean;
|
|
79
|
-
}): Document<T, A, L>;
|
|
77
|
+
export declare function replayOperations<T, A extends Action, L>(initialState: ExtendedState<T, L>, clearedOperations: DocumentOperations<A>, reducer: ImmutableStateReducer<T, A, L>, dispatch?: SignalDispatch, header?: DocumentHeader, documentReducer?: typeof baseReducer, skipHeaderOperations?: SkipHeaderOperations, options?: ReducerOptions): Document<T, A, L>;
|
|
80
78
|
export type SkipHeaderOperations = Partial<Record<OperationScope, number>>;
|
|
81
79
|
export type ReplayDocumentOptions = {
|
|
82
80
|
checkHashes?: boolean;
|
|
81
|
+
reuseOperationResultingState?: boolean;
|
|
82
|
+
operationResultingStateParser?: (state: unknown) => object;
|
|
83
83
|
};
|
|
84
84
|
export declare function replayDocument<T, A extends Action, L>(initialState: ExtendedState<T, L>, operations: DocumentOperations<A>, reducer: Reducer<T, A, L>, dispatch?: SignalDispatch, header?: DocumentHeader, skipHeaderOperations?: SkipHeaderOperations, options?: ReplayDocumentOptions): Document<T, A, L>;
|
|
85
85
|
export declare function isSameDocument(documentA: Document, documentB: Document): boolean;
|
|
86
|
+
export declare function parseResultingState(state: unknown): object;
|
|
@@ -49,5 +49,5 @@ export type SkipHeaderOperationIndex = Partial<Pick<OperationIndex, 'index'>> &
|
|
|
49
49
|
* @returns The remaining operations after skipping header operations.
|
|
50
50
|
*/
|
|
51
51
|
export declare function skipHeaderOperations<A extends OperationIndex>(operations: A[], skipHeaderOperation: SkipHeaderOperationIndex): A[];
|
|
52
|
-
export declare function
|
|
52
|
+
export declare function garbageCollectDocumentOperations<A extends Action>(documentOperations: DocumentOperations<A>): DocumentOperations<A>;
|
|
53
53
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './base';
|
|
2
|
-
export { createAction, createDocument, createExtendedState, createReducer, hashDocument, hashKey, isBaseAction, mapSkippedOperations, readOnly, replayDocument, replayOperations, sortMappedOperations, sortOperations, } from './base';
|
|
2
|
+
export { createAction, createDocument, createExtendedState, createReducer, hashDocument, hashKey, isBaseAction, mapSkippedOperations, parseResultingState, readOnly, replayDocument, replayOperations, sortMappedOperations, sortOperations, } from './base';
|
|
3
3
|
export * from './file';
|
|
4
4
|
export * from './validation';
|
|
5
5
|
export * as documentHelpers from './document-helpers';
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
require("./internal/object-D_9h7jBN.js");
|
|
4
|
-
require("immer");
|
|
5
|
-
require("jszip");
|
|
6
|
-
require("crypto");
|
|
7
|
-
require("fs");
|
|
8
|
-
require("https");
|
|
9
|
-
require("path");
|
|
10
|
-
const documentModel = require("./internal/index-ajqhOWQ1.js");
|
|
11
|
-
require("zod");
|
|
12
|
-
exports.Document = documentModel.Document;
|
|
13
|
-
exports.DocumentModel = documentModel.DocumentModel$1;
|
|
14
|
-
exports.actions = documentModel.actions;
|
|
15
|
-
exports.documentModel = documentModel.documentModel;
|
|
16
|
-
exports.module = documentModel.module;
|
|
17
|
-
exports.reducer = documentModel.reducer;
|
|
18
|
-
exports.utils = documentModel.utils;
|
|
19
|
-
exports.validateInitialState = documentModel.validateInitialState;
|
|
20
|
-
exports.validateModule = documentModel.validateModule;
|
|
21
|
-
exports.validateModuleOperation = documentModel.validateModuleOperation;
|
|
22
|
-
exports.validateModules = documentModel.validateModules;
|
|
23
|
-
exports.validateStateSchemaName = documentModel.validateStateSchemaName;
|
|
24
|
-
exports.z = documentModel.zod;
|
|
25
|
-
//# sourceMappingURL=document-model.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./internal/object-DhI24-1e.js");require("immer");require("jszip");require("crypto");require("fs");require("https");require("path");const e=require("./internal/index-CPeTtUsk.js");require("zod");exports.Document=e.Document;exports.DocumentModel=e.DocumentModel$1;exports.actions=e.actions;exports.documentModel=e.documentModel;exports.module=e.module;exports.reducer=e.reducer;exports.utils=e.utils;exports.validateInitialState=e.validateInitialState;exports.validateModule=e.validateModule;exports.validateModuleOperation=e.validateModuleOperation;exports.validateModules=e.validateModules;exports.validateStateSchemaName=e.validateStateSchemaName;exports.z=e.zod;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const object = require("./internal/object-D_9h7jBN.js");
|
|
4
|
-
const document = require("./internal/index-AqiVmL0w.js");
|
|
5
|
-
require("immer");
|
|
6
|
-
require("zod");
|
|
7
|
-
require("jszip");
|
|
8
|
-
require("crypto");
|
|
9
|
-
require("fs");
|
|
10
|
-
require("https");
|
|
11
|
-
require("path");
|
|
12
|
-
exports.BaseDocument = object.BaseDocument;
|
|
13
|
-
exports.actions = object.BaseActions;
|
|
14
|
-
exports.applyMixins = object.applyMixins;
|
|
15
|
-
exports.baseReducer = object.baseReducer;
|
|
16
|
-
exports.processUndoRedo = object.processUndoRedo;
|
|
17
|
-
exports.z = object.zod;
|
|
18
|
-
exports.utils = document.index;
|
|
19
|
-
//# sourceMappingURL=document.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./internal/object-DhI24-1e.js"),r=require("./internal/index-CTavCc1t.js");require("immer");require("zod");require("jszip");require("crypto");require("fs");require("https");require("path");exports.BaseDocument=e.BaseDocument;exports.actions=e.BaseActions;exports.applyMixins=e.applyMixins;exports.baseReducer=e.baseReducer;exports.processUndoRedo=e.processUndoRedo;exports.z=e.zod;exports.utils=r.index;
|
package/dist/node/cjs/index.js
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const document = require("./internal/index-AqiVmL0w.js");
|
|
4
|
-
const documentModel = require("./internal/index-ajqhOWQ1.js");
|
|
5
|
-
require("./internal/object-D_9h7jBN.js");
|
|
6
|
-
require("immer");
|
|
7
|
-
require("zod");
|
|
8
|
-
require("jszip");
|
|
9
|
-
require("crypto");
|
|
10
|
-
require("fs");
|
|
11
|
-
require("https");
|
|
12
|
-
require("path");
|
|
13
|
-
const DocumentModels = {
|
|
14
|
-
"powerhouse/document": document.Document,
|
|
15
|
-
"powerhouse/document-model": documentModel.DocumentModel
|
|
16
|
-
};
|
|
17
|
-
const index = { Document: document.Document, DocumentModel: documentModel.DocumentModel };
|
|
18
|
-
exports.Document = document.Document;
|
|
19
|
-
exports.DocumentModel = documentModel.DocumentModel;
|
|
20
|
-
exports.DocumentModels = DocumentModels;
|
|
21
|
-
exports.default = index;
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./internal/index-CTavCc1t.js"),o=require("./internal/index-CPeTtUsk.js");require("./internal/object-DhI24-1e.js");require("immer");require("zod");require("jszip");require("crypto");require("fs");require("https");require("path");const u={"powerhouse/document":e.Document,"powerhouse/document-model":o.DocumentModel},t={Document:e.Document,DocumentModel:o.DocumentModel};exports.Document=e.Document;exports.DocumentModel=o.DocumentModel;exports.DocumentModels=u;exports.default=t;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";var Tt=Object.defineProperty;var Rt=(t,e,r)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var be=(t,e,r)=>(Rt(t,typeof e!="symbol"?e+"":e,r),r);const s=require("./object-DhI24-1e.js");require("immer");require("jszip");require("crypto");require("fs");require("https");require("path");const o=require("zod"),xt=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Mt=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Dt=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),Nt=/[^\p{L}\d]+/giu,_e="$1\0$2",Ae="";function ze(t){let e=t.trim();e=e.replace(xt,_e).replace(Mt,_e),e=e.replace(Nt,"\0");let r=0,n=e.length;for(;e.charAt(r)==="\0";)r++;if(r===n)return[];for(;e.charAt(n-1)==="\0";)n--;return e.slice(r,n).split(/\0/g)}function Lt(t){const e=ze(t);for(let r=0;r<e.length;r++){const n=e[r],i=Dt.exec(n);if(i){const a=i.index+(i[1]??i[2]).length;e.splice(r,1,n.slice(0,a),n.slice(a))}}return e}function Ie(t,e){const[r,n,i]=wt(t,e),a=Pt(e==null?void 0:e.locale),l=jt(e==null?void 0:e.locale),d=e!=null&&e.mergeAmbiguousCharacters?Ct(a,l):yt(a,l);return r+n.map(d).join((e==null?void 0:e.delimiter)??"")+i}function Pt(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function jt(t){return t===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(t)}function Ct(t,e){return r=>`${e(r[0])}${t(r.slice(1))}`}function yt(t,e){return(r,n)=>{const i=r[0];return(n>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(r.slice(1))}}function wt(t,e={}){const r=e.split??(e.separateNumbers?Lt:ze),n=e.prefixCharacters??Ae,i=e.suffixCharacters??Ae;let a=0,l=t.length;for(;a<t.length;){const d=t.charAt(a);if(!n.includes(d))break;a++}for(;l>a;){const d=l-1,zt=t.charAt(d);if(!i.includes(zt))break;l=d}return[t.slice(0,a),r(t.slice(a,l)),t.slice(l)]}function T(t,e=!1){const r=[];if(e&&t==="")return r;try{const n=JSON.parse(t);!e&&!Object.keys(n).length&&r.push({message:"Initial state cannot be empty",details:{initialState:t}})}catch{r.push({message:"Invalid initial state",details:{initialState:t}})}return r}function R(t,e,r="",n=!0){const i=[];if(!n&&!t)return i.push({message:"State schema is required",details:{schema:t}}),i;if(n&&!t)return i;const a=`type ${Ie(e)}${Ie(r)}State`;return t.includes(a)||i.push({message:`Invalid state schema name. Expected ${a}`,details:{schema:t}}),i}function x(t){const e=[];t.length||e.push({message:"Modules are required",details:{modules:t}});const r=t.reduce((n,i)=>[...n,...b(i)],[]);return[...e,...r]}function b(t){const e=[];t.name||e.push({message:"Module name is required",details:{module:t}}),t.operations.length||e.push({message:"Module operations are required",details:{module:t}});const r=t.operations.reduce((n,i)=>[...n,..._(i)],[]);return[...e,...r]}function _(t){const e=[];return t.name||e.push({message:"Operation name is required",details:{operation:t}}),t.schema||e.push({message:"Operation schema is required",details:{operation:t}}),e}const kt=Object.freeze(Object.defineProperty({__proto__:null,validateInitialState:T,validateModule:b,validateModuleOperation:_,validateModules:x,validateStateSchemaName:R},Symbol.toStringTag,{value:"Module"})),M={id:"powerhouse/document-model",name:"DocumentModel",extension:"phdm",description:"The Powerhouse Document Model describes the state and operations of a document type.",author:{name:"Powerhouse",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],modules:[{name:"header",operations:[{name:"SetModelName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelId",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelExtension",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorWebsite",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"versioning",operations:[{name:"AddChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderChangeLogItems",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReleaseNewVersion",schema:null,id:"",description:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"module",operations:[{name:"AddModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModules",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-error",operations:[{name:"AddOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorCode",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationErrors",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-example",operations:[{name:"AddOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation",operations:[{name:"AddOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationReducer",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"MoveOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModuleOperations",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"state",operations:[{name:"SetStateSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetInitialState",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"AddStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderStateExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""}],state:{global:{schema:"",initialValue:`{
|
|
2
|
+
"id": "",
|
|
3
|
+
"name": "",
|
|
4
|
+
"extension": "",
|
|
5
|
+
"description": "",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "",
|
|
8
|
+
"website": ""
|
|
9
|
+
},
|
|
10
|
+
"specifications": [
|
|
11
|
+
{
|
|
12
|
+
"version": 1,
|
|
13
|
+
"changeLog": [],
|
|
14
|
+
"state": {
|
|
15
|
+
"schema": "",
|
|
16
|
+
"initialValue": "",
|
|
17
|
+
"examples": []
|
|
18
|
+
},
|
|
19
|
+
"modules": []
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}`,examples:[]},local:{schema:"",initialValue:"{}",examples:[]}}}]},Te=t=>t!=null,vt=o.z.any().refine(t=>Te(t));function D(){return o.z.object({__typename:o.z.literal("AddChangeLogItemInput").optional(),content:o.z.string(),id:o.z.string(),insertBefore:o.z.string().nullable()})}function N(){return o.z.object({description:o.z.string().nullish(),id:o.z.string(),name:o.z.string()})}function L(){return o.z.object({errorCode:o.z.string().nullish(),errorDescription:o.z.string().nullish(),errorName:o.z.string().nullish(),errorTemplate:o.z.string().nullish(),id:o.z.string(),operationId:o.z.string()})}function P(){return o.z.object({example:o.z.string(),id:o.z.string(),operationId:o.z.string()})}function j(){return o.z.object({description:o.z.string().nullish(),id:o.z.string(),moduleId:o.z.string(),name:o.z.string(),reducer:o.z.string().nullish(),schema:o.z.string().nullish(),template:o.z.string().nullish(),scope:A().nullish()})}function C(){return o.z.object({scope:o.z.string(),example:o.z.string(),id:o.z.string(),insertBefore:o.z.string().nullish()})}function Re(){return o.z.object({__typename:o.z.literal("Author").optional(),name:o.z.string(),website:o.z.string().nullable()})}function y(){return o.z.object({__typename:o.z.literal("CodeExample").optional(),id:o.z.string(),value:o.z.string()})}function w(){return o.z.object({__typename:o.z.literal("DeleteChangeLogItemInput").optional(),id:o.z.string()})}function k(){return o.z.object({id:o.z.string()})}function v(){return o.z.object({id:o.z.string()})}function U(){return o.z.object({id:o.z.string()})}function F(){return o.z.object({id:o.z.string()})}function $(){return o.z.object({scope:o.z.string(),id:o.z.string()})}function A(){return o.z.literal("global").or(o.z.literal("local"))}function Ut(){return o.z.union([D(),N(),L(),P(),j(),C(),w(),k(),v(),U(),F(),$(),V(),X(),H(),G(),B(),q(),W(),J(),K(),Q(),Y(),Z(),ee(),te(),re(),oe(),ne(),ie(),se(),ae(),pe(),le(),ce(),de(),ue(),me(),Ee(),he(),Oe()])}function Ft(){return o.z.object({__typename:o.z.literal("DocumentModelState").optional(),author:Re(),description:o.z.string(),extension:o.z.string(),id:o.z.string(),name:o.z.string(),specifications:o.z.array(xe())})}function xe(){return o.z.object({__typename:o.z.literal("DocumentSpecification").optional(),changeLog:o.z.array(o.z.string()),modules:o.z.array(Me()),state:Pe(),version:o.z.number()})}function Me(){return o.z.object({__typename:o.z.literal("Module").optional(),description:o.z.string().nullable(),id:o.z.string(),name:o.z.string(),operations:o.z.array(De())})}function V(){return o.z.object({newModuleId:o.z.string(),operationId:o.z.string()})}function De(){return o.z.object({__typename:o.z.literal("Operation").optional(),description:o.z.string().nullable(),errors:o.z.array(Ne()),examples:o.z.array(y()),id:o.z.string(),name:o.z.string().nullable(),reducer:o.z.string().nullable(),schema:o.z.string().nullable(),template:o.z.string().nullable(),scope:A()})}function Ne(){return o.z.object({__typename:o.z.literal("OperationError").optional(),code:o.z.string().nullable(),description:o.z.string().nullable(),id:o.z.string(),name:o.z.string().nullable(),template:o.z.string().nullable()})}function X(){return o.z.object({__typename:o.z.literal("ReorderChangeLogItemsInput").optional(),order:o.z.array(o.z.string())})}function H(){return o.z.object({moduleId:o.z.string(),order:o.z.array(o.z.string())})}function G(){return o.z.object({order:o.z.array(o.z.string())})}function B(){return o.z.object({operationId:o.z.string(),order:o.z.array(o.z.string())})}function q(){return o.z.object({operationId:o.z.string(),order:o.z.array(o.z.string())})}function W(){return o.z.object({scope:o.z.string(),order:o.z.array(o.z.string())})}function J(){return o.z.object({authorName:o.z.string()})}function K(){return o.z.object({authorWebsite:o.z.string()})}function Q(){return o.z.object({scope:o.z.string(),initialValue:o.z.string()})}function Y(){return o.z.object({description:o.z.string()})}function Z(){return o.z.object({extension:o.z.string()})}function ee(){return o.z.object({id:o.z.string()})}function te(){return o.z.object({name:o.z.string()})}function re(){return o.z.object({description:o.z.string().nullish(),id:o.z.string()})}function oe(){return o.z.object({id:o.z.string(),name:o.z.string().nullish()})}function ne(){return o.z.object({description:o.z.string().nullish(),id:o.z.string()})}function ie(){return o.z.object({errorCode:o.z.string().nullish(),id:o.z.string()})}function se(){return o.z.object({errorDescription:o.z.string().nullish(),id:o.z.string()})}function ae(){return o.z.object({errorName:o.z.string().nullish(),id:o.z.string()})}function pe(){return o.z.object({errorTemplate:o.z.string().nullish(),id:o.z.string()})}function le(){return o.z.object({id:o.z.string(),name:o.z.string().nullish()})}function Le(){return o.z.object({id:o.z.string(),scope:A()})}function ce(){return o.z.object({id:o.z.string(),reducer:o.z.string().nullish()})}function de(){return o.z.object({id:o.z.string(),schema:o.z.string().nullish()})}function ue(){return o.z.object({id:o.z.string(),template:o.z.string().nullish()})}function me(){return o.z.object({scope:o.z.string(),schema:o.z.string()})}function z(){return o.z.object({__typename:o.z.literal("State").optional(),examples:o.z.array(y()),initialValue:o.z.string(),schema:o.z.string()})}function Pe(){return o.z.object({global:z(),local:z()})}function Ee(){return o.z.object({__typename:o.z.literal("UpdateChangeLogItemInput").optional(),id:o.z.string(),newContent:o.z.string()})}function he(){return o.z.object({example:o.z.string(),id:o.z.string()})}function Oe(){return o.z.object({scope:o.z.string(),id:o.z.string(),newExample:o.z.string()})}const je=Object.freeze(Object.defineProperty({__proto__:null,AddChangeLogItemInputSchema:D,AddModuleInputSchema:N,AddOperationErrorInputSchema:L,AddOperationExampleInputSchema:P,AddOperationInputSchema:j,AddStateExampleInputSchema:C,AuthorSchema:Re,CodeExampleSchema:y,DeleteChangeLogItemInputSchema:w,DeleteModuleInputSchema:k,DeleteOperationErrorInputSchema:v,DeleteOperationExampleInputSchema:U,DeleteOperationInputSchema:F,DeleteStateExampleInputSchema:$,DocumentModelInputSchema:Ut,DocumentModelStateSchema:Ft,DocumentSpecificationSchema:xe,ModuleSchema:Me,MoveOperationInputSchema:V,OperationErrorSchema:Ne,OperationSchema:De,OperationScopeSchema:A,ReorderChangeLogItemsInputSchema:X,ReorderModuleOperationsInputSchema:H,ReorderModulesInputSchema:G,ReorderOperationErrorsInputSchema:B,ReorderOperationExamplesInputSchema:q,ReorderStateExamplesInputSchema:W,ScopeStateSchema:Pe,SetAuthorNameInputSchema:J,SetAuthorWebsiteInputSchema:K,SetInitialStateInputSchema:Q,SetModelDescriptionInputSchema:Y,SetModelExtensionInputSchema:Z,SetModelIdInputSchema:ee,SetModelNameInputSchema:te,SetModuleDescriptionInputSchema:re,SetModuleNameInputSchema:oe,SetOperationDescriptionInputSchema:ne,SetOperationErrorCodeInputSchema:ie,SetOperationErrorDescriptionInputSchema:se,SetOperationErrorNameInputSchema:ae,SetOperationErrorTemplateInputSchema:pe,SetOperationNameInputSchema:le,SetOperationReducerInputSchema:ce,SetOperationSchemaInputSchema:de,SetOperationScopeInputSchema:Le,SetOperationTemplateInputSchema:ue,SetStateSchemaInputSchema:me,StateSchema:z,UpdateChangeLogItemInputSchema:Ee,UpdateOperationExampleInputSchema:he,UpdateStateExampleInputSchema:Oe,definedNonNullAnySchema:vt,isDefinedNonNullAny:Te},Symbol.toStringTag,{value:"Module"})),u={setModelNameOperation(t,e){t.name=e.input.name},setModelIdOperation(t,e){t.id=e.input.id},setModelExtensionOperation(t,e){t.extension=e.input.extension},setModelDescriptionOperation(t,e){t.description=e.input.description},setAuthorNameOperation(t,e){t.author=t.author||{name:"",website:null},t.author.name=e.input.authorName},setAuthorWebsiteOperation(t,e){t.author=t.author||{name:"",website:null},t.author.website=e.input.authorWebsite}},O={addChangeLogItemOperation(t,e){throw new Error('Reducer "addChangeLogItemOperation" not yet implemented')},updateChangeLogItemOperation(t,e){throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented')},deleteChangeLogItemOperation(t,e){throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented')},reorderChangeLogItemsOperation(t,e){throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented')},releaseNewVersionOperation(t,e){throw new Error('Reducer "releaseNewVersionOperation" not yet implemented')}},$t=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},g={addModuleOperation(t,e){t.specifications[t.specifications.length-1].modules.push({id:e.input.id,name:e.input.name,description:e.input.description||"",operations:[]})},setModuleNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id===e.input.id&&(r.modules[n].name=e.input.name||"")},setModuleDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id===e.input.id&&(r.modules[n].description=e.input.description||"")},deleteModuleOperation(t,e){const r=t.specifications[t.specifications.length-1];r.modules=r.modules.filter(n=>n.id!=e.input.id)},reorderModulesOperation(t,e){t.specifications[t.specifications.length-1].modules.sort($t(e.input.order))}},Vt=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},c={addOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].errors.push({id:e.input.id,name:e.input.errorName||"",code:e.input.errorCode||"",description:e.input.errorDescription||"",template:e.input.errorTemplate||""})},setOperationErrorCodeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].code=e.input.errorCode||"")},setOperationErrorNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].name=e.input.errorName||"")},setOperationErrorDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].description=e.input.errorDescription||"")},setOperationErrorTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].errors.length;a++)r.modules[n].operations[i].errors[a].id==e.input.id&&(r.modules[n].operations[i].errors[a].template=e.input.errorTemplate||"")},deleteOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].errors=r.modules[n].operations[i].errors.filter(a=>a.id!=e.input.id)},reorderOperationErrorsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].errors.sort(Vt(e.input.order))}},Xt=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},f={addOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].examples.push({id:e.input.id,value:e.input.example})},updateOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)for(let a=0;a<r.modules[n].operations[i].examples.length;a++)r.modules[n].operations[i].examples[a].id==e.input.id&&(r.modules[n].operations[i].examples[a].value=e.input.example)},deleteOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].examples=r.modules[n].operations[i].examples.filter(a=>a.id!=e.input.id)},reorderOperationExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.operationId&&r.modules[n].operations[i].examples.sort(Xt(e.input.order))}},Ht=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},p={addOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id==e.input.moduleId&&r.modules[n].operations.push({id:e.input.id,name:e.input.name,description:e.input.description||"",schema:e.input.schema||"",template:e.input.template||e.input.description||"",reducer:e.input.reducer||"",errors:[],examples:[],scope:e.input.scope||"global"})},setOperationNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].name=e.input.name||"")},setOperationScopeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].scope=e.input.scope||"global")},setOperationSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].schema=e.input.schema||"")},setOperationDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].description=e.input.description||"")},setOperationTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].template=e.input.template||"")},setOperationReducerOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)for(let i=0;i<r.modules[n].operations.length;i++)r.modules[n].operations[i].id==e.input.id&&(r.modules[n].operations[i].reducer=e.input.reducer||"")},moveOperationOperation(t,e){const r=[],n=t.specifications[t.specifications.length-1];for(let i=0;i<n.modules.length;i++)n.modules[i].operations=n.modules[i].operations.filter(a=>a.id==e.input.operationId?(r.push(a),!1):!0);for(let i=0;i<n.modules.length;i++)n.modules[i].id==e.input.newModuleId&&n.modules[i].operations.push(...r)},deleteOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].operations=r.modules[n].operations.filter(i=>i.id!=e.input.id)},reorderModuleOperationsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let n=0;n<r.modules.length;n++)r.modules[n].id==e.input.moduleId&&r.modules[n].operations.sort(Ht(e.input.order))}},Gt=t=>{const e={};return t.forEach((r,n)=>e[r]=n),(r,n)=>(e[n.id]||999999)-(e[r.id]||999999)},m={setStateSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].schema=e.input.schema;else throw new Error(`Invalid scope: ${e.input.scope}`)},setInitialStateOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].initialValue=e.input.initialValue;else throw new Error(`Invalid scope: ${e.input.scope}`)},addStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.push({id:e.input.id,value:e.input.example});else throw new Error(`Invalid scope: ${e.input.scope}`)},updateStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(!Object.keys(r.state).includes(e.input.scope))throw new Error(`Invalid scope: ${e.input.scope}`);const n=r.state[e.input.scope].examples;for(let i=0;i<n.length;i++)n[i].id==e.input.id&&(n[i].value=e.input.newExample)},deleteStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples=r.state[e.input.scope].examples.filter(n=>n.id!=e.input.id);else throw new Error(`Invalid scope: ${e.input.scope}`)},reorderStateExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.sort(Gt(e.input.order));else throw new Error(`Invalid scope: ${e.input.scope}`)}},Bt=(t,e)=>{if(s.isBaseAction(e))return t;switch(e.type){case"SET_MODEL_NAME":te().parse(e.input),u.setModelNameOperation(t.global,e);break;case"SET_MODEL_ID":ee().parse(e.input),u.setModelIdOperation(t.global,e);break;case"SET_MODEL_EXTENSION":Z().parse(e.input),u.setModelExtensionOperation(t.global,e);break;case"SET_MODEL_DESCRIPTION":Y().parse(e.input),u.setModelDescriptionOperation(t.global,e);break;case"SET_AUTHOR_NAME":J().parse(e.input),u.setAuthorNameOperation(t.global,e);break;case"SET_AUTHOR_WEBSITE":K().parse(e.input),u.setAuthorWebsiteOperation(t.global,e);break;case"ADD_CHANGE_LOG_ITEM":D().parse(e.input),O.addChangeLogItemOperation(t.global,e);break;case"UPDATE_CHANGE_LOG_ITEM":Ee().parse(e.input),O.updateChangeLogItemOperation(t.global,e);break;case"DELETE_CHANGE_LOG_ITEM":w().parse(e.input),O.deleteChangeLogItemOperation(t.global,e);break;case"REORDER_CHANGE_LOG_ITEMS":X().parse(e.input),O.reorderChangeLogItemsOperation(t.global,e);break;case"RELEASE_NEW_VERSION":if(Object.keys(e.input).length>0)throw new Error("Expected empty input for action RELEASE_NEW_VERSION");O.releaseNewVersionOperation(t.global,e);break;case"ADD_MODULE":N().parse(e.input),g.addModuleOperation(t.global,e);break;case"SET_MODULE_NAME":oe().parse(e.input),g.setModuleNameOperation(t.global,e);break;case"SET_MODULE_DESCRIPTION":re().parse(e.input),g.setModuleDescriptionOperation(t.global,e);break;case"DELETE_MODULE":k().parse(e.input),g.deleteModuleOperation(t.global,e);break;case"REORDER_MODULES":G().parse(e.input),g.reorderModulesOperation(t.global,e);break;case"ADD_OPERATION_ERROR":L().parse(e.input),c.addOperationErrorOperation(t.global,e);break;case"SET_OPERATION_ERROR_CODE":ie().parse(e.input),c.setOperationErrorCodeOperation(t.global,e);break;case"SET_OPERATION_ERROR_NAME":ae().parse(e.input),c.setOperationErrorNameOperation(t.global,e);break;case"SET_OPERATION_ERROR_DESCRIPTION":se().parse(e.input),c.setOperationErrorDescriptionOperation(t.global,e);break;case"SET_OPERATION_ERROR_TEMPLATE":pe().parse(e.input),c.setOperationErrorTemplateOperation(t.global,e);break;case"DELETE_OPERATION_ERROR":v().parse(e.input),c.deleteOperationErrorOperation(t.global,e);break;case"REORDER_OPERATION_ERRORS":B().parse(e.input),c.reorderOperationErrorsOperation(t.global,e);break;case"ADD_OPERATION_EXAMPLE":P().parse(e.input),f.addOperationExampleOperation(t.global,e);break;case"UPDATE_OPERATION_EXAMPLE":he().parse(e.input),f.updateOperationExampleOperation(t.global,e);break;case"DELETE_OPERATION_EXAMPLE":U().parse(e.input),f.deleteOperationExampleOperation(t.global,e);break;case"REORDER_OPERATION_EXAMPLES":q().parse(e.input),f.reorderOperationExamplesOperation(t.global,e);break;case"ADD_OPERATION":j().parse(e.input),p.addOperationOperation(t.global,e);break;case"SET_OPERATION_NAME":le().parse(e.input),p.setOperationNameOperation(t.global,e);break;case"SET_OPERATION_SCOPE":Le().parse(e.input),p.setOperationScopeOperation(t.global,e);break;case"SET_OPERATION_SCHEMA":de().parse(e.input),p.setOperationSchemaOperation(t.global,e);break;case"SET_OPERATION_DESCRIPTION":ne().parse(e.input),p.setOperationDescriptionOperation(t.global,e);break;case"SET_OPERATION_TEMPLATE":ue().parse(e.input),p.setOperationTemplateOperation(t.global,e);break;case"SET_OPERATION_REDUCER":ce().parse(e.input),p.setOperationReducerOperation(t.global,e);break;case"MOVE_OPERATION":V().parse(e.input),p.moveOperationOperation(t.global,e);break;case"DELETE_OPERATION":F().parse(e.input),p.deleteOperationOperation(t.global,e);break;case"REORDER_MODULE_OPERATIONS":H().parse(e.input),p.reorderModuleOperationsOperation(t.global,e);break;case"SET_STATE_SCHEMA":me().parse(e.input),m.setStateSchemaOperation(t.global,e);break;case"SET_INITIAL_STATE":Q().parse(e.input),m.setInitialStateOperation(t.global,e);break;case"ADD_STATE_EXAMPLE":C().parse(e.input),m.addStateExampleOperation(t.global,e);break;case"UPDATE_STATE_EXAMPLE":Oe().parse(e.input),m.updateStateExampleOperation(t.global,e);break;case"DELETE_STATE_EXAMPLE":$().parse(e.input),m.deleteStateExampleOperation(t.global,e);break;case"REORDER_STATE_EXAMPLES":W().parse(e.input),m.reorderStateExamplesOperation(t.global,e);break;default:return t}},h=s.createReducer(Bt),qt={id:"",name:"",extension:"",description:"",author:{name:"",website:""},specifications:[{version:1,changeLog:[],state:{global:{schema:"",initialValue:"",examples:[]},local:{schema:"",initialValue:"",examples:[]}},modules:[]}]},Wt={},S={fileExtension:"phdm",createState(t){return{global:{...qt,...t==null?void 0:t.global},local:{...Wt,...t==null?void 0:t.local}}},createExtendedState(t){return s.createExtendedState({...t,documentType:"powerhouse/document-model"},S.createState)},createDocument(t){return s.createDocument(S.createExtendedState(t),S.createState)},saveToFile(t,e,r){return s.saveToFile(t,e,"phdm",r)},saveToFileHandle(t,e){return s.saveToFileHandle(t,e)},loadFromFile(t){return s.loadFromFile(t,h)},loadFromInput(t){return s.loadFromInput(t,h)}},Ce=t=>s.createAction("SET_MODEL_NAME",{...t}),ye=t=>s.createAction("SET_MODEL_ID",{...t}),we=t=>s.createAction("SET_MODEL_EXTENSION",{...t}),ke=t=>s.createAction("SET_MODEL_DESCRIPTION",{...t}),ve=t=>s.createAction("SET_AUTHOR_NAME",{...t}),Ue=t=>s.createAction("SET_AUTHOR_WEBSITE",{...t});class Jt extends s.BaseDocument{setModelName(e,r){return this.dispatch(Ce(e),r)}setModelId(e,r){return this.dispatch(ye(e),r)}setModelExtension(e,r){return this.dispatch(we(e),r)}setModelDescription(e,r){return this.dispatch(ke(e),r)}setAuthorName(e,r){return this.dispatch(ve(e),r)}setAuthorWebsite(e,r){return this.dispatch(Ue(e),r)}}const Fe=t=>s.createAction("ADD_CHANGE_LOG_ITEM",{...t}),$e=t=>s.createAction("UPDATE_CHANGE_LOG_ITEM",{...t}),Ve=t=>s.createAction("DELETE_CHANGE_LOG_ITEM",{...t}),Xe=t=>s.createAction("REORDER_CHANGE_LOG_ITEMS",{...t}),He=()=>s.createAction("RELEASE_NEW_VERSION");class Kt extends s.BaseDocument{addChangeLogItem(e,r){return this.dispatch(Fe(e),r)}updateChangeLogItem(e,r){return this.dispatch($e(e),r)}deleteChangeLogItem(e,r){return this.dispatch(Ve(e),r)}reorderChangeLogItems(e,r){return this.dispatch(Xe(e),r)}releaseNewVersion(e){return this.dispatch(He(),e)}}const Ge=t=>s.createAction("ADD_MODULE",{...t}),Be=t=>s.createAction("SET_MODULE_NAME",{...t}),qe=t=>s.createAction("SET_MODULE_DESCRIPTION",{...t}),We=t=>s.createAction("DELETE_MODULE",{...t}),Je=t=>s.createAction("REORDER_MODULES",{...t});class Qt extends s.BaseDocument{addModule(e,r){return this.dispatch(Ge(e),r)}setModuleName(e,r){return this.dispatch(Be(e),r)}setModuleDescription(e,r){return this.dispatch(qe(e),r)}deleteModule(e,r){return this.dispatch(We(e),r)}reorderModules(e,r){return this.dispatch(Je(e),r)}}const Ke=t=>s.createAction("ADD_OPERATION_ERROR",{...t}),Qe=t=>s.createAction("SET_OPERATION_ERROR_CODE",{...t}),Ye=t=>s.createAction("SET_OPERATION_ERROR_NAME",{...t}),Ze=t=>s.createAction("SET_OPERATION_ERROR_DESCRIPTION",{...t}),et=t=>s.createAction("SET_OPERATION_ERROR_TEMPLATE",{...t}),tt=t=>s.createAction("DELETE_OPERATION_ERROR",{...t}),rt=t=>s.createAction("REORDER_OPERATION_ERRORS",{...t});class Yt extends s.BaseDocument{addOperationError(e,r){return this.dispatch(Ke(e),r)}setOperationErrorCode(e,r){return this.dispatch(Qe(e),r)}setOperationErrorName(e,r){return this.dispatch(Ye(e),r)}setOperationErrorDescription(e,r){return this.dispatch(Ze(e),r)}setOperationErrorTemplate(e,r){return this.dispatch(et(e),r)}deleteOperationError(e,r){return this.dispatch(tt(e),r)}reorderOperationErrors(e,r){return this.dispatch(rt(e),r)}}const ot=t=>s.createAction("ADD_OPERATION_EXAMPLE",{...t}),nt=t=>s.createAction("UPDATE_OPERATION_EXAMPLE",{...t}),it=t=>s.createAction("DELETE_OPERATION_EXAMPLE",{...t}),st=t=>s.createAction("REORDER_OPERATION_EXAMPLES",{...t});class Zt extends s.BaseDocument{addOperationExample(e,r){return this.dispatch(ot(e),r)}updateOperationExample(e,r){return this.dispatch(nt(e),r)}deleteOperationExample(e,r){return this.dispatch(it(e),r)}reorderOperationExamples(e,r){return this.dispatch(st(e),r)}}const at=t=>s.createAction("ADD_OPERATION",{...t}),pt=t=>s.createAction("SET_OPERATION_NAME",{...t}),lt=t=>s.createAction("SET_OPERATION_SCOPE",{...t}),ct=t=>s.createAction("SET_OPERATION_SCHEMA",{...t}),dt=t=>s.createAction("SET_OPERATION_DESCRIPTION",{...t}),ut=t=>s.createAction("SET_OPERATION_TEMPLATE",{...t}),mt=t=>s.createAction("SET_OPERATION_REDUCER",{...t}),Et=t=>s.createAction("MOVE_OPERATION",{...t}),ht=t=>s.createAction("DELETE_OPERATION",{...t}),Ot=t=>s.createAction("REORDER_MODULE_OPERATIONS",{...t});class er extends s.BaseDocument{addOperation(e,r){return this.dispatch(at(e),r)}setOperationName(e,r){return this.dispatch(pt(e),r)}setOperationScope(e,r){return this.dispatch(lt(e),r)}setOperationSchema(e,r){return this.dispatch(ct(e),r)}setOperationDescription(e,r){return this.dispatch(dt(e),r)}setOperationTemplate(e,r){return this.dispatch(ut(e),r)}setOperationReducer(e,r){return this.dispatch(mt(e),r)}moveOperation(e,r){return this.dispatch(Et(e),r)}deleteOperation(e,r){return this.dispatch(ht(e),r)}reorderModuleOperations(e,r){return this.dispatch(Ot(e),r)}}const gt=t=>s.createAction("SET_STATE_SCHEMA",{...t}),St=t=>s.createAction("SET_INITIAL_STATE",{...t}),ft=t=>s.createAction("ADD_STATE_EXAMPLE",{...t}),bt=t=>s.createAction("UPDATE_STATE_EXAMPLE",{...t}),_t=t=>s.createAction("DELETE_STATE_EXAMPLE",{...t}),At=t=>s.createAction("REORDER_STATE_EXAMPLES",{...t});class tr extends s.BaseDocument{setStateSchema(e,r){return this.dispatch(gt(e),r)}setInitialState(e,r){return this.dispatch(St(e),r)}addStateExample(e,r){return this.dispatch(ft(e),r)}updateStateExample(e,r){return this.dispatch(bt(e),r)}deleteStateExample(e,r){return this.dispatch(_t(e),r)}reorderStateExamples(e,r){return this.dispatch(At(e),r)}}var E;let I=(E=class extends s.BaseDocument{constructor(e,r){super(h,S.createDocument(e),r)}saveToFile(e,r){return super.saveToFile(e,E.fileExtension,r)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const r=new this;return await r.loadFromFile(e),r}},be(E,"fileExtension","phdm"),E);s.applyMixins(I,[Jt,Kt,Qt,Yt,Zt,er,tr]);const rr=Object.freeze(Object.defineProperty({__proto__:null,addChangeLogItem:Fe,addModule:Ge,addOperation:at,addOperationError:Ke,addOperationExample:ot,addStateExample:ft,deleteChangeLogItem:Ve,deleteModule:We,deleteOperation:ht,deleteOperationError:tt,deleteOperationExample:it,deleteStateExample:_t,moveOperation:Et,releaseNewVersion:He,reorderChangeLogItems:Xe,reorderModuleOperations:Ot,reorderModules:Je,reorderOperationErrors:rt,reorderOperationExamples:st,reorderStateExamples:At,setAuthorName:ve,setAuthorWebsite:Ue,setInitialState:St,setModelDescription:ke,setModelExtension:we,setModelId:ye,setModelName:Ce,setModuleDescription:qe,setModuleName:Be,setOperationDescription:dt,setOperationErrorCode:Qe,setOperationErrorDescription:Ze,setOperationErrorName:Ye,setOperationErrorTemplate:et,setOperationName:pt,setOperationReducer:mt,setOperationSchema:ct,setOperationScope:lt,setOperationTemplate:ut,setStateSchema:gt,updateChangeLogItem:$e,updateOperationExample:nt,updateStateExample:bt},Symbol.toStringTag,{value:"Module"})),ge=I,Se={...S,...kt},fe={...s.BaseActions,...rr},It={Document:ge,reducer:h,actions:fe,utils:Se,documentModel:M},or=Object.freeze(Object.defineProperty({__proto__:null,Document:ge,DocumentModel:I,actions:fe,documentModel:M,module:It,reducer:h,utils:Se,validateInitialState:T,validateModule:b,validateModuleOperation:_,validateModules:x,validateStateSchemaName:R,z:je},Symbol.toStringTag,{value:"Module"}));exports.Document=ge;exports.DocumentModel=or;exports.DocumentModel$1=I;exports.actions=fe;exports.documentModel=M;exports.module=It;exports.reducer=h;exports.utils=Se;exports.validateInitialState=T;exports.validateModule=b;exports.validateModuleOperation=_;exports.validateModules=x;exports.validateStateSchemaName=R;exports.zod=je;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./object-DhI24-1e.js"),t=Object.freeze(Object.defineProperty({__proto__:null,calculateSkipsLeft:e.calculateSkipsLeft,createAction:e.createAction,createDocument:e.createDocument,createExtendedState:e.createExtendedState,createReducer:e.createReducer,createZip:e.createZip,documentHelpers:e.documentHelpers,getLocalFile:e.getLocalFile,getRemoteFile:e.getRemoteFile,hashDocument:e.hashDocument,hashKey:e.hashKey,isBaseAction:e.isBaseAction,isNoopOperation:e.isNoopOperation,isSameDocument:e.isSameDocument,isUndoRedo:e.isUndoRedo,loadFromFile:e.loadFromFile,loadFromInput:e.loadFromInput,mapSkippedOperations:e.mapSkippedOperations,parseResultingState:e.parseResultingState,readOnly:e.readOnly,replayDocument:e.replayDocument,replayOperations:e.replayOperations,saveToFile:e.saveToFile,saveToFileHandle:e.saveToFileHandle,sortMappedOperations:e.sortMappedOperations,sortOperations:e.sortOperations,validateOperations:e.validateOperations},Symbol.toStringTag,{value:"Module"})),o=Object.freeze(Object.defineProperty({__proto__:null,BaseDocument:e.BaseDocument,actions:e.BaseActions,applyMixins:e.applyMixins,baseReducer:e.baseReducer,processUndoRedo:e.processUndoRedo,utils:t,z:e.zod},Symbol.toStringTag,{value:"Module"}));exports.Document=o;exports.index=t;
|