@fmfi-uk-1-ain-412/structure-explorer 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/AppComponent.d.ts +1 -1
  2. package/dist/app/store.d.ts +4 -0
  3. package/dist/common/formulas.d.ts +19 -0
  4. package/dist/common/utils.d.ts +18 -0
  5. package/dist/components_helper/TooltipButton.d.ts +1 -2
  6. package/dist/components_helper/bubbles/ChoiceBubble.d.ts +10 -0
  7. package/dist/components_helper/bubbles/MessageBubble.d.ts +12 -0
  8. package/dist/components_helper/bubbles/SelectBubble.d.ts +10 -0
  9. package/dist/features/caseTreeView/CaseTreeView.d.ts +7 -0
  10. package/dist/features/caseTreeView/caseTreeViewSlice.d.ts +159 -0
  11. package/dist/features/caseTreeView/helpers.d.ts +45 -0
  12. package/dist/features/caseTreeView/validationSchema.d.ts +26 -0
  13. package/dist/features/databaseView/databaseViewSlice.d.ts +1 -0
  14. package/dist/features/editorToolbar/editorToolbarSlice.d.ts +13 -2
  15. package/dist/features/editorToolbar/validationSchema.d.ts +2 -1
  16. package/dist/features/formulas/formulasSlice.d.ts +1470 -1268
  17. package/dist/features/formulas/validationSchema.d.ts +1 -1
  18. package/dist/features/game/BubbleList.d.ts +4 -0
  19. package/dist/features/game/GameControls.d.ts +2 -3
  20. package/dist/features/game/GameHistory.d.ts +9 -1
  21. package/dist/features/game/messageBubbleFactories.d.ts +10 -0
  22. package/dist/features/graphView/graphs/graphSlice.d.ts +9 -0
  23. package/dist/features/graphView/graphs/listeners.d.ts +2 -0
  24. package/dist/features/import/validationSchema.d.ts +25 -1
  25. package/dist/features/language/languageSlice.d.ts +19 -0
  26. package/dist/features/matrixView/matrixViewSelectors.d.ts +1 -0
  27. package/dist/features/queries/listeners.d.ts +2 -0
  28. package/dist/features/queries/queriesSlice.d.ts +42 -0
  29. package/dist/features/structure/InterpretationEditor.d.ts +1 -1
  30. package/dist/features/structure/structureSlice.d.ts +24 -0
  31. package/dist/features/textView/textViewSlice.d.ts +1 -0
  32. package/dist/features/variables/variablesSlice.d.ts +5 -0
  33. package/dist/main.d.ts +0 -6
  34. package/dist/model/formula/Formula.d.ts +1 -1
  35. package/dist/model/formula/QuantifiedFormula.d.ts +1 -1
  36. package/dist/model/term/Term.Constant.d.ts +2 -3
  37. package/dist/model/term/Term.Variable.d.ts +1 -1
  38. package/dist/structure-explorer.css +1 -1
  39. package/dist/structure-explorer.es.js +38774 -37868
  40. package/dist/structure-explorer.umd.js +76 -73
  41. package/package.json +1 -1
  42. package/dist/components_helper/ChoiceBubble.d.ts +0 -8
  43. package/dist/components_helper/MessageBubble.d.ts +0 -14
  44. package/dist/components_helper/SelectBubble.d.ts +0 -10
@@ -3,7 +3,7 @@ interface PrepareResult {
3
3
  instance: any;
4
4
  getState: (instance: any) => any;
5
5
  }
