@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.
- package/.rush/temp/03c8b056281d9db0a97d8a6e25eea798a160d393.tar.log +271 -0
- package/.rush/temp/chunked-rush-logs/ts-res-ui-components.build.chunks.jsonl +9 -0
- package/.rush/temp/operation/build/all.log +9 -0
- package/.rush/temp/operation/build/log-chunks.jsonl +9 -0
- package/.rush/temp/operation/build/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +1111 -0
- package/README.md +18 -0
- package/REFACTORING_PLAN.md +171 -0
- package/config/jest.config.json +16 -0
- package/config/jest.setup.js +64 -0
- package/config/rig.json +16 -0
- package/lib/components/common/QualifierContextControl.d.ts +14 -0
- package/lib/components/common/QualifierContextControl.d.ts.map +1 -0
- package/lib/components/common/QualifierContextControl.js +78 -0
- package/lib/components/common/QualifierContextControl.js.map +1 -0
- package/lib/components/common/ResourceListView.d.ts +11 -0
- package/lib/components/common/ResourceListView.d.ts.map +1 -0
- package/lib/components/common/ResourceListView.js +20 -0
- package/lib/components/common/ResourceListView.js.map +1 -0
- package/lib/components/common/ResourceTreeView.d.ts +12 -0
- package/lib/components/common/ResourceTreeView.d.ts.map +1 -0
- package/lib/components/common/ResourceTreeView.js +162 -0
- package/lib/components/common/ResourceTreeView.js.map +1 -0
- package/lib/components/forms/HierarchyEditor.d.ts +10 -0
- package/lib/components/forms/HierarchyEditor.d.ts.map +1 -0
- package/lib/components/forms/HierarchyEditor.js +106 -0
- package/lib/components/forms/HierarchyEditor.js.map +1 -0
- package/lib/components/forms/QualifierEditForm.d.ts +11 -0
- package/lib/components/forms/QualifierEditForm.d.ts.map +1 -0
- package/lib/components/forms/QualifierEditForm.js +181 -0
- package/lib/components/forms/QualifierEditForm.js.map +1 -0
- package/lib/components/forms/QualifierTypeEditForm.d.ts +10 -0
- package/lib/components/forms/QualifierTypeEditForm.d.ts.map +1 -0
- package/lib/components/forms/QualifierTypeEditForm.js +172 -0
- package/lib/components/forms/QualifierTypeEditForm.js.map +1 -0
- package/lib/components/forms/ResourceTypeEditForm.d.ts +10 -0
- package/lib/components/forms/ResourceTypeEditForm.d.ts.map +1 -0
- package/lib/components/forms/ResourceTypeEditForm.js +188 -0
- package/lib/components/forms/ResourceTypeEditForm.js.map +1 -0
- package/lib/components/forms/index.d.ts +9 -0
- package/lib/components/forms/index.d.ts.map +1 -0
- package/lib/components/forms/index.js +5 -0
- package/lib/components/forms/index.js.map +1 -0
- package/lib/components/orchestrator/ResourceOrchestrator.d.ts +14 -0
- package/lib/components/orchestrator/ResourceOrchestrator.d.ts.map +1 -0
- package/lib/components/orchestrator/ResourceOrchestrator.js +278 -0
- package/lib/components/orchestrator/ResourceOrchestrator.js.map +1 -0
- package/lib/components/views/CompiledView/index.d.ts +5 -0
- package/lib/components/views/CompiledView/index.d.ts.map +1 -0
- package/lib/components/views/CompiledView/index.js +595 -0
- package/lib/components/views/CompiledView/index.js.map +1 -0
- package/lib/components/views/ConfigurationView/index.d.ts +5 -0
- package/lib/components/views/ConfigurationView/index.d.ts.map +1 -0
- package/lib/components/views/ConfigurationView/index.js +363 -0
- package/lib/components/views/ConfigurationView/index.js.map +1 -0
- package/lib/components/views/FilterView/index.d.ts +5 -0
- package/lib/components/views/FilterView/index.d.ts.map +1 -0
- package/lib/components/views/FilterView/index.js +463 -0
- package/lib/components/views/FilterView/index.js.map +1 -0
- package/lib/components/views/ImportView/index.d.ts +5 -0
- package/lib/components/views/ImportView/index.d.ts.map +1 -0
- package/lib/components/views/ImportView/index.js +514 -0
- package/lib/components/views/ImportView/index.js.map +1 -0
- package/lib/components/views/ResolutionView/EditableJsonView.d.ts +21 -0
- package/lib/components/views/ResolutionView/EditableJsonView.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/EditableJsonView.js +109 -0
- package/lib/components/views/ResolutionView/EditableJsonView.js.map +1 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.d.ts +19 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.js +82 -0
- package/lib/components/views/ResolutionView/ResolutionEditControls.js.map +1 -0
- package/lib/components/views/ResolutionView/index.d.ts +5 -0
- package/lib/components/views/ResolutionView/index.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/index.js +255 -0
- package/lib/components/views/ResolutionView/index.js.map +1 -0
- package/lib/components/views/SourceView/index.d.ts +5 -0
- package/lib/components/views/SourceView/index.d.ts.map +1 -0
- package/lib/components/views/SourceView/index.js +316 -0
- package/lib/components/views/SourceView/index.js.map +1 -0
- package/lib/components/views/ZipLoaderView/index.d.ts +5 -0
- package/lib/components/views/ZipLoaderView/index.d.ts.map +1 -0
- package/lib/components/views/ZipLoaderView/index.js +313 -0
- package/lib/components/views/ZipLoaderView/index.js.map +1 -0
- package/lib/hooks/useConfigurationState.d.ts +46 -0
- package/lib/hooks/useConfigurationState.d.ts.map +1 -0
- package/lib/hooks/useConfigurationState.js +239 -0
- package/lib/hooks/useConfigurationState.js.map +1 -0
- package/lib/hooks/useFilterState.d.ts +7 -0
- package/lib/hooks/useFilterState.d.ts.map +1 -0
- package/lib/hooks/useFilterState.js +80 -0
- package/lib/hooks/useFilterState.js.map +1 -0
- package/lib/hooks/useResolutionState.d.ts +8 -0
- package/lib/hooks/useResolutionState.d.ts.map +1 -0
- package/lib/hooks/useResolutionState.js +253 -0
- package/lib/hooks/useResolutionState.js.map +1 -0
- package/lib/hooks/useResourceData.d.ts +19 -0
- package/lib/hooks/useResourceData.d.ts.map +1 -0
- package/lib/hooks/useResourceData.js +368 -0
- package/lib/hooks/useResourceData.js.map +1 -0
- package/lib/hooks/useViewState.d.ts +10 -0
- package/lib/hooks/useViewState.d.ts.map +1 -0
- package/lib/hooks/useViewState.js +29 -0
- package/lib/hooks/useViewState.js.map +1 -0
- package/lib/index.d.ts +27 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +34 -0
- package/lib/index.js.map +1 -0
- package/lib/test/helpers/testDataLoader.d.ts +37 -0
- package/lib/test/helpers/testDataLoader.d.ts.map +1 -0
- package/lib/test/helpers/testDataLoader.js +171 -0
- package/lib/test/helpers/testDataLoader.js.map +1 -0
- package/lib/test/unit/utils/configurationUtils.test.d.ts +2 -0
- package/lib/test/unit/utils/configurationUtils.test.d.ts.map +1 -0
- package/lib/test/unit/utils/configurationUtils.test.js +497 -0
- package/lib/test/unit/utils/configurationUtils.test.js.map +1 -0
- package/lib/test/unit/utils/fileProcessing.test.d.ts +2 -0
- package/lib/test/unit/utils/fileProcessing.test.d.ts.map +1 -0
- package/lib/test/unit/utils/fileProcessing.test.js +321 -0
- package/lib/test/unit/utils/fileProcessing.test.js.map +1 -0
- package/lib/test/unit/utils/filterResources.test.d.ts +2 -0
- package/lib/test/unit/utils/filterResources.test.d.ts.map +1 -0
- package/lib/test/unit/utils/filterResources.test.js +403 -0
- package/lib/test/unit/utils/filterResources.test.js.map +1 -0
- package/lib/test/unit/utils/resolutionEditing.test.d.ts +2 -0
- package/lib/test/unit/utils/resolutionEditing.test.d.ts.map +1 -0
- package/lib/test/unit/utils/resolutionEditing.test.js +439 -0
- package/lib/test/unit/utils/resolutionEditing.test.js.map +1 -0
- package/lib/test/unit/utils/resolutionUtils.test.d.ts +2 -0
- package/lib/test/unit/utils/resolutionUtils.test.d.ts.map +1 -0
- package/lib/test/unit/utils/resolutionUtils.test.js +397 -0
- package/lib/test/unit/utils/resolutionUtils.test.js.map +1 -0
- package/lib/test/unit/utils/tsResIntegration.test.d.ts +2 -0
- package/lib/test/unit/utils/tsResIntegration.test.d.ts.map +1 -0
- package/lib/test/unit/utils/tsResIntegration.test.js +376 -0
- package/lib/test/unit/utils/tsResIntegration.test.js.map +1 -0
- package/lib/types/index.d.ts +251 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utils/configurationUtils.d.ts +74 -0
- package/lib/utils/configurationUtils.d.ts.map +1 -0
- package/lib/utils/configurationUtils.js +359 -0
- package/lib/utils/configurationUtils.js.map +1 -0
- package/lib/utils/fileProcessing.d.ts +18 -0
- package/lib/utils/fileProcessing.d.ts.map +1 -0
- package/lib/utils/fileProcessing.js +142 -0
- package/lib/utils/fileProcessing.js.map +1 -0
- package/lib/utils/filterResources.d.ts +38 -0
- package/lib/utils/filterResources.d.ts.map +1 -0
- package/lib/utils/filterResources.js +153 -0
- package/lib/utils/filterResources.js.map +1 -0
- package/lib/utils/resolutionEditing.d.ts +58 -0
- package/lib/utils/resolutionEditing.d.ts.map +1 -0
- package/lib/utils/resolutionEditing.js +246 -0
- package/lib/utils/resolutionEditing.js.map +1 -0
- package/lib/utils/resolutionUtils.d.ts +28 -0
- package/lib/utils/resolutionUtils.d.ts.map +1 -0
- package/lib/utils/resolutionUtils.js +216 -0
- package/lib/utils/resolutionUtils.js.map +1 -0
- package/lib/utils/tsResIntegration.d.ts +71 -0
- package/lib/utils/tsResIntegration.d.ts.map +1 -0
- package/lib/utils/tsResIntegration.js +294 -0
- package/lib/utils/tsResIntegration.js.map +1 -0
- package/lib/utils/zipLoader/browserZipLoader.d.ts +48 -0
- package/lib/utils/zipLoader/browserZipLoader.d.ts.map +1 -0
- package/lib/utils/zipLoader/browserZipLoader.js +247 -0
- package/lib/utils/zipLoader/browserZipLoader.js.map +1 -0
- package/lib/utils/zipLoader/index.d.ts +8 -0
- package/lib/utils/zipLoader/index.d.ts.map +1 -0
- package/lib/utils/zipLoader/index.js +13 -0
- package/lib/utils/zipLoader/index.js.map +1 -0
- package/lib/utils/zipLoader/nodeZipBuilder.d.ts +55 -0
- package/lib/utils/zipLoader/nodeZipBuilder.d.ts.map +1 -0
- package/lib/utils/zipLoader/nodeZipBuilder.js +98 -0
- package/lib/utils/zipLoader/nodeZipBuilder.js.map +1 -0
- package/lib/utils/zipLoader/types.d.ts +139 -0
- package/lib/utils/zipLoader/types.d.ts.map +1 -0
- package/lib/utils/zipLoader/types.js +2 -0
- package/lib/utils/zipLoader/types.js.map +1 -0
- package/lib/utils/zipLoader/zipUtils.d.ts +53 -0
- package/lib/utils/zipLoader/zipUtils.d.ts.map +1 -0
- package/lib/utils/zipLoader/zipUtils.js +229 -0
- package/lib/utils/zipLoader/zipUtils.js.map +1 -0
- package/package.json +69 -0
- package/rush-logs/ts-res-ui-components.build.cache.log +3 -0
- package/rush-logs/ts-res-ui-components.build.log +9 -0
- package/src/components/common/QualifierContextControl.tsx +151 -0
- package/src/components/common/ResourceListView.tsx +63 -0
- package/src/components/common/ResourceTreeView.tsx +271 -0
- package/src/components/forms/HierarchyEditor.tsx +204 -0
- package/src/components/forms/QualifierEditForm.tsx +355 -0
- package/src/components/forms/QualifierTypeEditForm.tsx +347 -0
- package/src/components/forms/ResourceTypeEditForm.tsx +331 -0
- package/src/components/forms/index.ts +11 -0
- package/src/components/orchestrator/ResourceOrchestrator.tsx +372 -0
- package/src/components/views/CompiledView/index.tsx +922 -0
- package/src/components/views/ConfigurationView/index.tsx +800 -0
- package/src/components/views/FilterView/index.tsx +825 -0
- package/src/components/views/ImportView/index.tsx +717 -0
- package/src/components/views/ResolutionView/EditableJsonView.tsx +214 -0
- package/src/components/views/ResolutionView/ResolutionEditControls.tsx +170 -0
- package/src/components/views/ResolutionView/index.tsx +591 -0
- package/src/components/views/SourceView/index.tsx +536 -0
- package/src/components/views/ZipLoaderView/index.tsx +485 -0
- package/src/hooks/useConfigurationState.ts +374 -0
- package/src/hooks/useFilterState.ts +97 -0
- package/src/hooks/useResolutionState.ts +355 -0
- package/src/hooks/useResourceData.ts +467 -0
- package/src/hooks/useViewState.ts +44 -0
- package/src/index.ts +45 -0
- package/src/test/helpers/testDataLoader.ts +195 -0
- package/src/test/unit/utils/configurationUtils.test.ts +630 -0
- package/src/test/unit/utils/fileProcessing.test.ts +391 -0
- package/src/test/unit/utils/filterResources.test.ts +574 -0
- package/src/test/unit/utils/resolutionEditing.test.ts +556 -0
- package/src/test/unit/utils/resolutionUtils.test.ts +521 -0
- package/src/test/unit/utils/tsResIntegration.test.ts +433 -0
- package/src/types/index.ts +322 -0
- package/src/utils/configurationUtils.ts +424 -0
- package/src/utils/fileProcessing.ts +160 -0
- package/src/utils/filterResources.ts +206 -0
- package/src/utils/resolutionEditing.ts +319 -0
- package/src/utils/resolutionUtils.ts +289 -0
- package/src/utils/tsResIntegration.ts +440 -0
- package/src/utils/zipLoader/browserZipLoader.ts +319 -0
- package/src/utils/zipLoader/index.ts +26 -0
- package/src/utils/zipLoader/nodeZipBuilder.ts +153 -0
- package/src/utils/zipLoader/types.ts +175 -0
- package/src/utils/zipLoader/zipUtils.ts +266 -0
- package/temp/build/typescript/ts_gZid87Hu.json +1 -0
- 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';
|