@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/views/ResolutionView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EAGR,UAAU,EAEV,cAAc,EACd,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAC5D,SAAS,EACT,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,mBAAmB,GAAG,EAAE,EACxB,SAAS,EACT,SAAS,GAAG,EAAE,EACf,EAAE,EAAE;IACH,iBAAiB;IACjB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,G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C","sourcesContent":["import React, { useState, useMemo, useCallback } from 'react';\nimport {\n MagnifyingGlassIcon,\n DocumentTextIcon,\n CubeIcon,\n CheckIcon,\n XMarkIcon,\n PencilIcon,\n TrashIcon,\n ListBulletIcon,\n FolderIcon\n} from '@heroicons/react/24/outline';\nimport { ResolutionViewProps, CandidateInfo, ResolutionActions, ResolutionState } from '../../../types';\nimport { QualifierContextControl } from '../../common/QualifierContextControl';\nimport { EditableJsonView } from './EditableJsonView';\nimport { ResolutionEditControls } from './ResolutionEditControls';\nimport { ResourceTreeView } from '../../common/ResourceTreeView';\nimport { ResourceListView } from '../../common/ResourceListView';\n\nexport const ResolutionView: React.FC<ResolutionViewProps> = ({\n resources,\n filterState,\n filterResult,\n resolutionState,\n resolutionActions,\n availableQualifiers = [],\n onMessage,\n className = ''\n}) => {\n // Local UI state\n const [viewMode, setViewMode] = useState<'tree' | 'list'>('list');\n\n // Use filtered resources when filtering is active and successful\n const isFilteringActive = filterState?.enabled && filterResult?.success === true;\n const activeProcessedResources = isFilteringActive ? filterResult?.processedResources : resources;\n\n // Available resources for selection\n const availableResources = useMemo(() => {\n if (!activeProcessedResources?.summary?.resourceIds) {\n return [];\n }\n return activeProcessedResources.summary.resourceIds.sort();\n }, [activeProcessedResources?.summary?.resourceIds]);\n\n // Handle context value changes using the shared component's callback pattern\n const handleQualifierChange = useCallback(\n (qualifierName: string, value: string | undefined) => {\n resolutionActions?.updateContextValue(qualifierName, value);\n },\n [resolutionActions]\n );\n\n // Handle resource selection\n const handleResourceSelect = useCallback(\n (resourceId: string) => {\n resolutionActions?.selectResource(resourceId);\n },\n [resolutionActions]\n );\n\n // Handle view mode change\n const handleViewModeChange = useCallback(\n (mode: 'composed' | 'best' | 'all' | 'raw') => {\n resolutionActions?.setViewMode(mode);\n },\n [resolutionActions]\n );\n\n if (!resources) {\n return (\n <div className={`p-6 ${className}`}>\n <div className=\"flex items-center space-x-3 mb-6\">\n <MagnifyingGlassIcon className=\"h-8 w-8 text-blue-600\" />\n <h2 className=\"text-2xl font-bold text-gray-900\">Resolution Viewer</h2>\n </div>\n\n <div className=\"bg-white rounded-lg shadow-sm border border-gray-200 p-8 text-center\">\n <div className=\"max-w-2xl mx-auto\">\n <h3 className=\"text-xl font-semibold text-gray-900 mb-4\">No Resources Loaded</h3>\n <p className=\"text-gray-600 mb-6\">\n Import resources first to test resource resolution with different contexts.\n </p>\n <div className=\"bg-blue-50 rounded-lg p-4\">\n <p className=\"text-sm text-blue-800\">\n <strong>Resolution Viewer:</strong> Test how resources resolve with different qualifier\n contexts. Set context values and see which candidates match.\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div className={`p-6 ${className}`}>\n <div className=\"flex items-center space-x-3 mb-6\">\n <MagnifyingGlassIcon className=\"h-8 w-8 text-blue-600\" />\n <h2 className=\"text-2xl font-bold text-gray-900\">Resolution Viewer</h2>\n {isFilteringActive && (\n <span className=\"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800\">\n Filtered\n </span>\n )}\n </div>\n\n <div className=\"bg-white rounded-lg shadow-sm border border-gray-200 p-6\">\n {/* Context Configuration Panel */}\n <div className=\"mb-6\">\n <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Context Configuration</h3>\n <div className=\"bg-gray-50 rounded-lg p-4\">\n <div className=\"mb-4\">\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3\">\n {availableQualifiers.map((qualifierName) => (\n <QualifierContextControl\n key={qualifierName}\n qualifierName={qualifierName}\n value={resolutionState?.pendingContextValues[qualifierName]}\n onChange={handleQualifierChange}\n placeholder={`Enter ${qualifierName} value`}\n resources={activeProcessedResources}\n />\n ))}\n </div>\n </div>\n\n <div className=\"flex items-center justify-between\">\n <div className=\"text-sm text-gray-600\">\n Current:{' '}\n {Object.entries(resolutionState?.contextValues || {})\n .map(([key, value]) => `${key}=${value === undefined ? '(undefined)' : value}`)\n .join(', ')}\n </div>\n <div className=\"flex items-center space-x-2\">\n <button\n onClick={resolutionActions?.resetCache}\n className=\"px-3 py-1 text-xs font-medium text-gray-600 bg-gray-100 rounded hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500\"\n title=\"Clear resolution cache\"\n >\n Clear Cache\n </button>\n <button\n onClick={resolutionActions?.applyContext}\n disabled={!resolutionState?.hasPendingChanges}\n className={`px-4 py-2 rounded-md text-sm font-medium ${\n resolutionState?.hasPendingChanges\n ? 'bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500'\n : 'bg-gray-300 text-gray-500 cursor-not-allowed'\n }`}\n >\n {resolutionState?.hasPendingChanges\n ? 'Apply Changes'\n : resolutionState?.currentResolver\n ? 'Context Applied'\n : 'Apply Context'}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n {/* Edit Controls - Show when there are unsaved edits */}\n {resolutionState?.hasUnsavedEdits && (\n <div className=\"mt-6\">\n <ResolutionEditControls\n editCount={resolutionState.editedResources.size}\n isApplying={resolutionState.isApplyingEdits}\n hasEdits={resolutionState.hasUnsavedEdits}\n onApplyEdits={resolutionActions?.applyEdits}\n onDiscardEdits={resolutionActions?.discardEdits}\n disabled={!resolutionState.currentResolver}\n />\n </div>\n )}\n\n {/* Main Browser/Details Layout */}\n <div className=\"flex flex-col lg:flex-row gap-6 h-[600px]\">\n {/* Left side: Resource Selection */}\n <div className=\"lg:w-1/2 flex flex-col\">\n <div className=\"flex items-center justify-between mb-4\">\n <div>\n <h3 className=\"text-lg font-semibold text-gray-900\">Resources</h3>\n <div className=\"text-sm text-gray-500\">{availableResources.length} available</div>\n </div>\n {/* View Mode Toggle */}\n <div className=\"flex items-center space-x-1 bg-gray-100 rounded-lg p-1\">\n <button\n onClick={() => setViewMode('list')}\n className={`flex items-center px-2 py-1 text-xs font-medium rounded ${\n viewMode === 'list'\n ? 'bg-white text-gray-900 shadow-sm'\n : 'text-gray-600 hover:text-gray-900'\n }`}\n title=\"List View\"\n >\n <ListBulletIcon className=\"h-4 w-4\" />\n <span className=\"ml-1\">List</span>\n </button>\n <button\n onClick={() => setViewMode('tree')}\n className={`flex items-center px-2 py-1 text-xs font-medium rounded ${\n viewMode === 'tree'\n ? 'bg-white text-gray-900 shadow-sm'\n : 'text-gray-600 hover:text-gray-900'\n }`}\n title=\"Tree View\"\n >\n <FolderIcon className=\"h-4 w-4\" />\n <span className=\"ml-1\">Tree</span>\n </button>\n </div>\n </div>\n\n <div className=\"flex-1 overflow-y-auto border border-gray-200 rounded-lg bg-gray-50\">\n {viewMode === 'tree' && activeProcessedResources?.system.resourceManager ? (\n <ResourceTreeView\n resources={activeProcessedResources.system.resourceManager}\n selectedResourceId={resolutionState?.selectedResourceId || null}\n onResourceSelect={handleResourceSelect}\n searchTerm=\"\"\n className=\"\"\n />\n ) : (\n availableResources.map((resourceId) => (\n <div\n key={resourceId}\n className={`flex items-center px-3 py-2 cursor-pointer hover:bg-gray-100 ${\n resolutionState?.selectedResourceId === resourceId\n ? 'bg-blue-50 border-r-2 border-blue-500'\n : ''\n }`}\n onClick={() => handleResourceSelect(resourceId)}\n >\n <DocumentTextIcon className=\"w-4 h-4 mr-2 text-green-500\" />\n <span\n className={`text-sm ${\n resolutionState?.selectedResourceId === resourceId\n ? 'font-medium text-blue-900'\n : 'text-gray-700'\n }`}\n >\n {resourceId}\n </span>\n {/* Show edit indicator */}\n {resolutionActions?.hasEdit?.(resourceId) && (\n <span className=\"ml-auto\">\n <PencilIcon className=\"h-3 w-3 text-blue-500\" />\n </span>\n )}\n </div>\n ))\n )}\n </div>\n </div>\n\n {/* Right side: Resolution Results */}\n <div className=\"lg:w-1/2 flex flex-col\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">Results</h3>\n {resolutionState?.selectedResourceId && (\n <div className=\"flex space-x-2\">\n <button\n onClick={() => handleViewModeChange('composed')}\n className={`px-3 py-1 text-xs rounded ${\n resolutionState?.viewMode === 'composed'\n ? 'bg-blue-600 text-white'\n : 'bg-gray-200 text-gray-700'\n }`}\n >\n Composed\n </button>\n <button\n onClick={() => handleViewModeChange('best')}\n className={`px-3 py-1 text-xs rounded ${\n resolutionState?.viewMode === 'best'\n ? 'bg-blue-600 text-white'\n : 'bg-gray-200 text-gray-700'\n }`}\n >\n Best\n </button>\n <button\n onClick={() => handleViewModeChange('all')}\n className={`px-3 py-1 text-xs rounded ${\n resolutionState?.viewMode === 'all'\n ? 'bg-blue-600 text-white'\n : 'bg-gray-200 text-gray-700'\n }`}\n >\n All\n </button>\n <button\n onClick={() => handleViewModeChange('raw')}\n className={`px-3 py-1 text-xs rounded ${\n resolutionState?.viewMode === 'raw'\n ? 'bg-blue-600 text-white'\n : 'bg-gray-200 text-gray-700'\n }`}\n >\n Raw\n </button>\n </div>\n )}\n </div>\n\n <div className=\"flex-1 overflow-y-auto border border-gray-200 rounded-lg p-4 bg-gray-50\">\n {!resolutionState?.selectedResourceId ? (\n <div className=\"flex items-center justify-center h-full\">\n <div className=\"text-center\">\n <CubeIcon className=\"h-12 w-12 text-gray-400 mx-auto mb-4\" />\n <p className=\"text-gray-500\">Select a resource to view resolution results</p>\n </div>\n </div>\n ) : !resolutionState?.currentResolver ? (\n <div className=\"text-center text-gray-500\">\n <p>Apply a context to resolve resources</p>\n </div>\n ) : !resolutionState?.resolutionResult ? (\n <div className=\"text-center text-gray-500\">\n <p>Resolving...</p>\n </div>\n ) : (\n <ResolutionResults\n result={resolutionState.resolutionResult}\n viewMode={resolutionState.viewMode}\n contextValues={resolutionState.contextValues}\n resolutionActions={resolutionActions}\n resolutionState={resolutionState}\n />\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\n// Resolution Results Component (simplified version)\ninterface ResolutionResultsProps {\n result: any;\n viewMode: 'composed' | 'best' | 'all' | 'raw';\n contextValues: Record<string, string | undefined>;\n resolutionActions?: ResolutionActions;\n resolutionState?: ResolutionState;\n}\n\nconst ResolutionResults: React.FC<ResolutionResultsProps> = ({\n result,\n viewMode,\n contextValues,\n resolutionActions,\n resolutionState\n}) => {\n if (!result.success) {\n return (\n <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n <h4 className=\"font-medium text-red-800 mb-2\">Resolution Failed</h4>\n <p className=\"text-sm text-red-600\">{result.error}</p>\n </div>\n );\n }\n\n if (viewMode === 'raw') {\n return (\n <div className=\"space-y-4\">\n <div>\n <h4 className=\"font-medium text-gray-800 mb-2\">Raw Resolution Data</h4>\n <pre className=\"text-xs bg-white p-3 rounded border overflow-x-auto\">\n {JSON.stringify(\n {\n context: contextValues,\n resource: result.resource\n ? {\n id: result.resource.id,\n candidateCount: result.resource.candidates.length\n }\n : null,\n bestCandidate: result.bestCandidate?.json,\n allCandidates: result.allCandidates?.map((c: any) => c.json),\n composedValue: result.composedValue,\n error: result.error\n },\n null,\n 2\n )}\n </pre>\n </div>\n </div>\n );\n }\n\n if (viewMode === 'composed') {\n return (\n <div className=\"space-y-4\">\n {result.composedValue ? (\n <EditableJsonView\n value={result.composedValue}\n resourceId={result.resourceId}\n isEdited={resolutionActions?.hasEdit?.(result.resourceId) || false}\n editedValue={resolutionActions?.getEditedValue?.(result.resourceId)}\n onSave={resolutionActions?.saveEdit}\n onCancel={() => {}} // Could add cancel functionality if needed\n disabled={resolutionState?.isApplyingEdits || false}\n />\n ) : (\n <div className=\"bg-yellow-50 border border-yellow-200 rounded p-3\">\n <p className=\"text-sm text-yellow-800\">No composed value available for the current context.</p>\n {result.error && <p className=\"text-xs text-yellow-600 mt-1\">{result.error}</p>}\n </div>\n )}\n\n {result.resource && (\n <div>\n <h4 className=\"font-medium text-gray-800 mb-2\">Resource Info</h4>\n <div className=\"bg-white p-3 rounded border text-sm\">\n <div>\n <strong>ID:</strong> {result.resource.id}\n </div>\n <div>\n <strong>Type:</strong> {result.resource.resourceType.key}\n </div>\n <div>\n <strong>Total Candidates:</strong> {result.resource.candidates.length}\n </div>\n </div>\n </div>\n )}\n </div>\n );\n }\n\n if (viewMode === 'best') {\n return (\n <div className=\"space-y-4\">\n <div>\n <h4 className=\"font-medium text-gray-800 mb-2\">Best Match</h4>\n {result.bestCandidate ? (\n <div className=\"bg-white p-3 rounded border border-green-200\">\n <div className=\"text-sm font-medium text-gray-700 mb-2\">\n Selected candidate for current context\n </div>\n <pre className=\"text-xs bg-gray-50 p-2 rounded overflow-x-auto\">\n {JSON.stringify(result.bestCandidate.json, null, 2)}\n </pre>\n </div>\n ) : (\n <div className=\"bg-yellow-50 border border-yellow-200 rounded p-3\">\n <p className=\"text-sm text-yellow-800\">No best candidate found for the current context.</p>\n {result.error && <p className=\"text-xs text-yellow-600 mt-1\">{result.error}</p>}\n </div>\n )}\n </div>\n </div>\n );\n }\n\n // 'all' view mode\n const regularMatchingCandidates =\n result.candidateDetails?.filter((c: CandidateInfo) => c.matched && !c.isDefaultMatch) || [];\n const defaultMatchingCandidates =\n result.candidateDetails?.filter((c: CandidateInfo) => c.matched && c.isDefaultMatch) || [];\n const nonMatchingCandidates = result.candidateDetails?.filter((c: CandidateInfo) => !c.matched) || [];\n\n const getMatchTypeColor = (type: string) => {\n switch (type) {\n case 'match':\n return 'bg-green-100 text-green-800';\n case 'matchAsDefault':\n return 'bg-amber-100 text-amber-800';\n case 'noMatch':\n return 'bg-red-100 text-red-800';\n default:\n return 'bg-gray-100 text-gray-800';\n }\n };\n\n const getMatchTypeIcon = (type: string) => {\n switch (type) {\n case 'match':\n return '✓';\n case 'matchAsDefault':\n return '≈';\n case 'noMatch':\n return '✗';\n default:\n return '?';\n }\n };\n\n return (\n <div className=\"space-y-4\">\n {/* Regular Matching Candidates */}\n {regularMatchingCandidates.length > 0 && (\n <div>\n <h4 className=\"font-medium text-gray-800 mb-2\">Regular Matches</h4>\n <div className=\"space-y-2\">\n {regularMatchingCandidates.map((candidateInfo: CandidateInfo, index: number) => (\n <div\n key={`regular-${candidateInfo.candidateIndex}`}\n className=\"bg-white p-3 rounded border border-green-200\"\n >\n <div className=\"flex items-center justify-between mb-2\">\n <div className=\"text-sm font-medium text-gray-700 flex items-center space-x-2\">\n <span>\n Candidate {candidateInfo.candidateIndex + 1} {index === 0 ? '(Best Match)' : ''}\n </span>\n <span\n className={`px-2 py-1 rounded text-xs ${getMatchTypeColor(candidateInfo.matchType)}`}\n >\n {getMatchTypeIcon(candidateInfo.matchType)} {candidateInfo.matchType}\n </span>\n </div>\n </div>\n <pre className=\"text-xs bg-gray-50 p-2 rounded overflow-x-auto\">\n {JSON.stringify(candidateInfo.candidate.json, null, 2)}\n </pre>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Default Matching Candidates */}\n {defaultMatchingCandidates.length > 0 && (\n <div>\n <h4 className=\"font-medium text-gray-800 mb-2\">Default Matches</h4>\n <div className=\"space-y-2\">\n {defaultMatchingCandidates.map((candidateInfo: CandidateInfo) => (\n <div\n key={`default-${candidateInfo.candidateIndex}`}\n className=\"bg-white p-3 rounded border border-amber-200\"\n >\n <div className=\"flex items-center justify-between mb-2\">\n <div className=\"text-sm font-medium text-gray-700 flex items-center space-x-2\">\n <span>Candidate {candidateInfo.candidateIndex + 1}</span>\n <span\n className={`px-2 py-1 rounded text-xs ${getMatchTypeColor(candidateInfo.matchType)}`}\n >\n {getMatchTypeIcon(candidateInfo.matchType)} {candidateInfo.matchType}\n </span>\n </div>\n </div>\n <pre className=\"text-xs bg-gray-50 p-2 rounded overflow-x-auto\">\n {JSON.stringify(candidateInfo.candidate.json, null, 2)}\n </pre>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Show message when no matches */}\n {regularMatchingCandidates.length === 0 && defaultMatchingCandidates.length === 0 && (\n <div>\n <h4 className=\"font-medium text-gray-800 mb-2\">Matching Candidates</h4>\n <p className=\"text-sm text-gray-600\">No candidates matched the current context.</p>\n </div>\n )}\n\n {/* Non-matching Candidates */}\n {nonMatchingCandidates.length > 0 && (\n <div>\n <h4 className=\"font-medium text-gray-500 mb-2\">Non-matching Candidates</h4>\n <div className=\"space-y-2\">\n {nonMatchingCandidates.slice(0, 3).map((candidateInfo: CandidateInfo) => (\n <div\n key={`non-matching-${candidateInfo.candidateIndex}`}\n className=\"bg-gray-50 p-3 rounded border border-gray-200 opacity-75\"\n >\n <div className=\"text-sm font-medium text-gray-500 mb-2\">\n Candidate {candidateInfo.candidateIndex + 1}\n </div>\n <pre className=\"text-xs bg-gray-100 p-2 rounded overflow-x-auto text-gray-600\">\n {JSON.stringify(candidateInfo.candidate.json, null, 2)}\n </pre>\n </div>\n ))}\n {nonMatchingCandidates.length > 3 && (\n <div className=\"text-center text-sm text-gray-500\">\n ... and {nonMatchingCandidates.length - 3} more non-matching candidates\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default ResolutionView;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/views/SourceView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAW9D,OAAO,EAAE,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AAIrE,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyQhD,CAAC;AA+PF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import React, { useState, useMemo, useCallback } from 'react';
|
|
2
|
+
import { DocumentTextIcon, MagnifyingGlassIcon, DocumentArrowDownIcon, CodeBracketIcon, ChevronDownIcon, ChevronUpIcon, ListBulletIcon, FolderIcon } from '@heroicons/react/24/outline';
|
|
3
|
+
import { ResourceTreeView } from '../../common/ResourceTreeView';
|
|
4
|
+
import { ResourceListView } from '../../common/ResourceListView';
|
|
5
|
+
export const SourceView = ({ resources, onExport, onMessage, className = '' }) => {
|
|
6
|
+
const [selectedResourceId, setSelectedResourceId] = useState(null);
|
|
7
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
8
|
+
const [showJsonView, setShowJsonView] = useState(false);
|
|
9
|
+
const [viewMode, setViewMode] = useState('list');
|
|
10
|
+
// Sort and filter resource IDs
|
|
11
|
+
const filteredResourceIds = useMemo(() => {
|
|
12
|
+
if (!resources?.summary.resourceIds) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const resourceIds = resources.summary.resourceIds;
|
|
16
|
+
// Filter by search term
|
|
17
|
+
const filtered = searchTerm
|
|
18
|
+
? resourceIds.filter((id) => id.toLowerCase().includes(searchTerm.toLowerCase()))
|
|
19
|
+
: resourceIds;
|
|
20
|
+
// Sort alphabetically
|
|
21
|
+
return filtered.sort();
|
|
22
|
+
}, [resources?.summary.resourceIds, searchTerm]);
|
|
23
|
+
const handleResourceSelect = (resourceId) => {
|
|
24
|
+
setSelectedResourceId(resourceId);
|
|
25
|
+
onMessage?.('info', `Selected resource: ${resourceId}`);
|
|
26
|
+
};
|
|
27
|
+
const handleSearch = (term) => {
|
|
28
|
+
setSearchTerm(term);
|
|
29
|
+
setSelectedResourceId(null); // Clear selection when searching
|
|
30
|
+
};
|
|
31
|
+
// Get full resource collection data using the new method
|
|
32
|
+
const getResourceCollectionData = useCallback(() => {
|
|
33
|
+
if (!resources?.system.resourceManager) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
// Check if this is a ResourceManagerBuilder (has getResourceCollectionDecl method)
|
|
37
|
+
if ('getResourceCollectionDecl' in resources.system.resourceManager) {
|
|
38
|
+
const collectionResult = resources.system.resourceManager.getResourceCollectionDecl();
|
|
39
|
+
if (collectionResult.isSuccess()) {
|
|
40
|
+
return {
|
|
41
|
+
...collectionResult.value,
|
|
42
|
+
metadata: {
|
|
43
|
+
exportedAt: new Date().toISOString(),
|
|
44
|
+
totalResources: resources.summary.totalResources,
|
|
45
|
+
type: 'ts-res-resource-collection'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
onMessage?.('error', `Failed to get resource collection: ${collectionResult.message}`);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (resources.compiledCollection) {
|
|
55
|
+
// For IResourceManager from bundles, use the compiled collection directly
|
|
56
|
+
return {
|
|
57
|
+
resources: resources.compiledCollection.resources || [],
|
|
58
|
+
metadata: {
|
|
59
|
+
exportedAt: new Date().toISOString(),
|
|
60
|
+
totalResources: resources.summary.totalResources,
|
|
61
|
+
type: 'ts-res-resource-collection'
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
onMessage?.('error', 'Resource collection data not available');
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}, [resources, onMessage]);
|
|
70
|
+
// Export source data to JSON file
|
|
71
|
+
const handleExportSourceData = useCallback(() => {
|
|
72
|
+
try {
|
|
73
|
+
const collectionData = getResourceCollectionData();
|
|
74
|
+
if (!collectionData) {
|
|
75
|
+
onMessage?.('error', 'No source collection data available to export');
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
onExport?.(collectionData, 'json');
|
|
79
|
+
onMessage?.('success', 'Resource collection exported successfully');
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
onMessage?.('error', `Failed to export resource collection: ${error instanceof Error ? error.message : String(error)}`);
|
|
83
|
+
}
|
|
84
|
+
}, [getResourceCollectionData, onExport, onMessage]);
|
|
85
|
+
if (!resources) {
|
|
86
|
+
return (React.createElement("div", { className: `p-6 ${className}` },
|
|
87
|
+
React.createElement("div", { className: "flex items-center space-x-3 mb-6" },
|
|
88
|
+
React.createElement(DocumentTextIcon, { className: "h-8 w-8 text-blue-600" }),
|
|
89
|
+
React.createElement("h2", { className: "text-2xl font-bold text-gray-900" }, "Source Browser")),
|
|
90
|
+
React.createElement("div", { className: "bg-white rounded-lg shadow-sm border border-gray-200 p-8 text-center" },
|
|
91
|
+
React.createElement("div", { className: "max-w-2xl mx-auto" },
|
|
92
|
+
React.createElement("h3", { className: "text-xl font-semibold text-gray-900 mb-4" }, "No Resources Loaded"),
|
|
93
|
+
React.createElement("p", { className: "text-gray-600 mb-6" }, "Import resources to explore them here."),
|
|
94
|
+
React.createElement("div", { className: "bg-blue-50 rounded-lg p-4" },
|
|
95
|
+
React.createElement("p", { className: "text-sm text-blue-800" },
|
|
96
|
+
React.createElement("strong", null, "Tip:"),
|
|
97
|
+
" Use the Import View to load ts-res resource files or directories, then return here to browse and explore the loaded resources."))))));
|
|
98
|
+
}
|
|
99
|
+
return (React.createElement("div", { className: `p-6 ${className}` },
|
|
100
|
+
React.createElement("div", { className: "flex items-center justify-between mb-6" },
|
|
101
|
+
React.createElement("div", { className: "flex items-center space-x-3" },
|
|
102
|
+
React.createElement(DocumentTextIcon, { className: "h-8 w-8 text-blue-600" }),
|
|
103
|
+
React.createElement("h2", { className: "text-2xl font-bold text-gray-900" }, "Source Browser")),
|
|
104
|
+
resources && (React.createElement("div", { className: "flex items-center space-x-2" },
|
|
105
|
+
React.createElement("button", { onClick: handleExportSourceData, className: "inline-flex items-center px-3 py-1.5 border border-gray-300 text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" },
|
|
106
|
+
React.createElement(DocumentArrowDownIcon, { className: "h-4 w-4 mr-1" }),
|
|
107
|
+
"Export JSON")))),
|
|
108
|
+
resources && (React.createElement("div", { className: "bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-6" },
|
|
109
|
+
React.createElement("button", { onClick: () => setShowJsonView(!showJsonView), className: "inline-flex items-center px-3 py-1.5 text-sm font-medium text-gray-700 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" },
|
|
110
|
+
React.createElement(CodeBracketIcon, { className: "h-4 w-4 mr-2" }),
|
|
111
|
+
showJsonView ? 'Hide' : 'Show',
|
|
112
|
+
" JSON Resource Collection",
|
|
113
|
+
showJsonView ? (React.createElement(ChevronUpIcon, { className: "h-4 w-4 ml-2" })) : (React.createElement(ChevronDownIcon, { className: "h-4 w-4 ml-2" }))),
|
|
114
|
+
showJsonView && (React.createElement("div", { className: "mt-4" },
|
|
115
|
+
React.createElement("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-4" },
|
|
116
|
+
React.createElement("div", { className: "flex items-center justify-between mb-2" },
|
|
117
|
+
React.createElement("h3", { className: "text-sm font-medium text-gray-900" }, "Resource Collection (JSON)"),
|
|
118
|
+
React.createElement("button", { onClick: handleExportSourceData, className: "inline-flex items-center px-2 py-1 text-xs font-medium text-gray-700 bg-gray-100 rounded hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" },
|
|
119
|
+
React.createElement(DocumentArrowDownIcon, { className: "h-3 w-3 mr-1" }),
|
|
120
|
+
"Export")),
|
|
121
|
+
React.createElement("pre", { className: "text-xs text-gray-800 bg-white p-3 rounded border overflow-x-auto max-h-64 overflow-y-auto" }, JSON.stringify(getResourceCollectionData(), null, 2))))))),
|
|
122
|
+
React.createElement("div", { className: "bg-white rounded-lg shadow-sm border border-gray-200 p-6" },
|
|
123
|
+
React.createElement("div", { className: "flex flex-col lg:flex-row gap-6 h-[600px]" },
|
|
124
|
+
React.createElement("div", { className: "lg:w-1/2 flex flex-col" },
|
|
125
|
+
React.createElement("div", { className: "flex items-center justify-between mb-4" },
|
|
126
|
+
React.createElement("h3", { className: "text-lg font-semibold text-gray-900" },
|
|
127
|
+
"Resources (",
|
|
128
|
+
filteredResourceIds.length,
|
|
129
|
+
")"),
|
|
130
|
+
React.createElement("div", { className: "flex items-center space-x-1 bg-gray-100 rounded-lg p-1" },
|
|
131
|
+
React.createElement("button", { onClick: () => setViewMode('list'), className: `flex items-center px-2 py-1 text-xs font-medium rounded ${viewMode === 'list'
|
|
132
|
+
? 'bg-white text-gray-900 shadow-sm'
|
|
133
|
+
: 'text-gray-600 hover:text-gray-900'}`, title: "List View" },
|
|
134
|
+
React.createElement(ListBulletIcon, { className: "h-4 w-4" }),
|
|
135
|
+
React.createElement("span", { className: "ml-1" }, "List")),
|
|
136
|
+
React.createElement("button", { onClick: () => setViewMode('tree'), className: `flex items-center px-2 py-1 text-xs font-medium rounded ${viewMode === 'tree'
|
|
137
|
+
? 'bg-white text-gray-900 shadow-sm'
|
|
138
|
+
: 'text-gray-600 hover:text-gray-900'}`, title: "Tree View" },
|
|
139
|
+
React.createElement(FolderIcon, { className: "h-4 w-4" }),
|
|
140
|
+
React.createElement("span", { className: "ml-1" }, "Tree")))),
|
|
141
|
+
React.createElement("div", { className: "relative mb-4" },
|
|
142
|
+
React.createElement(MagnifyingGlassIcon, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
143
|
+
React.createElement("input", { type: "text", placeholder: "Search resources...", value: searchTerm, onChange: (e) => handleSearch(e.target.value), className: "w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" })),
|
|
144
|
+
React.createElement("div", { className: "flex-1 overflow-y-auto border border-gray-200 rounded-lg bg-gray-50" }, viewMode === 'tree' && resources?.system.resourceManager ? (React.createElement(ResourceTreeView, { resources: resources.system.resourceManager, selectedResourceId: selectedResourceId, onResourceSelect: handleResourceSelect, searchTerm: searchTerm, className: "" })) : (React.createElement(ResourceListView, { resourceIds: filteredResourceIds, selectedResourceId: selectedResourceId, onResourceSelect: handleResourceSelect, searchTerm: searchTerm, className: "" })))),
|
|
145
|
+
React.createElement("div", { className: "lg:w-1/2 flex flex-col" }, selectedResourceId ? (React.createElement(ResourceDetail, { resourceId: selectedResourceId, processedResources: resources, onMessage: onMessage })) : (React.createElement("div", { className: "flex-1 flex items-center justify-center border border-gray-200 rounded-lg bg-gray-50" },
|
|
146
|
+
React.createElement("div", { className: "text-center" },
|
|
147
|
+
React.createElement(DocumentTextIcon, { className: "h-12 w-12 text-gray-400 mx-auto mb-4" }),
|
|
148
|
+
React.createElement("p", { className: "text-gray-500" }, "Select a resource to view details")))))))));
|
|
149
|
+
};
|
|
150
|
+
const ResourceDetail = ({ resourceId, processedResources, onMessage }) => {
|
|
151
|
+
const [resourceDetail, setResourceDetail] = useState(null);
|
|
152
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
153
|
+
const [error, setError] = useState(null);
|
|
154
|
+
React.useEffect(() => {
|
|
155
|
+
const loadResourceDetail = () => {
|
|
156
|
+
setIsLoading(true);
|
|
157
|
+
setError(null);
|
|
158
|
+
try {
|
|
159
|
+
const resourceManager = processedResources.system.resourceManager;
|
|
160
|
+
const resourceResult = resourceManager.getBuiltResource(resourceId);
|
|
161
|
+
if (resourceResult.isSuccess()) {
|
|
162
|
+
const resource = resourceResult.value;
|
|
163
|
+
// Handle different resource formats (ResourceManagerBuilder vs IResourceManager)
|
|
164
|
+
let candidateDetails = [];
|
|
165
|
+
// Check if candidates have conditions property (ResourceManagerBuilder format)
|
|
166
|
+
if (resource.candidates.length > 0 && 'conditions' in resource.candidates[0]) {
|
|
167
|
+
// ResourceManagerBuilder format with full condition details
|
|
168
|
+
candidateDetails = resource.candidates.map((candidate) => ({
|
|
169
|
+
json: candidate.json,
|
|
170
|
+
conditions: candidate.conditions?.conditions?.map((condition) => ({
|
|
171
|
+
qualifier: condition.qualifier.name,
|
|
172
|
+
operator: condition.operator,
|
|
173
|
+
value: condition.value,
|
|
174
|
+
priority: condition.priority,
|
|
175
|
+
scoreAsDefault: condition.scoreAsDefault
|
|
176
|
+
})) || [],
|
|
177
|
+
isPartial: candidate.isPartial,
|
|
178
|
+
mergeMethod: candidate.mergeMethod
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
// IResourceManager format - extract conditions from compiled collection
|
|
183
|
+
const compiledCollection = processedResources.compiledCollection;
|
|
184
|
+
const compiledResource = compiledCollection?.resources?.find((r) => r.id === resourceId);
|
|
185
|
+
candidateDetails = resource.candidates.map((candidate, index) => {
|
|
186
|
+
// Try to get conditions from the compiled collection
|
|
187
|
+
let conditions = [];
|
|
188
|
+
if (compiledResource && compiledCollection) {
|
|
189
|
+
const decision = compiledCollection.decisions?.[compiledResource.decision];
|
|
190
|
+
if (decision?.conditionSets && index < decision.conditionSets.length) {
|
|
191
|
+
const conditionSetIndex = decision.conditionSets[index];
|
|
192
|
+
const conditionSet = compiledCollection.conditionSets?.[conditionSetIndex];
|
|
193
|
+
if (conditionSet?.conditions) {
|
|
194
|
+
conditions = conditionSet.conditions
|
|
195
|
+
.map((condIndex) => {
|
|
196
|
+
const condition = compiledCollection.conditions?.[condIndex];
|
|
197
|
+
const qualifier = compiledCollection.qualifiers?.[condition?.qualifierIndex];
|
|
198
|
+
return condition && qualifier
|
|
199
|
+
? {
|
|
200
|
+
qualifier: qualifier.name,
|
|
201
|
+
operator: condition.operator || 'eq',
|
|
202
|
+
value: condition.value,
|
|
203
|
+
priority: condition.priority || qualifier.defaultPriority || 500,
|
|
204
|
+
scoreAsDefault: condition.scoreAsDefault
|
|
205
|
+
}
|
|
206
|
+
: null;
|
|
207
|
+
})
|
|
208
|
+
.filter(Boolean);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
json: candidate.json,
|
|
214
|
+
conditions: conditions,
|
|
215
|
+
isPartial: candidate.isPartial,
|
|
216
|
+
mergeMethod: candidate.mergeMethod
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
const detail = {
|
|
221
|
+
id: resource.id,
|
|
222
|
+
resourceType: resource.resourceType.key || resource.resourceType.name || 'unknown',
|
|
223
|
+
candidateCount: resource.candidates.length,
|
|
224
|
+
candidates: candidateDetails
|
|
225
|
+
};
|
|
226
|
+
setResourceDetail(detail);
|
|
227
|
+
onMessage?.('info', `Loaded details for resource: ${resourceId}`);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
setError(`Failed to load resource details: ${resourceResult.message}`);
|
|
231
|
+
onMessage?.('error', `Failed to load resource details: ${resourceResult.message}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
catch (err) {
|
|
235
|
+
const errorMsg = `Error loading resource details: ${err instanceof Error ? err.message : String(err)}`;
|
|
236
|
+
setError(errorMsg);
|
|
237
|
+
onMessage?.('error', errorMsg);
|
|
238
|
+
}
|
|
239
|
+
finally {
|
|
240
|
+
setIsLoading(false);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
loadResourceDetail();
|
|
244
|
+
}, [resourceId, processedResources, onMessage]);
|
|
245
|
+
if (isLoading) {
|
|
246
|
+
return (React.createElement("div", { className: "flex flex-col h-full" },
|
|
247
|
+
React.createElement("h3", { className: "text-lg font-semibold text-gray-900 mb-4" }, "Resource Details"),
|
|
248
|
+
React.createElement("div", { className: "flex-1 flex items-center justify-center border border-gray-200 rounded-lg bg-gray-50" },
|
|
249
|
+
React.createElement("div", { className: "text-center" },
|
|
250
|
+
React.createElement("div", { className: "animate-spin h-8 w-8 border-4 border-blue-600 border-t-transparent rounded-full mx-auto mb-4" }),
|
|
251
|
+
React.createElement("p", { className: "text-gray-500" }, "Loading resource details...")))));
|
|
252
|
+
}
|
|
253
|
+
if (error) {
|
|
254
|
+
return (React.createElement("div", { className: "flex flex-col h-full" },
|
|
255
|
+
React.createElement("h3", { className: "text-lg font-semibold text-gray-900 mb-4" }, "Resource Details"),
|
|
256
|
+
React.createElement("div", { className: "flex-1 border border-gray-200 rounded-lg p-4 bg-red-50" },
|
|
257
|
+
React.createElement("div", { className: "text-center" },
|
|
258
|
+
React.createElement("p", { className: "text-red-600 font-medium mb-2" }, "Error Loading Resource"),
|
|
259
|
+
React.createElement("p", { className: "text-red-500 text-sm" }, error)))));
|
|
260
|
+
}
|
|
261
|
+
if (!resourceDetail) {
|
|
262
|
+
return (React.createElement("div", { className: "flex flex-col h-full" },
|
|
263
|
+
React.createElement("h3", { className: "text-lg font-semibold text-gray-900 mb-4" }, "Resource Details"),
|
|
264
|
+
React.createElement("div", { className: "flex-1 flex items-center justify-center border border-gray-200 rounded-lg bg-gray-50" },
|
|
265
|
+
React.createElement("p", { className: "text-gray-500" }, "No resource details available"))));
|
|
266
|
+
}
|
|
267
|
+
return (React.createElement("div", { className: "flex flex-col h-full" },
|
|
268
|
+
React.createElement("h3", { className: "text-lg font-semibold text-gray-900 mb-4" }, "Resource Details"),
|
|
269
|
+
React.createElement("div", { className: "flex-1 overflow-y-auto border border-gray-200 rounded-lg p-4 bg-gray-50" },
|
|
270
|
+
React.createElement("div", { className: "space-y-6" },
|
|
271
|
+
React.createElement("div", null,
|
|
272
|
+
React.createElement("h4", { className: "font-medium text-gray-700 mb-3" }, "Resource Overview"),
|
|
273
|
+
React.createElement("div", { className: "bg-white p-4 rounded-lg border space-y-3" },
|
|
274
|
+
React.createElement("div", null,
|
|
275
|
+
React.createElement("span", { className: "text-sm font-medium text-gray-600" }, "Fully Qualified ID:"),
|
|
276
|
+
React.createElement("code", { className: "text-sm bg-gray-100 px-2 py-1 rounded ml-2 break-all" }, resourceDetail.id)),
|
|
277
|
+
React.createElement("div", null,
|
|
278
|
+
React.createElement("span", { className: "text-sm font-medium text-gray-600" }, "Resource Type:"),
|
|
279
|
+
React.createElement("span", { className: "ml-2 text-sm" }, resourceDetail.resourceType)),
|
|
280
|
+
React.createElement("div", null,
|
|
281
|
+
React.createElement("span", { className: "text-sm font-medium text-gray-600" }, "Candidate Count:"),
|
|
282
|
+
React.createElement("span", { className: "ml-2 text-sm font-medium text-blue-600" }, resourceDetail.candidateCount)))),
|
|
283
|
+
React.createElement("div", null,
|
|
284
|
+
React.createElement("h4", { className: "font-medium text-gray-700 mb-3" },
|
|
285
|
+
"Candidates (",
|
|
286
|
+
resourceDetail.candidates.length,
|
|
287
|
+
")"),
|
|
288
|
+
React.createElement("div", { className: "space-y-4" }, resourceDetail.candidates.map((candidate, index) => (React.createElement("div", { key: index, className: "bg-white p-4 rounded-lg border" },
|
|
289
|
+
React.createElement("div", { className: "flex items-center justify-between mb-3" },
|
|
290
|
+
React.createElement("h5", { className: "font-medium text-gray-800" },
|
|
291
|
+
"Candidate ",
|
|
292
|
+
index + 1),
|
|
293
|
+
React.createElement("div", { className: "flex items-center space-x-2 text-xs" },
|
|
294
|
+
candidate.isPartial && (React.createElement("span", { className: "bg-yellow-100 text-yellow-800 px-2 py-1 rounded" }, "Partial")),
|
|
295
|
+
React.createElement("span", { className: "bg-gray-100 text-gray-700 px-2 py-1 rounded" }, candidate.mergeMethod))),
|
|
296
|
+
candidate.conditions.length > 0 && (React.createElement("div", { className: "mb-3" },
|
|
297
|
+
React.createElement("h6", { className: "text-sm font-medium text-gray-600 mb-2" }, "Conditions:"),
|
|
298
|
+
React.createElement("div", { className: "space-y-1" }, candidate.conditions.map((condition, condIndex) => (React.createElement("div", { key: condIndex, className: "flex items-center text-xs bg-blue-50 px-2 py-1 rounded" },
|
|
299
|
+
React.createElement("span", { className: "font-medium text-blue-800" }, condition.qualifier),
|
|
300
|
+
React.createElement("span", { className: "mx-1 text-blue-600" }, condition.operator),
|
|
301
|
+
React.createElement("span", { className: "text-blue-700" }, condition.value),
|
|
302
|
+
React.createElement("div", { className: "ml-auto flex items-center space-x-2" },
|
|
303
|
+
React.createElement("span", { className: "text-blue-500" },
|
|
304
|
+
"priority: ",
|
|
305
|
+
condition.priority),
|
|
306
|
+
condition.scoreAsDefault !== undefined && (React.createElement("span", { className: "text-amber-600 font-medium" },
|
|
307
|
+
"default: ",
|
|
308
|
+
condition.scoreAsDefault))))))))),
|
|
309
|
+
candidate.conditions.length === 0 && (React.createElement("div", { className: "mb-3" },
|
|
310
|
+
React.createElement("span", { className: "text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded" }, "No conditions (default candidate)"))),
|
|
311
|
+
React.createElement("div", null,
|
|
312
|
+
React.createElement("h6", { className: "text-sm font-medium text-gray-600 mb-2" }, "Content:"),
|
|
313
|
+
React.createElement("pre", { className: "text-xs bg-gray-50 p-3 rounded border overflow-x-auto max-h-40" }, JSON.stringify(candidate.json, null, 2))))))))))));
|
|
314
|
+
};
|
|
315
|
+
export default SourceView;
|
|
316
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/views/SourceView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE;IAC1G,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAClF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACjD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAkB,MAAM,CAAC,CAAC;IAElE,+BAA+B;IAC/B,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE;QACvC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;YACpC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;QAElD,wBAAwB;QACxB,MAAM,QAAQ,GAAG,UAAU;YACzB,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC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AC5E,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CACpC,CACF,CACF,CACP,CAAC,CACE,CACF,CACF,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import React, { useState, useMemo, useCallback } from 'react';\nimport {\n DocumentTextIcon,\n MagnifyingGlassIcon,\n DocumentArrowDownIcon,\n CodeBracketIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n ListBulletIcon,\n FolderIcon\n} from '@heroicons/react/24/outline';\nimport { SourceViewProps, ResourceDetailData } from '../../../types';\nimport { ResourceTreeView } from '../../common/ResourceTreeView';\nimport { ResourceListView } from '../../common/ResourceListView';\n\nexport const SourceView: React.FC<SourceViewProps> = ({ resources, onExport, onMessage, className = '' }) => {\n const [selectedResourceId, setSelectedResourceId] = useState<string | null>(null);\n const [searchTerm, setSearchTerm] = useState('');\n const [showJsonView, setShowJsonView] = useState(false);\n const [viewMode, setViewMode] = useState<'tree' | 'list'>('list');\n\n // Sort and filter resource IDs\n const filteredResourceIds = useMemo(() => {\n if (!resources?.summary.resourceIds) {\n return [];\n }\n\n const resourceIds = resources.summary.resourceIds;\n\n // Filter by search term\n const filtered = searchTerm\n ? resourceIds.filter((id: string) => id.toLowerCase().includes(searchTerm.toLowerCase()))\n : resourceIds;\n\n // Sort alphabetically\n return filtered.sort();\n }, [resources?.summary.resourceIds, searchTerm]);\n\n const handleResourceSelect = (resourceId: string) => {\n setSelectedResourceId(resourceId);\n onMessage?.('info', `Selected resource: ${resourceId}`);\n };\n\n const handleSearch = (term: string) => {\n setSearchTerm(term);\n setSelectedResourceId(null); // Clear selection when searching\n };\n\n // Get full resource collection data using the new method\n const getResourceCollectionData = useCallback(() => {\n if (!resources?.system.resourceManager) {\n return null;\n }\n\n // Check if this is a ResourceManagerBuilder (has getResourceCollectionDecl method)\n if ('getResourceCollectionDecl' in resources.system.resourceManager) {\n const collectionResult = (resources.system.resourceManager as any).getResourceCollectionDecl();\n if (collectionResult.isSuccess()) {\n return {\n ...collectionResult.value,\n metadata: {\n exportedAt: new Date().toISOString(),\n totalResources: resources.summary.totalResources,\n type: 'ts-res-resource-collection'\n }\n };\n } else {\n onMessage?.('error', `Failed to get resource collection: ${collectionResult.message}`);\n return null;\n }\n } else if (resources.compiledCollection) {\n // For IResourceManager from bundles, use the compiled collection directly\n return {\n resources: resources.compiledCollection.resources || [],\n metadata: {\n exportedAt: new Date().toISOString(),\n totalResources: resources.summary.totalResources,\n type: 'ts-res-resource-collection'\n }\n };\n } else {\n onMessage?.('error', 'Resource collection data not available');\n return null;\n }\n }, [resources, onMessage]);\n\n // Export source data to JSON file\n const handleExportSourceData = useCallback(() => {\n try {\n const collectionData = getResourceCollectionData();\n if (!collectionData) {\n onMessage?.('error', 'No source collection data available to export');\n return;\n }\n\n onExport?.(collectionData, 'json');\n onMessage?.('success', 'Resource collection exported successfully');\n } catch (error) {\n onMessage?.(\n 'error',\n `Failed to export resource collection: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }, [getResourceCollectionData, onExport, onMessage]);\n\n if (!resources) {\n return (\n <div className={`p-6 ${className}`}>\n <div className=\"flex items-center space-x-3 mb-6\">\n <DocumentTextIcon className=\"h-8 w-8 text-blue-600\" />\n <h2 className=\"text-2xl font-bold text-gray-900\">Source Browser</h2>\n </div>\n\n <div className=\"bg-white rounded-lg shadow-sm border border-gray-200 p-8 text-center\">\n <div className=\"max-w-2xl mx-auto\">\n <h3 className=\"text-xl font-semibold text-gray-900 mb-4\">No Resources Loaded</h3>\n <p className=\"text-gray-600 mb-6\">Import resources to explore them here.</p>\n <div className=\"bg-blue-50 rounded-lg p-4\">\n <p className=\"text-sm text-blue-800\">\n <strong>Tip:</strong> Use the Import View to load ts-res resource files or directories, then\n return here to browse and explore the loaded resources.\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div className={`p-6 ${className}`}>\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center space-x-3\">\n <DocumentTextIcon className=\"h-8 w-8 text-blue-600\" />\n <h2 className=\"text-2xl font-bold text-gray-900\">Source Browser</h2>\n </div>\n {resources && (\n <div className=\"flex items-center space-x-2\">\n <button\n onClick={handleExportSourceData}\n className=\"inline-flex items-center px-3 py-1.5 border border-gray-300 text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500\"\n >\n <DocumentArrowDownIcon className=\"h-4 w-4 mr-1\" />\n Export JSON\n </button>\n </div>\n )}\n </div>\n\n {/* JSON View Toggle */}\n {resources && (\n <div className=\"bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-6\">\n <button\n onClick={() => setShowJsonView(!showJsonView)}\n className=\"inline-flex items-center px-3 py-1.5 text-sm font-medium text-gray-700 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500\"\n >\n <CodeBracketIcon className=\"h-4 w-4 mr-2\" />\n {showJsonView ? 'Hide' : 'Show'} JSON Resource Collection\n {showJsonView ? (\n <ChevronUpIcon className=\"h-4 w-4 ml-2\" />\n ) : (\n <ChevronDownIcon className=\"h-4 w-4 ml-2\" />\n )}\n </button>\n\n {/* JSON View */}\n {showJsonView && (\n <div className=\"mt-4\">\n <div className=\"bg-gray-50 rounded-lg border border-gray-200 p-4\">\n <div className=\"flex items-center justify-between mb-2\">\n <h3 className=\"text-sm font-medium text-gray-900\">Resource Collection (JSON)</h3>\n <button\n onClick={handleExportSourceData}\n className=\"inline-flex items-center px-2 py-1 text-xs font-medium text-gray-700 bg-gray-100 rounded hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500\"\n >\n <DocumentArrowDownIcon className=\"h-3 w-3 mr-1\" />\n Export\n </button>\n </div>\n <pre className=\"text-xs text-gray-800 bg-white p-3 rounded border overflow-x-auto max-h-64 overflow-y-auto\">\n {JSON.stringify(getResourceCollectionData(), null, 2)}\n </pre>\n </div>\n </div>\n )}\n </div>\n )}\n\n <div className=\"bg-white rounded-lg shadow-sm border border-gray-200 p-6\">\n <div className=\"flex flex-col lg:flex-row gap-6 h-[600px]\">\n {/* Left side: Resource List */}\n <div className=\"lg:w-1/2 flex flex-col\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\n Resources ({filteredResourceIds.length})\n </h3>\n {/* View Mode Toggle */}\n <div className=\"flex items-center space-x-1 bg-gray-100 rounded-lg p-1\">\n <button\n onClick={() => setViewMode('list')}\n className={`flex items-center px-2 py-1 text-xs font-medium rounded ${\n viewMode === 'list'\n ? 'bg-white text-gray-900 shadow-sm'\n : 'text-gray-600 hover:text-gray-900'\n }`}\n title=\"List View\"\n >\n <ListBulletIcon className=\"h-4 w-4\" />\n <span className=\"ml-1\">List</span>\n </button>\n <button\n onClick={() => setViewMode('tree')}\n className={`flex items-center px-2 py-1 text-xs font-medium rounded ${\n viewMode === 'tree'\n ? 'bg-white text-gray-900 shadow-sm'\n : 'text-gray-600 hover:text-gray-900'\n }`}\n title=\"Tree View\"\n >\n <FolderIcon className=\"h-4 w-4\" />\n <span className=\"ml-1\">Tree</span>\n </button>\n </div>\n </div>\n\n {/* Search Box */}\n <div className=\"relative mb-4\">\n <MagnifyingGlassIcon className=\"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400\" />\n <input\n type=\"text\"\n placeholder=\"Search resources...\"\n value={searchTerm}\n onChange={(e) => handleSearch(e.target.value)}\n className=\"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\"\n />\n </div>\n\n {/* Resource List or Tree */}\n <div className=\"flex-1 overflow-y-auto border border-gray-200 rounded-lg bg-gray-50\">\n {viewMode === 'tree' && resources?.system.resourceManager ? (\n <ResourceTreeView\n resources={resources.system.resourceManager}\n selectedResourceId={selectedResourceId}\n onResourceSelect={handleResourceSelect}\n searchTerm={searchTerm}\n className=\"\"\n />\n ) : (\n <ResourceListView\n resourceIds={filteredResourceIds}\n selectedResourceId={selectedResourceId}\n onResourceSelect={handleResourceSelect}\n searchTerm={searchTerm}\n className=\"\"\n />\n )}\n </div>\n </div>\n\n {/* Right side: Resource Details */}\n <div className=\"lg:w-1/2 flex flex-col\">\n {selectedResourceId ? (\n <ResourceDetail\n resourceId={selectedResourceId}\n processedResources={resources}\n onMessage={onMessage}\n />\n ) : (\n <div className=\"flex-1 flex items-center justify-center border border-gray-200 rounded-lg bg-gray-50\">\n <div className=\"text-center\">\n <DocumentTextIcon className=\"h-12 w-12 text-gray-400 mx-auto mb-4\" />\n <p className=\"text-gray-500\">Select a resource to view details</p>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n};\n\ninterface ResourceDetailProps {\n resourceId: string;\n processedResources: any;\n onMessage?: (type: 'info' | 'warning' | 'error' | 'success', message: string) => void;\n}\n\nconst ResourceDetail: React.FC<ResourceDetailProps> = ({ resourceId, processedResources, onMessage }) => {\n const [resourceDetail, setResourceDetail] = useState<ResourceDetailData | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n React.useEffect(() => {\n const loadResourceDetail = () => {\n setIsLoading(true);\n setError(null);\n\n try {\n const resourceManager = processedResources.system.resourceManager;\n const resourceResult = resourceManager.getBuiltResource(resourceId);\n\n if (resourceResult.isSuccess()) {\n const resource = resourceResult.value;\n\n // Handle different resource formats (ResourceManagerBuilder vs IResourceManager)\n let candidateDetails: any[] = [];\n\n // Check if candidates have conditions property (ResourceManagerBuilder format)\n if (resource.candidates.length > 0 && 'conditions' in resource.candidates[0]) {\n // ResourceManagerBuilder format with full condition details\n candidateDetails = resource.candidates.map((candidate: any) => ({\n json: candidate.json,\n conditions:\n candidate.conditions?.conditions?.map((condition: any) => ({\n qualifier: condition.qualifier.name,\n operator: condition.operator,\n value: condition.value,\n priority: condition.priority,\n scoreAsDefault: condition.scoreAsDefault\n })) || [],\n isPartial: candidate.isPartial,\n mergeMethod: candidate.mergeMethod\n }));\n } else {\n // IResourceManager format - extract conditions from compiled collection\n const compiledCollection = processedResources.compiledCollection;\n const compiledResource = compiledCollection?.resources?.find((r: any) => r.id === resourceId);\n\n candidateDetails = resource.candidates.map((candidate: any, index: number) => {\n // Try to get conditions from the compiled collection\n let conditions: any[] = [];\n\n if (compiledResource && compiledCollection) {\n const decision = compiledCollection.decisions?.[compiledResource.decision];\n if (decision?.conditionSets && index < decision.conditionSets.length) {\n const conditionSetIndex = decision.conditionSets[index];\n const conditionSet = compiledCollection.conditionSets?.[conditionSetIndex];\n\n if (conditionSet?.conditions) {\n conditions = conditionSet.conditions\n .map((condIndex: number) => {\n const condition = compiledCollection.conditions?.[condIndex];\n const qualifier = compiledCollection.qualifiers?.[condition?.qualifierIndex];\n return condition && qualifier\n ? {\n qualifier: qualifier.name,\n operator: condition.operator || 'eq',\n value: condition.value,\n priority: condition.priority || qualifier.defaultPriority || 500,\n scoreAsDefault: condition.scoreAsDefault\n }\n : null;\n })\n .filter(Boolean);\n }\n }\n }\n\n return {\n json: candidate.json,\n conditions: conditions,\n isPartial: candidate.isPartial,\n mergeMethod: candidate.mergeMethod\n };\n });\n }\n\n const detail: ResourceDetailData = {\n id: resource.id,\n resourceType: resource.resourceType.key || resource.resourceType.name || 'unknown',\n candidateCount: resource.candidates.length,\n candidates: candidateDetails\n };\n\n setResourceDetail(detail);\n onMessage?.('info', `Loaded details for resource: ${resourceId}`);\n } else {\n setError(`Failed to load resource details: ${resourceResult.message}`);\n onMessage?.('error', `Failed to load resource details: ${resourceResult.message}`);\n }\n } catch (err) {\n const errorMsg = `Error loading resource details: ${\n err instanceof Error ? err.message : String(err)\n }`;\n setError(errorMsg);\n onMessage?.('error', errorMsg);\n } finally {\n setIsLoading(false);\n }\n };\n\n loadResourceDetail();\n }, [resourceId, processedResources, onMessage]);\n\n if (isLoading) {\n return (\n <div className=\"flex flex-col h-full\">\n <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Resource Details</h3>\n <div className=\"flex-1 flex items-center justify-center border border-gray-200 rounded-lg bg-gray-50\">\n <div className=\"text-center\">\n <div className=\"animate-spin h-8 w-8 border-4 border-blue-600 border-t-transparent rounded-full mx-auto mb-4\"></div>\n <p className=\"text-gray-500\">Loading resource details...</p>\n </div>\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"flex flex-col h-full\">\n <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Resource Details</h3>\n <div className=\"flex-1 border border-gray-200 rounded-lg p-4 bg-red-50\">\n <div className=\"text-center\">\n <p className=\"text-red-600 font-medium mb-2\">Error Loading Resource</p>\n <p className=\"text-red-500 text-sm\">{error}</p>\n </div>\n </div>\n </div>\n );\n }\n\n if (!resourceDetail) {\n return (\n <div className=\"flex flex-col h-full\">\n <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Resource Details</h3>\n <div className=\"flex-1 flex items-center justify-center border border-gray-200 rounded-lg bg-gray-50\">\n <p className=\"text-gray-500\">No resource details available</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full\">\n <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Resource Details</h3>\n\n <div className=\"flex-1 overflow-y-auto border border-gray-200 rounded-lg p-4 bg-gray-50\">\n <div className=\"space-y-6\">\n {/* Resource Overview */}\n <div>\n <h4 className=\"font-medium text-gray-700 mb-3\">Resource Overview</h4>\n <div className=\"bg-white p-4 rounded-lg border space-y-3\">\n <div>\n <span className=\"text-sm font-medium text-gray-600\">Fully Qualified ID:</span>\n <code className=\"text-sm bg-gray-100 px-2 py-1 rounded ml-2 break-all\">\n {resourceDetail.id}\n </code>\n </div>\n <div>\n <span className=\"text-sm font-medium text-gray-600\">Resource Type:</span>\n <span className=\"ml-2 text-sm\">{resourceDetail.resourceType}</span>\n </div>\n <div>\n <span className=\"text-sm font-medium text-gray-600\">Candidate Count:</span>\n <span className=\"ml-2 text-sm font-medium text-blue-600\">\n {resourceDetail.candidateCount}\n </span>\n </div>\n </div>\n </div>\n\n {/* Candidates */}\n <div>\n <h4 className=\"font-medium text-gray-700 mb-3\">\n Candidates ({resourceDetail.candidates.length})\n </h4>\n <div className=\"space-y-4\">\n {resourceDetail.candidates.map((candidate, index) => (\n <div key={index} className=\"bg-white p-4 rounded-lg border\">\n <div className=\"flex items-center justify-between mb-3\">\n <h5 className=\"font-medium text-gray-800\">Candidate {index + 1}</h5>\n <div className=\"flex items-center space-x-2 text-xs\">\n {candidate.isPartial && (\n <span className=\"bg-yellow-100 text-yellow-800 px-2 py-1 rounded\">Partial</span>\n )}\n <span className=\"bg-gray-100 text-gray-700 px-2 py-1 rounded\">\n {candidate.mergeMethod}\n </span>\n </div>\n </div>\n\n {/* Conditions */}\n {candidate.conditions.length > 0 && (\n <div className=\"mb-3\">\n <h6 className=\"text-sm font-medium text-gray-600 mb-2\">Conditions:</h6>\n <div className=\"space-y-1\">\n {candidate.conditions.map((condition, condIndex) => (\n <div\n key={condIndex}\n className=\"flex items-center text-xs bg-blue-50 px-2 py-1 rounded\"\n >\n <span className=\"font-medium text-blue-800\">{condition.qualifier}</span>\n <span className=\"mx-1 text-blue-600\">{condition.operator}</span>\n <span className=\"text-blue-700\">{condition.value}</span>\n <div className=\"ml-auto flex items-center space-x-2\">\n <span className=\"text-blue-500\">priority: {condition.priority}</span>\n {condition.scoreAsDefault !== undefined && (\n <span className=\"text-amber-600 font-medium\">\n default: {condition.scoreAsDefault}\n </span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {candidate.conditions.length === 0 && (\n <div className=\"mb-3\">\n <span className=\"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded\">\n No conditions (default candidate)\n </span>\n </div>\n )}\n\n {/* JSON Content */}\n <div>\n <h6 className=\"text-sm font-medium text-gray-600 mb-2\">Content:</h6>\n <pre className=\"text-xs bg-gray-50 p-3 rounded border overflow-x-auto max-h-40\">\n {JSON.stringify(candidate.json, null, 2)}\n </pre>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default SourceView;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/views/ZipLoaderView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAS7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAwBpD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAictD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|