6
- export declare function prepare(initialState?: any): PrepareResult;
6
+ declare function prepare(initialState?: any): PrepareResult;
7
7
  interface AppComponentProps {
8
8
  instance: any;
9
9
  onStateChange: () => void;
@@ -9,6 +9,7 @@ declare const rootReducer: {
9
9
  graphView: import('redux').Reducer<import('../features/graphView/graphs/graphSlice').GraphManagerState>;
10
10
  textView: import('redux').Reducer<import('../features/textView/textViewSlice').TextViewState>;
11
11
  databaseView: import('redux').Reducer<import('../features/databaseView/databaseViewSlice.ts').DatabaseViewState>;
12
+ caseTreeView: import('redux').Reducer<import('../features/caseTreeView/caseTreeViewSlice.ts').CaseTreeState>;
12
13
  editorToolbar: import('redux').Reducer<import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState>;
13
14
  errorAlert: import('redux').Reducer<import('../features/errorAlert/errorAlertSlice.ts').ErrorState>;
14
15
  };
@@ -22,6 +23,7 @@ declare const undoReducer: import('redux').Reducer<import('redux-undo').StateWit
22
23
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
23
24
  textView: import('../features/textView/textViewSlice').TextViewState;
24
25
  databaseView: import('../features/databaseView/databaseViewSlice.ts').DatabaseViewState;
26
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice.ts').CaseTreeState;
25
27
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
26
28
  errorAlert: import('../features/errorAlert/errorAlertSlice.ts').ErrorState;
27
29
  }>, import('redux').UnknownAction>;
@@ -35,6 +37,7 @@ export declare const createStore: (extraMiddleware?: Middleware) => import('@red
35
37
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
36
38
  textView: import('../features/textView/textViewSlice').TextViewState;
37
39
  databaseView: import('../features/databaseView/databaseViewSlice.ts').DatabaseViewState;
40
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice.ts').CaseTreeState;
38
41
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
39
42
  errorAlert: import('../features/errorAlert/errorAlertSlice.ts').ErrorState;
40
43
  }>, import('redux').UnknownAction, import('@reduxjs/toolkit').Tuple<[import('redux').StoreEnhancer<{
@@ -48,6 +51,7 @@ export declare const createStore: (extraMiddleware?: Middleware) => import('@red
48
51
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
49
52
  textView: import('../features/textView/textViewSlice').TextViewState;
50
53
  databaseView: import('../features/databaseView/databaseViewSlice.ts').DatabaseViewState;
54
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice.ts').CaseTreeState;
51
55
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
52
56
  errorAlert: import('../features/errorAlert/errorAlertSlice.ts').ErrorState;
53
57
  }>, undefined, import('redux').UnknownAction>;
@@ -44,6 +44,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
44
44
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
45
45
  textView: import('../features/textView/textViewSlice').TextViewState;
46
46
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
47
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
47
48
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
48
49
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
49
50
  }>) => string) & {
@@ -68,6 +69,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
68
69
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
69
70
  textView: import('../features/textView/textViewSlice').TextViewState;
70
71
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
72
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
71
73
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
72
74
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
73
75
  }>) => import('./errors').ValidationError | import('./errors').SemanticError | undefined) & {
@@ -85,6 +87,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
85
87
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
86
88
  textView: import('../features/textView/textViewSlice').TextViewState;
87
89
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
90
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
88
91
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
89
92
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
90
93
  }>, resultFuncArgs_1: import('./redux').Validated<Set<string>>, resultFuncArgs_2: import('./redux').Validated<Map<string, number>>, resultFuncArgs_3: import('./redux').Validated<Map<string, number>>, resultFuncArgs_4: import('./redux').Validated<string[]>) => import('./errors').ValidationError | import('./errors').SemanticError | undefined;
@@ -98,6 +101,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
98
101
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
99
102
  textView: import('../features/textView/textViewSlice').TextViewState;
