@fgv/ts-res-ui-components 5.0.0-10

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 (231) hide show
  1. package/.rush/temp/03c8b056281d9db0a97d8a6e25eea798a160d393.tar.log +271 -0
  2. package/.rush/temp/chunked-rush-logs/ts-res-ui-components.build.chunks.jsonl +9 -0
  3. package/.rush/temp/operation/build/all.log +9 -0
  4. package/.rush/temp/operation/build/log-chunks.jsonl +9 -0
  5. package/.rush/temp/operation/build/state.json +3 -0
  6. package/.rush/temp/shrinkwrap-deps.json +1111 -0
  7. package/README.md +18 -0
  8. package/REFACTORING_PLAN.md +171 -0
  9. package/config/jest.config.json +16 -0
  10. package/config/jest.setup.js +64 -0
  11. package/config/rig.json +16 -0
  12. package/lib/components/common/QualifierContextControl.d.ts +14 -0
  13. package/lib/components/common/QualifierContextControl.d.ts.map +1 -0
  14. package/lib/components/common/QualifierContextControl.js +78 -0
  15. package/lib/components/common/QualifierContextControl.js.map +1 -0
  16. package/lib/components/common/ResourceListView.d.ts +11 -0
  17. package/lib/components/common/ResourceListView.d.ts.map +1 -0
  18. package/lib/components/common/ResourceListView.js +20 -0
  19. package/lib/components/common/ResourceListView.js.map +1 -0
  20. package/lib/components/common/ResourceTreeView.d.ts +12 -0
  21. package/lib/components/common/ResourceTreeView.d.ts.map +1 -0
  22. package/lib/components/common/ResourceTreeView.js +162 -0
  23. package/lib/components/common/ResourceTreeView.js.map +1 -0
  24. package/lib/components/forms/HierarchyEditor.d.ts +10 -0
  25. package/lib/components/forms/HierarchyEditor.d.ts.map +1 -0
  26. package/lib/components/forms/HierarchyEditor.js +106 -0
  27. package/lib/components/forms/HierarchyEditor.js.map +1 -0
  28. package/lib/components/forms/QualifierEditForm.d.ts +11 -0
  29. package/lib/components/forms/QualifierEditForm.d.ts.map +1 -0
  30. package/lib/components/forms/QualifierEditForm.js +181 -0
  31. package/lib/components/forms/QualifierEditForm.js.map +1 -0
  32. package/lib/components/forms/QualifierTypeEditForm.d.ts +10 -0
  33. package/lib/components/forms/QualifierTypeEditForm.d.ts.map +1 -0
  34. package/lib/components/forms/QualifierTypeEditForm.js +172 -0
  35. package/lib/components/forms/QualifierTypeEditForm.js.map +1 -0
  36. package/lib/components/forms/ResourceTypeEditForm.d.ts +10 -0
  37. package/lib/components/forms/ResourceTypeEditForm.d.ts.map +1 -0
  38. package/lib/components/forms/ResourceTypeEditForm.js +188 -0
  39. package/lib/components/forms/ResourceTypeEditForm.js.map +1 -0
  40. package/lib/components/forms/index.d.ts +9 -0
  41. package/lib/components/forms/index.d.ts.map +1 -0
  42. package/lib/components/forms/index.js +5 -0
  43. package/lib/components/forms/index.js.map +1 -0
  44. package/lib/components/orchestrator/ResourceOrchestrator.d.ts +14 -0
  45. package/lib/components/orchestrator/ResourceOrchestrator.d.ts.map +1 -0
  46. package/lib/components/orchestrator/ResourceOrchestrator.js +278 -0
  47. package/lib/components/orchestrator/ResourceOrchestrator.js.map +1 -0
  48. package/lib/components/views/CompiledView/index.d.ts +5 -0
  49. package/lib/components/views/CompiledView/index.d.ts.map +1 -0
  50. package/lib/components/views/CompiledView/index.js +595 -0
  51. package/lib/components/views/CompiledView/index.js.map +1 -0
  52. package/lib/components/views/ConfigurationView/index.d.ts +5 -0
  53. package/lib/components/views/ConfigurationView/index.d.ts.map +1 -0
  54. package/lib/components/views/ConfigurationView/index.js +363 -0
  55. package/lib/components/views/ConfigurationView/index.js.map +1 -0
  56. package/lib/components/views/FilterView/index.d.ts +5 -0
  57. package/lib/components/views/FilterView/index.d.ts.map +1 -0
  58. package/lib/components/views/FilterView/index.js +463 -0
  59. package/lib/components/views/FilterView/index.js.map +1 -0
  60. package/lib/components/views/ImportView/index.d.ts +5 -0
  61. package/lib/components/views/ImportView/index.d.ts.map +1 -0
  62. package/lib/components/views/ImportView/index.js +514 -0
  63. package/lib/components/views/ImportView/index.js.map +1 -0
  64. package/lib/components/views/ResolutionView/EditableJsonView.d.ts +21 -0
  65. package/lib/components/views/ResolutionView/EditableJsonView.d.ts.map +1 -0
  66. package/lib/components/views/ResolutionView/EditableJsonView.js +109 -0
  67. package/lib/components/views/ResolutionView/EditableJsonView.js.map +1 -0
  68. package/lib/components/views/ResolutionView/ResolutionEditControls.d.ts +19 -0
  69. package/lib/components/views/ResolutionView/ResolutionEditControls.d.ts.map +1 -0
  70. package/lib/components/views/ResolutionView/ResolutionEditControls.js +82 -0
  71. package/lib/components/views/ResolutionView/ResolutionEditControls.js.map +1 -0
  72. package/lib/components/views/ResolutionView/index.d.ts +5 -0
  73. package/lib/components/views/ResolutionView/index.d.ts.map +1 -0
  74. package/lib/components/views/ResolutionView/index.js +255 -0
  75. package/lib/components/views/ResolutionView/index.js.map +1 -0
  76. package/lib/components/views/SourceView/index.d.ts +5 -0
  77. package/lib/components/views/SourceView/index.d.ts.map +1 -0
  78. package/lib/components/views/SourceView/index.js +316 -0
  79. package/lib/components/views/SourceView/index.js.map +1 -0
  80. package/lib/components/views/ZipLoaderView/index.d.ts +5 -0
  81. package/lib/components/views/ZipLoaderView/index.d.ts.map +1 -0
  82. package/lib/components/views/ZipLoaderView/index.js +313 -0
  83. package/lib/components/views/ZipLoaderView/index.js.map +1 -0
  84. package/lib/hooks/useConfigurationState.d.ts +46 -0
  85. package/lib/hooks/useConfigurationState.d.ts.map +1 -0
  86. package/lib/hooks/useConfigurationState.js +239 -0
  87. package/lib/hooks/useConfigurationState.js.map +1 -0
  88. package/lib/hooks/useFilterState.d.ts +7 -0
  89. package/lib/hooks/useFilterState.d.ts.map +1 -0
  90. package/lib/hooks/useFilterState.js +80 -0
  91. package/lib/hooks/useFilterState.js.map +1 -0
  92. package/lib/hooks/useResolutionState.d.ts +8 -0
  93. package/lib/hooks/useResolutionState.d.ts.map +1 -0
  94. package/lib/hooks/useResolutionState.js +253 -0
  95. package/lib/hooks/useResolutionState.js.map +1 -0
  96. package/lib/hooks/useResourceData.d.ts +19 -0
  97. package/lib/hooks/useResourceData.d.ts.map +1 -0
  98. package/lib/hooks/useResourceData.js +368 -0
  99. package/lib/hooks/useResourceData.js.map +1 -0
  100. package/lib/hooks/useViewState.d.ts +10 -0
  101. package/lib/hooks/useViewState.d.ts.map +1 -0
  102. package/lib/hooks/useViewState.js +29 -0
  103. package/lib/hooks/useViewState.js.map +1 -0
  104. package/lib/index.d.ts +27 -0
  105. package/lib/index.d.ts.map +1 -0
  106. package/lib/index.js +34 -0
  107. package/lib/index.js.map +1 -0
  108. package/lib/test/helpers/testDataLoader.d.ts +37 -0
  109. package/lib/test/helpers/testDataLoader.d.ts.map +1 -0
  110. package/lib/test/helpers/testDataLoader.js +171 -0
  111. package/lib/test/helpers/testDataLoader.js.map +1 -0
  112. package/lib/test/unit/utils/configurationUtils.test.d.ts +2 -0
  113. package/lib/test/unit/utils/configurationUtils.test.d.ts.map +1 -0
  114. package/lib/test/unit/utils/configurationUtils.test.js +497 -0
  115. package/lib/test/unit/utils/configurationUtils.test.js.map +1 -0
  116. package/lib/test/unit/utils/fileProcessing.test.d.ts +2 -0
  117. package/lib/test/unit/utils/fileProcessing.test.d.ts.map +1 -0
  118. package/lib/test/unit/utils/fileProcessing.test.js +321 -0
  119. package/lib/test/unit/utils/fileProcessing.test.js.map +1 -0
  120. package/lib/test/unit/utils/filterResources.test.d.ts +2 -0
  121. package/lib/test/unit/utils/filterResources.test.d.ts.map +1 -0
  122. package/lib/test/unit/utils/filterResources.test.js +403 -0
  123. package/lib/test/unit/utils/filterResources.test.js.map +1 -0
  124. package/lib/test/unit/utils/resolutionEditing.test.d.ts +2 -0
  125. package/lib/test/unit/utils/resolutionEditing.test.d.ts.map +1 -0
  126. package/lib/test/unit/utils/resolutionEditing.test.js +439 -0
  127. package/lib/test/unit/utils/resolutionEditing.test.js.map +1 -0
  128. package/lib/test/unit/utils/resolutionUtils.test.d.ts +2 -0
  129. package/lib/test/unit/utils/resolutionUtils.test.d.ts.map +1 -0
  130. package/lib/test/unit/utils/resolutionUtils.test.js +397 -0
  131. package/lib/test/unit/utils/resolutionUtils.test.js.map +1 -0
  132. package/lib/test/unit/utils/tsResIntegration.test.d.ts +2 -0
  133. package/lib/test/unit/utils/tsResIntegration.test.d.ts.map +1 -0
  134. package/lib/test/unit/utils/tsResIntegration.test.js +376 -0
  135. package/lib/test/unit/utils/tsResIntegration.test.js.map +1 -0
  136. package/lib/types/index.d.ts +251 -0
  137. package/lib/types/index.d.ts.map +1 -0
  138. package/lib/types/index.js +2 -0
  139. package/lib/types/index.js.map +1 -0
  140. package/lib/utils/configurationUtils.d.ts +74 -0
  141. package/lib/utils/configurationUtils.d.ts.map +1 -0
  142. package/lib/utils/configurationUtils.js +359 -0
  143. package/lib/utils/configurationUtils.js.map +1 -0
  144. package/lib/utils/fileProcessing.d.ts +18 -0
  145. package/lib/utils/fileProcessing.d.ts.map +1 -0
  146. package/lib/utils/fileProcessing.js +142 -0
  147. package/lib/utils/fileProcessing.js.map +1 -0
  148. package/lib/utils/filterResources.d.ts +38 -0
  149. package/lib/utils/filterResources.d.ts.map +1 -0
  150. package/lib/utils/filterResources.js +153 -0
  151. package/lib/utils/filterResources.js.map +1 -0
  152. package/lib/utils/resolutionEditing.d.ts +58 -0
  153. package/lib/utils/resolutionEditing.d.ts.map +1 -0
  154. package/lib/utils/resolutionEditing.js +246 -0
  155. package/lib/utils/resolutionEditing.js.map +1 -0
  156. package/lib/utils/resolutionUtils.d.ts +28 -0
  157. package/lib/utils/resolutionUtils.d.ts.map +1 -0
  158. package/lib/utils/resolutionUtils.js +216 -0
  159. package/lib/utils/resolutionUtils.js.map +1 -0
  160. package/lib/utils/tsResIntegration.d.ts +71 -0
  161. package/lib/utils/tsResIntegration.d.ts.map +1 -0
  162. package/lib/utils/tsResIntegration.js +294 -0
  163. package/lib/utils/tsResIntegration.js.map +1 -0
  164. package/lib/utils/zipLoader/browserZipLoader.d.ts +48 -0
  165. package/lib/utils/zipLoader/browserZipLoader.d.ts.map +1 -0
  166. package/lib/utils/zipLoader/browserZipLoader.js +247 -0
  167. package/lib/utils/zipLoader/browserZipLoader.js.map +1 -0
  168. package/lib/utils/zipLoader/index.d.ts +8 -0
  169. package/lib/utils/zipLoader/index.d.ts.map +1 -0
  170. package/lib/utils/zipLoader/index.js +13 -0
  171. package/lib/utils/zipLoader/index.js.map +1 -0
  172. package/lib/utils/zipLoader/nodeZipBuilder.d.ts +55 -0
  173. package/lib/utils/zipLoader/nodeZipBuilder.d.ts.map +1 -0
  174. package/lib/utils/zipLoader/nodeZipBuilder.js +98 -0
  175. package/lib/utils/zipLoader/nodeZipBuilder.js.map +1 -0
  176. package/lib/utils/zipLoader/types.d.ts +139 -0
  177. package/lib/utils/zipLoader/types.d.ts.map +1 -0
  178. package/lib/utils/zipLoader/types.js +2 -0
  179. package/lib/utils/zipLoader/types.js.map +1 -0
  180. package/lib/utils/zipLoader/zipUtils.d.ts +53 -0
  181. package/lib/utils/zipLoader/zipUtils.d.ts.map +1 -0
  182. package/lib/utils/zipLoader/zipUtils.js +229 -0
  183. package/lib/utils/zipLoader/zipUtils.js.map +1 -0
  184. package/package.json +69 -0
  185. package/rush-logs/ts-res-ui-components.build.cache.log +3 -0
  186. package/rush-logs/ts-res-ui-components.build.log +9 -0
  187. package/src/components/common/QualifierContextControl.tsx +151 -0
  188. package/src/components/common/ResourceListView.tsx +63 -0
  189. package/src/components/common/ResourceTreeView.tsx +271 -0
  190. package/src/components/forms/HierarchyEditor.tsx +204 -0
  191. package/src/components/forms/QualifierEditForm.tsx +355 -0
  192. package/src/components/forms/QualifierTypeEditForm.tsx +347 -0
  193. package/src/components/forms/ResourceTypeEditForm.tsx +331 -0
  194. package/src/components/forms/index.ts +11 -0
  195. package/src/components/orchestrator/ResourceOrchestrator.tsx +372 -0
  196. package/src/components/views/CompiledView/index.tsx +922 -0
  197. package/src/components/views/ConfigurationView/index.tsx +800 -0
  198. package/src/components/views/FilterView/index.tsx +825 -0
  199. package/src/components/views/ImportView/index.tsx +717 -0
  200. package/src/components/views/ResolutionView/EditableJsonView.tsx +214 -0
  201. package/src/components/views/ResolutionView/ResolutionEditControls.tsx +170 -0
  202. package/src/components/views/ResolutionView/index.tsx +591 -0
  203. package/src/components/views/SourceView/index.tsx +536 -0
  204. package/src/components/views/ZipLoaderView/index.tsx +485 -0
  205. package/src/hooks/useConfigurationState.ts +374 -0
  206. package/src/hooks/useFilterState.ts +97 -0
  207. package/src/hooks/useResolutionState.ts +355 -0
  208. package/src/hooks/useResourceData.ts +467 -0
  209. package/src/hooks/useViewState.ts +44 -0
  210. package/src/index.ts +45 -0
  211. package/src/test/helpers/testDataLoader.ts +195 -0
  212. package/src/test/unit/utils/configurationUtils.test.ts +630 -0
  213. package/src/test/unit/utils/fileProcessing.test.ts +391 -0
  214. package/src/test/unit/utils/filterResources.test.ts +574 -0
  215. package/src/test/unit/utils/resolutionEditing.test.ts +556 -0
  216. package/src/test/unit/utils/resolutionUtils.test.ts +521 -0
  217. package/src/test/unit/utils/tsResIntegration.test.ts +433 -0
  218. package/src/types/index.ts +322 -0
  219. package/src/utils/configurationUtils.ts +424 -0
  220. package/src/utils/fileProcessing.ts +160 -0
  221. package/src/utils/filterResources.ts +206 -0
  222. package/src/utils/resolutionEditing.ts +319 -0
  223. package/src/utils/resolutionUtils.ts +289 -0
  224. package/src/utils/tsResIntegration.ts +440 -0
  225. package/src/utils/zipLoader/browserZipLoader.ts +319 -0
  226. package/src/utils/zipLoader/index.ts +26 -0
  227. package/src/utils/zipLoader/nodeZipBuilder.ts +153 -0
  228. package/src/utils/zipLoader/types.ts +175 -0
  229. package/src/utils/zipLoader/zipUtils.ts +266 -0
  230. package/temp/build/typescript/ts_gZid87Hu.json +1 -0
  231. package/tsconfig.json +15 -0
@@ -0,0 +1,322 @@
1
+ import { Result } from '@fgv/ts-utils';
2
+ import {
3
+ ResourceJson,
4
+ Config,
5
+ Bundle,
6
+ Resources,
7
+ Runtime,
8
+ QualifierTypes,
9
+ Qualifiers,
10
+ ResourceTypes,
11
+ Import
12
+ } from '@fgv/ts-res';
13
+ import { JsonValue } from '@fgv/ts-json-base';
14
+
15
+ // Message system types
16
+ export interface Message {
17
+ id: string;
18
+ type: 'info' | 'warning' | 'error' | 'success';
19
+ message: string;
20
+ timestamp: Date;
21
+ }
22
+
23
+ // Filter state management
24
+ export interface FilterState {
25
+ enabled: boolean;
26
+ values: Record<string, string | undefined>;
27
+ appliedValues: Record<string, string | undefined>;
28
+ hasPendingChanges: boolean;
29
+ reduceQualifiers: boolean;
30
+ }
31
+
32
+ export interface FilterActions {
33
+ updateFilterEnabled: (enabled: boolean) => void;
34
+ updateFilterValues: (values: Record<string, string | undefined>) => void;
35
+ applyFilterValues: () => void;
36
+ resetFilterValues: () => void;
37
+ updateReduceQualifiers: (reduceQualifiers: boolean) => void;
38
+ }
39
+
40
+ // Resource processing types
41
+ export interface ProcessedResources {
42
+ system: {
43
+ resourceManager: Resources.ResourceManagerBuilder;
44
+ qualifierTypes: QualifierTypes.ReadOnlyQualifierTypeCollector;
45
+ qualifiers: Qualifiers.IReadOnlyQualifierCollector;
46
+ resourceTypes: ResourceTypes.ReadOnlyResourceTypeCollector;
47
+ importManager: Import.ImportManager;
48
+ contextQualifierProvider: Runtime.ValidatingSimpleContextQualifierProvider;
49
+ };
50
+ compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection;
51
+ resolver: Runtime.ResourceResolver;
52
+ resourceCount: number;
53
+ summary: {
54
+ totalResources: number;
55
+ resourceIds: string[];
56
+ errorCount: number;
57
+ warnings: string[];
58
+ };
59
+ }
60
+
61
+ // Extended processed resources with additional metadata
62
+ export interface ExtendedProcessedResources extends ProcessedResources {
63
+ activeConfiguration?: Config.Model.ISystemConfiguration | null;
64
+ isLoadedFromBundle?: boolean;
65
+ bundleMetadata?: Bundle.IBundleMetadata | null;
66
+ }
67
+
68
+ // Resource manager state
69
+ export interface ResourceManagerState {
70
+ isProcessing: boolean;
71
+ processedResources: ExtendedProcessedResources | null;
72
+ error: string | null;
73
+ hasProcessedData: boolean;
74
+ activeConfiguration: Config.Model.ISystemConfiguration | null;
75
+ isLoadedFromBundle: boolean;
76
+ bundleMetadata: Bundle.IBundleMetadata | null;
77
+ }
78
+
79
+ // File import types
80
+ export interface ImportedFile {
81
+ name: string;
82
+ path?: string;
83
+ content: string;
84
+ type?: string;
85
+ }
86
+
87
+ export interface ImportedDirectory {
88
+ name: string;
89
+ path?: string;
90
+ files: ImportedFile[];
91
+ subdirectories?: ImportedDirectory[];
92
+ }
93
+
94
+ // Component prop types for each view
95
+ export interface ViewBaseProps {
96
+ onMessage?: (type: Message['type'], message: string) => void;
97
+ className?: string;
98
+ }
99
+
100
+ export interface ImportViewProps extends ViewBaseProps {
101
+ onImport?: (data: ImportedDirectory | ImportedFile[]) => void;
102
+ onBundleImport?: (bundle: Bundle.IBundle) => void;
103
+ onZipImport?: (zipFile: File, config?: Config.Model.ISystemConfiguration) => void; // Pass raw File for FileTree creation
104
+ acceptedFileTypes?: string[];
105
+ }
106
+
107
+ export interface SourceViewProps extends ViewBaseProps {
108
+ resources?: ExtendedProcessedResources | null;
109
+ selectedResourceId?: string | null;
110
+ onResourceSelect?: (resourceId: string) => void;
111
+ onExport?: (data: ResourceJson.Compiled.ICompiledResourceCollection, type: 'json') => void;
112
+ }
113
+
114
+ export interface FilterViewProps extends ViewBaseProps {
115
+ resources?: ProcessedResources | null;
116
+ filterState: FilterState;
117
+ filterActions: FilterActions;
118
+ filterResult?: FilterResult | null;
119
+ onFilterResult?: (result: FilterResult | null) => void;
120
+ }
121
+
122
+ export interface CompiledViewProps extends ViewBaseProps {
123
+ resources?: ExtendedProcessedResources | null;
124
+ filterState?: FilterState;
125
+ filterResult?: FilterResult | null;
126
+ useNormalization?: boolean;
127
+ onExport?: (
128
+ data: ResourceJson.Compiled.ICompiledResourceCollection | Bundle.IBundle,
129
+ type: 'json' | 'bundle'
130
+ ) => void;
131
+ }
132
+
133
+ export interface ResolutionViewProps extends ViewBaseProps {
134
+ resources?: ProcessedResources | null;
135
+ filterState?: FilterState;
136
+ filterResult?: FilterResult | null;
137
+ resolutionState?: ResolutionState;
138
+ resolutionActions?: ResolutionActions;
139
+ availableQualifiers?: string[];
140
+ }
141
+
142
+ // Resolution editing types
143
+ export interface EditedResourceInfo {
144
+ resourceId: string;
145
+ originalValue: JsonValue;
146
+ editedValue: JsonValue;
147
+ timestamp: Date;
148
+ }
149
+
150
+ // Resolution types
151
+ export interface ResolutionState {
152
+ contextValues: Record<string, string | undefined>;
153
+ pendingContextValues: Record<string, string | undefined>;
154
+ selectedResourceId: string | null;
155
+ currentResolver: Runtime.ResourceResolver | null;
156
+ resolutionResult: ResolutionResult | null;
157
+ viewMode: 'composed' | 'best' | 'all' | 'raw';
158
+ hasPendingChanges: boolean;
159
+ // Edit state
160
+ editedResources: Map<string, JsonValue>;
161
+ hasUnsavedEdits: boolean;
162
+ isApplyingEdits: boolean;
163
+ }
164
+
165
+ export interface ResolutionActions {
166
+ updateContextValue: (qualifierName: string, value: string | undefined) => void;
167
+ applyContext: () => void;
168
+ selectResource: (resourceId: string) => void;
169
+ setViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;
170
+ resetCache: () => void;
171
+ // Edit actions
172
+ saveEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => void;
173
+ getEditedValue: (resourceId: string) => JsonValue | undefined;
174
+ hasEdit: (resourceId: string) => boolean;
175
+ clearEdits: () => void;
176
+ applyEdits: () => Promise<void>;
177
+ discardEdits: () => void;
178
+ }
179
+
180
+ export interface ResolutionResult {
181
+ success: boolean;
182
+ resourceId: string;
183
+ resource?: Runtime.IResource;
184
+ bestCandidate?: Runtime.IResourceCandidate;
185
+ allCandidates?: readonly Runtime.IResourceCandidate[];
186
+ candidateDetails?: CandidateInfo[];
187
+ composedValue?: JsonValue;
188
+ error?: string;
189
+ }
190
+
191
+ export interface CandidateInfo {
192
+ candidate: Runtime.IResourceCandidate;
193
+ conditionSetKey: string | null;
194
+ candidateIndex: number;
195
+ matched: boolean;
196
+ matchType: 'match' | 'matchAsDefault' | 'noMatch';
197
+ isDefaultMatch: boolean;
198
+ conditionEvaluations?: ConditionEvaluationResult[];
199
+ }
200
+
201
+ export interface ConditionEvaluationResult {
202
+ qualifierName: string;
203
+ qualifierValue: string | undefined;
204
+ conditionValue: string | undefined;
205
+ operator: string;
206
+ score: number;
207
+ matched: boolean;
208
+ matchType: 'match' | 'matchAsDefault' | 'noMatch';
209
+ scoreAsDefault?: number;
210
+ conditionIndex: number;
211
+ }
212
+
213
+ export interface ConfigurationViewProps extends ViewBaseProps {
214
+ configuration?: Config.Model.ISystemConfiguration | null;
215
+ onConfigurationChange?: (config: Config.Model.ISystemConfiguration) => void;
216
+ onSave?: (config: Config.Model.ISystemConfiguration) => void;
217
+ hasUnsavedChanges?: boolean;
218
+ }
219
+
220
+ export interface ZipLoaderViewProps extends ViewBaseProps {
221
+ zipFileUrl?: string;
222
+ zipPath?: string;
223
+ onImport?: (data: ImportedDirectory | ImportedFile[]) => void;
224
+ onConfigurationLoad?: (config: Config.Model.ISystemConfiguration) => void;
225
+ onLoadComplete?: () => void;
226
+ }
227
+
228
+ // Resource detail types for SourceView
229
+ export interface ResourceDetailData {
230
+ id: string;
231
+ resourceType: string;
232
+ candidateCount: number;
233
+ candidates: Array<{
234
+ json: JsonValue;
235
+ conditions: Array<{
236
+ qualifier: string;
237
+ operator: string;
238
+ value: string;
239
+ priority: number;
240
+ scoreAsDefault?: number;
241
+ }>;
242
+ isPartial: boolean;
243
+ mergeMethod: string;
244
+ }>;
245
+ }
246
+
247
+ export interface FilteredResource {
248
+ id: string;
249
+ originalCandidateCount: number;
250
+ filteredCandidateCount: number;
251
+ hasWarning: boolean;
252
+ }
253
+
254
+ // Filter result type
255
+ export interface FilterResult {
256
+ success: boolean;
257
+ processedResources?: ProcessedResources;
258
+ filteredResources?: FilteredResource[];
259
+ warnings?: string[];
260
+ error?: string;
261
+ }
262
+
263
+ // Orchestrator types
264
+ export interface OrchestratorState {
265
+ resources: ExtendedProcessedResources | null;
266
+ configuration: Config.Model.ISystemConfiguration | null;
267
+ filterState: FilterState;
268
+ filterResult: FilterResult | null;
269
+ resolutionState: ResolutionState;
270
+ selectedResourceId: string | null;
271
+ isProcessing: boolean;
272
+ error: string | null;
273
+ messages: Message[];
274
+ }
275
+
276
+ export interface OrchestratorActions {
277
+ // Resource management
278
+ importDirectory: (directory: ImportedDirectory) => Promise<void>;
279
+ importDirectoryWithConfig: (
280
+ directory: ImportedDirectory,
281
+ config: Config.Model.ISystemConfiguration
282
+ ) => Promise<void>;
283
+ importFiles: (files: ImportedFile[]) => Promise<void>;
284
+ importBundle: (bundle: Bundle.IBundle) => Promise<void>;
285
+ clearResources: () => void;
286
+
287
+ // Configuration management
288
+ updateConfiguration: (config: Config.Model.ISystemConfiguration) => void;
289
+ applyConfiguration: (config: Config.Model.ISystemConfiguration) => void;
290
+
291
+ // Filter management
292
+ updateFilterState: (state: Partial<FilterState>) => void;
293
+ applyFilter: () => Promise<FilterResult | null>;
294
+ resetFilter: () => void;
295
+
296
+ // Resolution management
297
+ updateResolutionContext: (qualifierName: string, value: string | undefined) => void;
298
+ applyResolutionContext: () => void;
299
+ selectResourceForResolution: (resourceId: string) => void;
300
+ setResolutionViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;
301
+ resetResolutionCache: () => void;
302
+
303
+ // Resolution editing
304
+ saveResourceEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => void;
305
+ getEditedValue: (resourceId: string) => JsonValue | undefined;
306
+ hasResourceEdit: (resourceId: string) => boolean;
307
+ clearResourceEdits: () => void;
308
+ applyResourceEdits: () => Promise<void>;
309
+ discardResourceEdits: () => void;
310
+
311
+ // UI state management
312
+ selectResource: (resourceId: string | null) => void;
313
+ addMessage: (type: Message['type'], message: string) => void;
314
+ clearMessages: () => void;
315
+
316
+ // Resource resolution
317
+ resolveResource: (resourceId: string, context?: Record<string, string>) => Promise<Result<JsonValue>>;
318
+ }
319
+
320
+ // Export utility types
321
+ export type { Result } from '@fgv/ts-utils';
322
+ export type { JsonValue } from '@fgv/ts-json-base';