100
103
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
104
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
101
105
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
102
106
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
103
107
  }>, resultFuncArgs_1: import('./redux').Validated<Set<string>>, resultFuncArgs_2: import('./redux').Validated<Map<string, number>>, resultFuncArgs_3: import('./redux').Validated<Map<string, number>>, resultFuncArgs_4: import('./redux').Validated<string[]>) => import('./errors').ValidationError | import('./errors').SemanticError | undefined) & {
@@ -116,6 +120,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
116
120
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
117
121
  textView: import('../features/textView/textViewSlice').TextViewState;
118
122
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
123
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
119
124
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
120
125
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
121
126
  }>, ((state: import('redux-undo').StateWithHistory<{
@@ -128,6 +133,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
128
133
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
129
134
  textView: import('../features/textView/textViewSlice').TextViewState;
130
135
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
136
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
131
137
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
132
138
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
133
139
  }>) => import('./redux').Validated<Set<string>>) & {
@@ -160,6 +166,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
160
166
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
161
167
  textView: import('../features/textView/textViewSlice').TextViewState;
162
168
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
169
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
163
170
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
164
171
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
165
172
  }>) => import('./redux').Validated<Map<string, number>>) & {
@@ -192,6 +199,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
192
199
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
193
200
  textView: import('../features/textView/textViewSlice').TextViewState;
194
201
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
202
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
195
203
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
196
204
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
197
205
  }>) => import('./redux').Validated<Map<string, number>>) & {
@@ -224,6 +232,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
224
232
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
225
233
  textView: import('../features/textView/textViewSlice').TextViewState;
226
234
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
235
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
227
236
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
228
237
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
229
238
  }>) => import('./redux').Validated<string[]>) & {
@@ -264,6 +273,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
264
273
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
265
274
  textView: import('../features/textView/textViewSlice').TextViewState;
266
275
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
276
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
267
277
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
268
278
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
269
279
  }>) => import('./errors').ValidationError | undefined) & {
@@ -288,6 +298,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
288
298
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
289
299
  textView: import('../features/textView/textViewSlice').TextViewState;
290
300
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
301
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
291
302
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
292
303
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
293
304
  }>) => import('./redux').Validated<Set<string>>) & {
@@ -320,6 +331,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
320
331
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
321
332
  textView: import('../features/textView/textViewSlice').TextViewState;
322
333
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
334
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
323
335
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
324
336
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
325
337
  }>) => import('./redux').Validated<Map<string, number>>) & {
@@ -352,6 +364,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
352
364
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
353
365
  textView: import('../features/textView/textViewSlice').TextViewState;
354
366
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
367
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
355
368
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
356
369
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
357
370
  }>) => import('./redux').Validated<Map<string, number>>) & {
@@ -384,6 +397,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
384
397
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
385
398
  textView: import('../features/textView/textViewSlice').TextViewState;
386
399
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
400
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
387
401
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
388
402
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
389
403
  }>) => "" | undefined) & {
@@ -408,6 +422,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
408
422
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
409
423
  textView: import('../features/textView/textViewSlice').TextViewState;
410
424
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
425
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
411
426
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
412
427
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
413
428
  }>) => import('./redux').Validated<Set<string>>) & {
@@ -440,6 +455,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
440
455
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
441
456
  textView: import('../features/textView/textViewSlice').TextViewState;
442
457
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
458
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
443
459
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
444
460
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
445
461
  }>) => import('./redux').Validated<Map<string, number>>) & {
@@ -472,6 +488,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
472
488
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
473
489
  textView: import('../features/textView/textViewSlice').TextViewState;
474
490
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
491
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
475
492
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
476
493
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
477
494
  }>) => import('./redux').Validated<Map<string, number>>) & {
@@ -520,6 +537,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
520
537
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
521
538
  textView: import('../features/textView/textViewSlice').TextViewState;
522
539
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
540
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
523
541
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
524
542
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
525
543
  }>) => import('./redux').Validated<import('../features/variables/variablesSlice').VariableRepresentation[]>) & {
@@ -544,6 +562,7 @@ export declare const selectNonFormulaValidationError: ((state: import('redux-und
544
562
  graphView: import('../features/graphView/graphs/graphSlice').GraphManagerState;
545
563
  textView: import('../features/textView/textViewSlice').TextViewState;
546
564
  databaseView: import('../features/databaseView/databaseViewSlice').DatabaseViewState;
565
+ caseTreeView: import('../features/caseTreeView/caseTreeViewSlice').CaseTreeState;
547
566
  editorToolbar: import('../features/editorToolbar/editorToolbarSlice').EditorToolbarState;
548
567
  errorAlert: import('../features/errorAlert/errorAlertSlice').ErrorState;
549
568
  }>) => import('./redux').Validated<string[]>) & {
@@ -0,0 +1,18 @@
1
+ import { default as Formula } from '../model/formula/Formula';
2
+ export declare function getRandomElement<T>(arr: T[]): T;
3
+ export declare function latex(parts?: string[]): {
4
+ M: () => /*elided*/ any;
5
+ models: (m: boolean) => /*elided*/ any;
6
+ formula: (f: Formula) => /*elided*/ any;
7
+ valuation: (vars?: string) => /*elided*/ any;
8
+ valuationPairs: (p: Map<string, string>) => string;
9
+ wildcardValuationPairs: (p: Map<string, string>, v: string) => string;
10
+ altValuation: (vars?: string) => /*elided*/ any;
11
+ rawValuation: (vars?: string) => /*elided*/ any;
12
+ text: (s: string) => /*elided*/ any;
13
+ escape: (s: string) => /*elided*/ any;
14
+ raw: (s: string) => /*elided*/ any;
15
+ sub: (s: string) => /*elided*/ any;
16
+ sup: (s: string) => /*elided*/ any;
17
+ get: () => string;
18
+ };
@@ -1,6 +1,5 @@
1
- import { ReactNode } from 'react';
2
1
  interface TooltipButtonProps {
3
- text: ReactNode;
2
+ text: React.ReactNode;
4
3
  }
5
4
  export default function TooltipButton({ text }: TooltipButtonProps): import("react/jsx-runtime").JSX.Element;
6
5
  export {};
@@ -0,0 +1,10 @@
1
+ export interface ChoiceBubble {
2
+ value: string;
3
+ onClick: () => void;
4
+ }
5
+ export interface ChoiceBubblesProps {
6
+ id: number;
7
+ type: string;
8
+ bubbles: ChoiceBubble[];
9
+ }
10
+ export default function ChoiceBubbles({ bubbles }: ChoiceBubblesProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ interface Props {
2
+ children: React.ReactNode;
3
+ sent?: boolean;
4
+ recieved?: boolean;
5
+ change?: boolean;
6
+ win?: boolean;
7
+ lose?: boolean;
8
+ fixableLoss?: boolean;
9
+ onClick?: () => void;
10
+ }
11
+ export default function MessageBubble({ children: message, sent, change, win, lose, onClick, fixableLoss, }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ import { ChoiceBubble } from './ChoiceBubble';
3
+ interface Props {
4
+ id: number;
5
+ title: ReactNode;
6
+ type: string;
7
+ bubbles: ChoiceBubble[];
8
+ }
9
+ export default function SelectBubble({ title, bubbles }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import { InterpretationError } from '../../common/errors';
2
+ export interface CaseTreeViewProps {
3
+ tupleName: string;
4
+ tupleArity: number;
5
+ setErrorOverride: (error: InterpretationError | null) => void;
6
+ }
7
+ export default function CaseTreeView({ tupleName, tupleArity, setErrorOverride, }: CaseTreeViewProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,159 @@
1
+ import { PayloadAction } from '@reduxjs/toolkit';
2
+ import { AppThunk, RootState } from '../../app/store';
3
+ import { SerializedCaseTreeViewState } from './validationSchema';
4
+ export type CaseTreeBranch = {
5
+ type: "value";
6
+ value: string;
7
+ } | {
8
+ type: "ref";
9
+ nodeId: string;
10
+ };
11
+ export interface CaseTreeCase {
12
+ match: string;
13
+ branch: CaseTreeBranch;
14
+ }
15
+ export interface CaseTreeNode {
16
+ variable: string;
17
+ cases: CaseTreeCase[];
18
+ default?: CaseTreeBranch;
19
+ }
20
+ export interface CaseTreeEntry {
21
+ rootId: string;
22
+ nodes: Record<string, CaseTreeNode>;
23
+ }
24
+ export type CaseTreeState = Record<string, CaseTreeEntry>;
25
+ type WithCaseTreeId<T = object> = {
26
+ tupleName: string;
27
+ } & T;
28
+ export declare const initialCaseTreeViewState: CaseTreeState;
29
+ export declare const caseTreeViewSlice: import('@reduxjs/toolkit').Slice<CaseTreeState, {
30
+ importCaseTreeViewState(_: import('immer').WritableDraft<CaseTreeState>, action: PayloadAction<SerializedCaseTreeViewState>): Record<string, {
31
+ rootId: string;
32
+ nodes: Record<string, {
33
+ variable: string;
34
+ cases: {
35
+ match: string;
36
+ branch: {
37
+ type: "value";
38
+ value: string;
39
+ } | {
40
+ type: "ref";
41
+ nodeId: string;
42
+ };
43
+ }[];
44
+ default?: {
45
+ type: "value";
46
+ value: string;
47
+ } | {
48
+ type: "ref";
49
+ nodeId: string;
50
+ } | undefined;
51
+ }>;
52
+ }>;
53
+ initializeTree(state: import('immer').WritableDraft<CaseTreeState>, action: PayloadAction<WithCaseTreeId>): void;
54
+ updateNode(state: import('immer').WritableDraft<CaseTreeState>, action: PayloadAction<WithCaseTreeId<{
55
+ nodeId: string;
56
+ variable: string;
57
+ }>>): void;
58
+ updateCase(state: import('immer').WritableDraft<CaseTreeState>, action: PayloadAction<WithCaseTreeId<{
59
+ nodeId: string;
60
+ caseIdx: number;
61
+ match: string;
62
+ }>>): void;
63
+ updateBranch(state: import('immer').WritableDraft<CaseTreeState>, action: PayloadAction<WithCaseTreeId<{
64
+ nodeId: string;
65
+ branch: CaseTreeBranch;
66
+ caseIdx?: number;
67
+ }>>): void;
68
+ addCase(state: import('immer').WritableDraft<CaseTreeState>, action: PayloadAction<WithCaseTreeId<{
69
+ parentId: string;
70
+ caseType: "case" | "default";
71
+ branchType: "value" | "ref";
72
+ }>>): void;
73
+ deleteCase(state: import('immer').WritableDraft<CaseTreeState>, action: PayloadAction<WithCaseTreeId<{
74
+ parentId: string;
75
+ caseIdx?: number;
76
+ caseType: "case" | "default";
77
+ }>>): void;
78
+ }, "caseTreeView", "caseTreeView", import('@reduxjs/toolkit').SliceSelectors<CaseTreeState>>;
79
+ declare const _default: import('redux').Reducer<CaseTreeState>;
80
+ export default _default;
81
+ export declare const importCaseTreeViewState: import('@reduxjs/toolkit').ActionCreatorWithPayload<Record<string, {
82
+ rootId: string;
83
+ nodes: Record<string, {
84
+ variable: string;
85
+ cases: {
86
+ match: string;
87
+ branch: {
88
+ type: "value";
89
+ value: string;
90
+ } | {
91
+ type: "ref";
92
+ nodeId: string;
93
+ };
94
+ }[];
95
+ default?: {
96
+ type: "value";
97
+ value: string;
98
+ } | {
99
+ type: "ref";
100
+ nodeId: string;
101
+ } | undefined;
102
+ }>;
103
+ }>, "caseTreeView/importCaseTreeViewState">, initializeTree: import('@reduxjs/toolkit').ActionCreatorWithPayload<WithCaseTreeId<object>, "caseTreeView/initializeTree">, addCase: import('@reduxjs/toolkit').ActionCreatorWithPayload<WithCaseTreeId<{
104
+ parentId: string;
105
+ caseType: "case" | "default";
106
+ branchType: "value" | "ref";
107
+ }>, "caseTreeView/addCase">, deleteCase: import('@reduxjs/toolkit').ActionCreatorWithPayload<WithCaseTreeId<{
108
+ parentId: string;
109
+ caseIdx?: number;
110
+ caseType: "case" | "default";
111
+ }>, "caseTreeView/deleteCase">;
112
+ export declare const updateNode: (args: WithCaseTreeId<{
113
+ nodeId: string;
114
+ variable: string;
115
+ }>) => AppThunk;
116
+ export declare const updateCase: (args: WithCaseTreeId<{
117
+ nodeId: string;
118
+ caseIdx: number;
119
+ match: string;
120
+ }>) => AppThunk;
121
+ export declare const updateBranch: (args: WithCaseTreeId<{
122
+ nodeId: string;
123
+ branch: CaseTreeBranch;
124
+ caseIdx?: number;
125
+ }>) => AppThunk;
126
+ export declare const selectStructuredCaseView: ((state: import('redux-undo').StateWithHistory<{
127
+ formulas: import('../formulas/formulasSlice').FormulasState;
128
+ queries: import('../queries/queriesSlice').QueriesState;
129
+ language: import('../language/languageSlice').LanguageState;
130
+ structure: import('../structure/structureSlice').StructureState;
131
+ variables: import('../variables/variablesSlice').VariablesState;
132
+ teacherMode: import('../teacherMode/teacherModeslice').TeacherModeState;
133
+ graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
134
+ textView: import('../textView/textViewSlice').TextViewState;
135
+ databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
136
+ caseTreeView: CaseTreeState;
137
+ editorToolbar: import('../editorToolbar/editorToolbarSlice').EditorToolbarState;
138
+ errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
139
+ }>, tupleName: string) => import('./helpers').CaseViewSwitch | undefined) & {
140
+ clearCache: () => void;
141
+ resultsCount: () => number;
142
+ resetResultsCount: () => void;
143
+ } & {
144
+ resultFunc: (resultFuncArgs_0: import('../../common/redux').LockableValue<import('../structure/structureSlice').DomainRepresentation>, resultFuncArgs_1: number | undefined, resultFuncArgs_2: CaseTreeEntry) => import('./helpers').CaseViewSwitch | undefined;
145
+ memoizedResultFunc: ((resultFuncArgs_0: import('../../common/redux').LockableValue<import('../structure/structureSlice').DomainRepresentation>, resultFuncArgs_1: number | undefined, resultFuncArgs_2: CaseTreeEntry) => import('./helpers').CaseViewSwitch | undefined) & {
146
+ clearCache: () => void;
147
+ resultsCount: () => number;
148
+ resetResultsCount: () => void;
149
+ };
150
+ lastResult: () => import('./helpers').CaseViewSwitch | undefined;
151
+ dependencies: [(state: RootState) => import('../../common/redux').LockableValue<import('../structure/structureSlice').DomainRepresentation>, (state: RootState, tupleName: string) => number | undefined, (state: RootState, tupleName: string) => CaseTreeEntry];
152
+ recomputations: () => number;
153
+ resetRecomputations: () => void;
154
+ dependencyRecomputations: () => number;
155
+ resetDependencyRecomputations: () => void;
156
+ } & {
157
+ memoize: typeof import('reselect').weakMapMemoize;
158
+ argsMemoize: typeof import('reselect').weakMapMemoize;
159
+ };
@@ -0,0 +1,45 @@
1
+ import { CaseTreeNode } from './caseTreeViewSlice';
2
+ export type GenerateTuplesResult = {
3
+ ok: true;
4
+ tuples: string[][];
5
+ } | {
6
+ ok: false;
7
+ };
8
+ export declare function generateTuples(rootId: string, nodes: Record<string, CaseTreeNode>, domain: Set<string>, maxDepth: number): GenerateTuplesResult;
9
+ export declare function getSubstreeNodeIds(rootId: string, nodes: Record<string, CaseTreeNode>): Set<string>;
10
+ export declare function getNextNodeId(nodes: Record<string, CaseTreeNode>): string;
11
+ export type CaseViewBranch = {
12
+ type: "value";
13
+ value: string;
14
+ error: string;
15
+ } | {
16
+ type: "ref";
17
+ switch: CaseViewSwitch;
18
+ };
19
+ export type CaseViewCase = {
20
+ type: "case";
21
+ match: string;
22
+ branch: CaseViewBranch;
23
+ error: string;
24
+ } | {
25
+ type: "default";
26
+ branch: CaseViewBranch | undefined;
27
+ error: string;
28
+ };
29
+ export interface CaseViewSwitch {
30
+ id: string;
31
+ variable: string;
32
+ cases: CaseViewCase[];
33
+ exhausted: boolean;
34
+ depth: number;
35
+ errors: TreeSwitchError[];
36
+ }
37
+ export type TreeSwitchError = {
38
+ scope: "variable";
39
+ message: string;
40
+ } | {
41
+ scope: "cases";
42
+ message: string;
43
+ };
44
+ export declare function getStructuredCaseView(rootId: string, nodes: Record<string, CaseTreeNode>, domain: Set<string>, maxDepth: number): CaseViewSwitch;
45
+ export declare function getAllCaseViewErrors(root: CaseViewSwitch): string[];
@@ -0,0 +1,26 @@
1
+ import { default as z } from 'zod';
2
+ export declare const serializedCaseTreeViewStateSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
3
+ rootId: z.ZodString;
4
+ nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
5
+ variable: z.ZodString;
6
+ cases: z.ZodArray<z.ZodObject<{
7
+ match: z.ZodString;
8
+ branch: z.ZodUnion<readonly [z.ZodObject<{
9
+ type: z.ZodLiteral<"value">;
10
+ value: z.ZodString;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ type: z.ZodLiteral<"ref">;
13
+ nodeId: z.ZodString;
14
+ }, z.core.$strip>]>;
15
+ }, z.core.$strip>>;
16
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
17
+ type: z.ZodLiteral<"value">;
18
+ value: z.ZodString;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ type: z.ZodLiteral<"ref">;
21
+ nodeId: z.ZodString;
22
+ }, z.core.$strip>]>>;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>>>;
25
+ export type SerializedCaseTreeViewState = z.infer<typeof serializedCaseTreeViewStateSchema>;
26
+ export declare const SerializedCaseTreeViewStateDefault: SerializedCaseTreeViewState;
@@ -30,6 +30,7 @@ export declare const selectDatabaseViewValues: ((state: import('redux-undo').Sta
30
30
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
31
31
  textView: import('../textView/textViewSlice').TextViewState;
32
32
  databaseView: DatabaseViewState;
33
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
33
34
  editorToolbar: import('../editorToolbar/editorToolbarSlice').EditorToolbarState;
34
35
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
35
36
  }>, __: string, ___: TupleType, arity: number) => {
@@ -25,7 +25,7 @@ export declare const editorToolbarSlice: import('@reduxjs/toolkit').Slice<Editor
25
25
  unaryFilterHovered: false;
26
26
  selectedUnary: string[];
27
27
  unaryFilterDomain: boolean;
28
- openedEditor: "text" | "matrix" | "database" | "oriented" | "hasse" | "bipartite";
28
+ openedEditor: "text" | "matrix" | "database" | "oriented" | "hasse" | "bipartite" | "caseTree";
29
29
  selectedDomain?: string[] | undefined;
30
30
  };
31
31
  };
@@ -62,6 +62,7 @@ export declare const selectSelectedDomain: ((state: import('redux-undo').StateWi
62
62
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
63
63
  textView: import('../textView/textViewSlice').TextViewState;
64
64
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
65
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
65
66
  editorToolbar: EditorToolbarState;
66
67
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
67
68
  }>, tupleName: string, tupleType: TupleType) => string[]) & {
@@ -95,6 +96,7 @@ export declare const selectPredicatesToDisplay: ((state: import('redux-undo').St
95
96
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
96
97
  textView: import('../textView/textViewSlice').TextViewState;
97
98
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
99
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
98
100
  editorToolbar: EditorToolbarState;
99
101
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
100
102
  }>, _: string, __: TupleType, domainId: string) => string[][]) & {
@@ -128,6 +130,7 @@ export declare const selectRelevantDomainElements: ((state: import('redux-undo')
128
130
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
129
131
  textView: import('../textView/textViewSlice').TextViewState;
130
132
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
133
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
131
134
  editorToolbar: EditorToolbarState;
132
135
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
133
136
  }>, __: string, ___: TupleType, includeHovered?: boolean | undefined) => string[] | undefined) & {
@@ -161,6 +164,7 @@ export declare const selectFilteredDomain: ((state: import('redux-undo').StateWi
161
164
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
162
165
  textView: import('../textView/textViewSlice').TextViewState;
163
166
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
167
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
164
168
  editorToolbar: EditorToolbarState;
165
169
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
166
170
  }>, __: string, ___: TupleType, includeHovered?: boolean | undefined) => string[]) & {
@@ -185,6 +189,7 @@ export declare const selectFilteredDomain: ((state: import('redux-undo').StateWi
185
189
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
186
190
  textView: import('../textView/textViewSlice').TextViewState;
187
191
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
192
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
188
193
  editorToolbar: EditorToolbarState;
189
194
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
190
195
  }>, tupleName: string, tupleType: TupleType) => string[]) & {
@@ -217,6 +222,7 @@ export declare const selectFilteredDomain: ((state: import('redux-undo').StateWi
217
222
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
218
223
  textView: import('../textView/textViewSlice').TextViewState;
219
224
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
225
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
220
226
  editorToolbar: EditorToolbarState;
221
227
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
222
228
  }>, __: string, ___: TupleType, includeHovered?: boolean | undefined) => string[] | undefined) & {
@@ -258,6 +264,7 @@ export declare const selectHoveredIntr: ((state: import('redux-undo').StateWithH
258
264
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
259
265
  textView: import('../textView/textViewSlice').TextViewState;
260
266
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
267
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
261
268
  editorToolbar: EditorToolbarState;
262
269
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
263
270
  }>, tupleName: string, tupleType: TupleType) => string[][] | undefined) & {
@@ -291,6 +298,7 @@ export declare const selectHatchedDomain: ((state: import('redux-undo').StateWit
291
298
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
292
299
  textView: import('../textView/textViewSlice').TextViewState;
293
300
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
301
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
294
302
  editorToolbar: EditorToolbarState;
295
303
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
296
304
  }>, __: string, ___: TupleType, includeHovered?: boolean | undefined) => string[]) & {
@@ -315,6 +323,7 @@ export declare const selectHatchedDomain: ((state: import('redux-undo').StateWit
315
323
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
316
324
  textView: import('../textView/textViewSlice').TextViewState;
317
325
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
326
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
318
327
  editorToolbar: EditorToolbarState;
319
328
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
320
329
  }>, tupleName: string, tupleType: TupleType) => string[][] | undefined) & {
@@ -347,6 +356,7 @@ export declare const selectHatchedDomain: ((state: import('redux-undo').StateWit
347
356
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
348
357
  textView: import('../textView/textViewSlice').TextViewState;
349
358
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
359
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
350
360
  editorToolbar: EditorToolbarState;
351
361
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
352
362
  }>, tupleName: string, tupleType: TupleType) => string[]) & {
@@ -379,6 +389,7 @@ export declare const selectHatchedDomain: ((state: import('redux-undo').StateWit
379
389
  graphView: import('../graphView/graphs/graphSlice').GraphManagerState;
380
390
  textView: import('../textView/textViewSlice').TextViewState;
381
391
  databaseView: import('../databaseView/databaseViewSlice').DatabaseViewState;
392
+ caseTreeView: import('../caseTreeView/caseTreeViewSlice').CaseTreeState;
382
393
  editorToolbar: EditorToolbarState;
383
394
  errorAlert: import('../errorAlert/errorAlertSlice').ErrorState;
384
395
  }>, __: string, ___: TupleType, includeHovered?: boolean | undefined) => string[] | undefined) & {
@@ -416,7 +427,7 @@ export default _default;
416
427
  export declare const importEditorToolbarState: import('@reduxjs/toolkit').ActionCreatorWithPayload<Record<string, {
417
428
  selectedUnary: string[];
418
429
  unaryFilterDomain: boolean;
419
- openedEditor: "text" | "matrix" | "database" | "oriented" | "hasse" | "bipartite";
430
+ openedEditor: "text" | "matrix" | "database" | "oriented" | "hasse" | "bipartite" | "caseTree";
420
431
  hoveredUnary?: string[] | undefined;
421
432
  selectedDomain?: string[] | undefined;
422
433
  unaryFilterHovered?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const editorTypes: readonly ["text", "matrix", "database", "oriented", "hasse", "bipartite"];
2
+ export declare const editorTypes: readonly ["text", "matrix", "database", "oriented", "hasse", "bipartite", "caseTree"];
3
3
  export declare const serializedEditorToolbarStateSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
4
4
  hoveredUnary: z.ZodOptional<z.ZodArray<z.ZodString>>;
5
5
  selectedUnary: z.ZodArray<z.ZodString>;
@@ -13,6 +13,7 @@ export declare const serializedEditorToolbarStateSchema: z.ZodDefault<z.ZodRecor
13
13
  oriented: "oriented";
14
14
  hasse: "hasse";
15
15
  bipartite: "bipartite";
16
+ caseTree: "caseTree";
16
17
  }>;
17
18
  }, z.core.$strip>>>;
18
19
  export type SerializedEditorToolbarState = z.infer<typeof serializedEditorToolbarStateSchema>;