@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":"useResolutionState.js","sourceRoot":"","sources":["../../src/hooks/useResolutionState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAS9D,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAQpC,MAAM,UAAU,kBAAkB,CAChC,kBAA6C,EAC7C,SAAqF,EACrF,cAA+D;IAE/D,2BAA2B;IAC3B,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE;QACvC,IAAI,CAAC,kBAAkB;YAAE,OAAO,EAAE,CAAC;QACnC,OAAO,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzB,mDAAmD;IACnD,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,EAAE;QACxC,MAAM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;gBAC9B,SAAS,EAAE,CAAC,OAAO,EAAE,0BAA0B,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;gBACxE,OAAO;YACT,CAAC;YAED,yCAAyC;YACzC,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAEpC,2CAA2C;YAC3C,kBAAkB,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;YAE9B,SAAS,EAAE,CAAC,SAAS,EAAE,wBAAwB,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC;QACjF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1G,CAAC;gBAAS,CAAC;YACT,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IAErG,MAAM,KAAK,GAAoB;QAC7B,aAAa;QACb,oBAAoB;QACpB,kBAAkB;QAClB,eAAe;QACf,gBAAgB;QAChB,QAAQ;QACR,iBAAiB;QACjB,aAAa;QACb,eAAe;QACf,eAAe;QACf,eAAe;KAChB,CAAC;IAEF,MAAM,OAAO,GAAsB;QACjC,kBAAkB;QAClB,YAAY;QACZ,cAAc;QACd,WAAW;QACX,UAAU;QACV,eAAe;QACf,QAAQ;QACR,cAAc;QACd,OAAO;QACP,UAAU;QACV,UAAU;QACV,YAAY;KACb,CAAC;IAEF,OAAO;QACL,KAAK;QACL,OAAO;QACP,mBAAmB;KACpB,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useCallback, useMemo } from 'react';\nimport { Runtime } from '@fgv/ts-res';\nimport {\n ResolutionState,\n ResolutionActions,\n ResolutionResult,\n ProcessedResources,\n JsonValue\n} from '../types';\nimport {\n createResolverWithContext,\n resolveResourceDetailed,\n getAvailableQualifiers,\n hasPendingContextChanges\n} from '../utils/resolutionUtils';\nimport {\n validateEditedResource,\n computeResourceDelta,\n rebuildSystemWithEdits,\n extractResolutionContext,\n checkEditConflicts\n} from '../utils/resolutionEditing';\n\nexport interface UseResolutionStateReturn {\n state: ResolutionState;\n actions: ResolutionActions;\n availableQualifiers: string[];\n}\n\nexport function useResolutionState(\n processedResources: ProcessedResources | null,\n onMessage?: (type: 'info' | 'warning' | 'error' | 'success', message: string) => void,\n onSystemUpdate?: (updatedResources: ProcessedResources) => void\n): UseResolutionStateReturn {\n // Get available qualifiers\n const availableQualifiers = useMemo(() => {\n if (!processedResources) return [];\n return getAvailableQualifiers(processedResources);\n }, [processedResources]);\n\n // Initialize context with all qualifiers undefined\n const defaultContextValues = useMemo(() => {\n const defaults: Record<string, string | undefined> = {};\n availableQualifiers.forEach((qualifierName) => {\n defaults[qualifierName] = undefined;\n });\n return defaults;\n }, [availableQualifiers]);\n\n // Resolution state\n const [contextValues, setContextValues] = useState<Record<string, string | undefined>>({});\n const [pendingContextValues, setPendingContextValues] = useState<Record<string, string | undefined>>({});\n const [selectedResourceId, setSelectedResourceId] = useState<string | null>(null);\n const [currentResolver, setCurrentResolver] = useState<Runtime.ResourceResolver | null>(null);\n const [resolutionResult, setResolutionResult] = useState<ResolutionResult | null>(null);\n const [viewMode, setViewMode] = useState<'composed' | 'best' | 'all' | 'raw'>('composed');\n\n // Edit state - stores original, edited, and delta for each resource\n const [editedResources, setEditedResources] = useState<\n Map<string, { originalValue: JsonValue; editedValue: JsonValue; delta: JsonValue }>\n >(new Map());\n const [isApplyingEdits, setIsApplyingEdits] = useState(false);\n\n // Update context state when defaults change\n React.useEffect(() => {\n setContextValues(defaultContextValues);\n setPendingContextValues(defaultContextValues);\n }, [defaultContextValues]);\n\n // Check for pending changes\n const hasPendingChanges = useMemo(() => {\n return hasPendingContextChanges(contextValues, pendingContextValues);\n }, [contextValues, pendingContextValues]);\n\n // Check for unsaved edits\n const hasUnsavedEdits = useMemo(() => {\n return editedResources.size > 0;\n }, [editedResources]);\n\n // Update context value\n const updateContextValue = useCallback((qualifierName: string, value: string | undefined) => {\n setPendingContextValues((prev) => ({\n ...prev,\n [qualifierName]: value\n }));\n }, []);\n\n // Apply context changes\n const applyContext = useCallback(() => {\n if (!processedResources) {\n onMessage?.('error', 'No resources loaded');\n return;\n }\n\n try {\n // Create resolver with new context\n const resolverResult = createResolverWithContext(processedResources, pendingContextValues, {\n enableCaching: true,\n enableDebugLogging: false\n });\n\n if (resolverResult.isFailure()) {\n onMessage?.('error', `Failed to create resolver: ${resolverResult.message}`);\n return;\n }\n\n // Update state\n setContextValues({ ...pendingContextValues });\n setCurrentResolver(resolverResult.value);\n\n // If a resource is selected, resolve it with the new context\n if (selectedResourceId) {\n const resolutionResult = resolveResourceDetailed(\n resolverResult.value,\n selectedResourceId,\n processedResources\n );\n\n if (resolutionResult.isSuccess()) {\n setResolutionResult(resolutionResult.value);\n } else {\n onMessage?.('error', `Failed to resolve resource: ${resolutionResult.message}`);\n }\n }\n\n onMessage?.('success', 'Context applied successfully');\n } catch (error) {\n onMessage?.(\n 'error',\n `Failed to apply context: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }, [processedResources, pendingContextValues, selectedResourceId, onMessage]);\n\n // Select resource and resolve it\n const selectResource = useCallback(\n (resourceId: string) => {\n setSelectedResourceId(resourceId);\n setResolutionResult(null);\n\n if (currentResolver && processedResources) {\n const resolutionResult = resolveResourceDetailed(currentResolver, resourceId, processedResources);\n\n if (resolutionResult.isSuccess()) {\n setResolutionResult(resolutionResult.value);\n onMessage?.('info', `Selected resource: ${resourceId}`);\n } else {\n onMessage?.('error', `Failed to resolve resource: ${resolutionResult.message}`);\n }\n }\n },\n [currentResolver, processedResources, onMessage]\n );\n\n // Reset cache\n const resetCache = useCallback(() => {\n if (currentResolver) {\n currentResolver.clearConditionCache();\n onMessage?.('info', 'Cache cleared');\n }\n }, [currentResolver, onMessage]);\n\n // Auto-apply default context when resources are loaded\n React.useEffect(() => {\n if (processedResources && Object.keys(defaultContextValues).length > 0) {\n applyContext();\n }\n }, [processedResources, defaultContextValues]);\n\n // Edit management functions\n const saveEdit = useCallback(\n (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => {\n try {\n // Validate the edited value\n const validation = validateEditedResource(editedValue);\n if (!validation.isValid) {\n onMessage?.('error', `Invalid edit: ${validation.errors.join(', ')}`);\n return;\n }\n\n // Show warnings if any\n if (validation.warnings.length > 0) {\n validation.warnings.forEach((warning) => onMessage?.('warning', warning));\n }\n\n // Compute the delta between original and edited\n const resolvedValue = originalValue || editedValue; // Use originalValue as the resolved/baseline\n const deltaResult = computeResourceDelta(undefined, resolvedValue, editedValue);\n\n if (deltaResult.isFailure()) {\n onMessage?.('warning', `Could not compute delta, saving full value: ${deltaResult.message}`);\n }\n\n const delta = deltaResult.isSuccess() ? deltaResult.value : null;\n\n // Save the edit with original, edited, and delta\n setEditedResources((prev) => {\n const newMap = new Map(prev);\n newMap.set(resourceId, {\n originalValue: resolvedValue,\n editedValue,\n delta\n });\n return newMap;\n });\n\n // Log info about delta\n if (delta !== null && delta !== editedValue) {\n const deltaSize = JSON.stringify(delta).length;\n const fullSize = JSON.stringify(editedValue).length;\n const reduction = Math.round((1 - deltaSize / fullSize) * 100);\n onMessage?.('info', `Edit saved for ${resourceId} (delta: ${reduction}% smaller)`);\n } else {\n onMessage?.('info', `Edit saved for resource ${resourceId}`);\n }\n } catch (error) {\n onMessage?.(\n 'error',\n `Failed to save edit: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n },\n [onMessage]\n );\n\n const getEditedValue = useCallback(\n (resourceId: string) => {\n const edit = editedResources.get(resourceId);\n return edit?.editedValue;\n },\n [editedResources]\n );\n\n const hasEdit = useCallback(\n (resourceId: string) => {\n return editedResources.has(resourceId);\n },\n [editedResources]\n );\n\n const clearEdits = useCallback(() => {\n setEditedResources(new Map());\n onMessage?.('info', 'All edits cleared');\n }, [onMessage]);\n\n const discardEdits = useCallback(() => {\n if (hasUnsavedEdits) {\n setEditedResources(new Map());\n onMessage?.('info', 'All unsaved edits discarded');\n }\n }, [hasUnsavedEdits, onMessage]);\n\n const applyEdits = useCallback(async () => {\n if (!processedResources || editedResources.size === 0) {\n onMessage?.('warning', 'No edits to apply');\n return;\n }\n\n if (!onSystemUpdate) {\n onMessage?.('error', 'System update callback not provided');\n return;\n }\n\n setIsApplyingEdits(true);\n\n try {\n // Extract current resolution context (filter out undefined values)\n const cleanedContextValues: Record<string, string> = {};\n Object.entries(contextValues).forEach(([key, value]) => {\n if (value !== undefined) {\n cleanedContextValues[key] = value;\n }\n });\n\n const currentContext = extractResolutionContext(\n currentResolver as Runtime.ResourceResolver,\n cleanedContextValues\n );\n\n // Check for potential conflicts\n const conflictCheck = checkEditConflicts(\n processedResources.system.resourceManager,\n editedResources,\n currentContext\n );\n\n // Show warnings about potential conflicts\n conflictCheck.warnings.forEach((warning) => onMessage?.('warning', warning));\n\n if (conflictCheck.conflicts.length > 0) {\n onMessage?.('error', `Conflicts detected: ${conflictCheck.conflicts.join(', ')}`);\n return;\n }\n\n // Rebuild the system with edits\n const rebuildResult = await rebuildSystemWithEdits(\n processedResources.system,\n editedResources,\n currentContext\n );\n\n if (rebuildResult.isFailure()) {\n onMessage?.('error', `Failed to apply edits: ${rebuildResult.message}`);\n return;\n }\n\n // Update the system through the callback\n onSystemUpdate(rebuildResult.value);\n\n // Clear edits after successful application\n setEditedResources(new Map());\n\n onMessage?.('success', `Successfully applied ${editedResources.size} edit(s)`);\n } catch (error) {\n onMessage?.('error', `Error applying edits: ${error instanceof Error ? error.message : String(error)}`);\n } finally {\n setIsApplyingEdits(false);\n }\n }, [processedResources, editedResources, onSystemUpdate, currentResolver, contextValues, onMessage]);\n\n const state: ResolutionState = {\n contextValues,\n pendingContextValues,\n selectedResourceId,\n currentResolver,\n resolutionResult,\n viewMode,\n hasPendingChanges,\n // Edit state\n editedResources,\n hasUnsavedEdits,\n isApplyingEdits\n };\n\n const actions: ResolutionActions = {\n updateContextValue,\n applyContext,\n selectResource,\n setViewMode,\n resetCache,\n // Edit actions\n saveEdit,\n getEditedValue,\n hasEdit,\n clearEdits,\n applyEdits,\n discardEdits\n };\n\n return {\n state,\n actions,\n availableQualifiers\n };\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { ResourceManagerState, ProcessedResources, ImportedDirectory, ImportedFile, JsonValue } from '../types';
|
|
3
|
+
import { Config, Bundle } from '@fgv/ts-res';
|
|
4
|
+
export interface UseResourceDataReturn {
|
|
5
|
+
state: ResourceManagerState;
|
|
6
|
+
actions: {
|
|
7
|
+
processDirectory: (directory: ImportedDirectory) => Promise<void>;
|
|
8
|
+
processDirectoryWithConfig: (directory: ImportedDirectory, config: Config.Model.ISystemConfiguration) => Promise<void>;
|
|
9
|
+
processFiles: (files: ImportedFile[]) => Promise<void>;
|
|
10
|
+
processBundleFile: (bundle: Bundle.IBundle) => Promise<void>;
|
|
11
|
+
clearError: () => void;
|
|
12
|
+
reset: () => void;
|
|
13
|
+
resolveResource: (resourceId: string, context?: Record<string, string>) => Promise<Result<JsonValue>>;
|
|
14
|
+
applyConfiguration: (config: Config.Model.ISystemConfiguration) => void;
|
|
15
|
+
updateProcessedResources: (processedResources: ProcessedResources) => void;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function useResourceData(): UseResourceDataReturn;
|
|
19
|
+
//# sourceMappingURL=useResourceData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResourceData.d.ts","sourceRoot":"","sources":["../../src/hooks/useResourceData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,MAAM,EACN,MAAM,EAOP,MAAM,aAAa,CAAC;AAQrB,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,OAAO,EAAE;QACP,gBAAgB,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QAClE,0BAA0B,EAAE,CAC1B,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,oBAAoB,KACtC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnB,YAAY,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QACvD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,KAAK,EAAE,MAAM,IAAI,CAAC;QAClB,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QACtG,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,IAAI,CAAC;QACxE,wBAAwB,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,KAAK,IAAI,CAAC;KAC5E,CAAC;CACH;AAYD,wBAAgB,eAAe,IAAI,qBAAqB,CA4ZvD"}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
import { succeed, fail } from '@fgv/ts-utils';
|
|
3
|
+
import { Bundle, Runtime, Resources, Import } from '@fgv/ts-res';
|
|
4
|
+
import { processImportedFiles, processImportedDirectory } from '../utils/tsResIntegration';
|
|
5
|
+
const initialState = {
|
|
6
|
+
isProcessing: false,
|
|
7
|
+
processedResources: null,
|
|
8
|
+
error: null,
|
|
9
|
+
hasProcessedData: false,
|
|
10
|
+
activeConfiguration: null,
|
|
11
|
+
isLoadedFromBundle: false,
|
|
12
|
+
bundleMetadata: null
|
|
13
|
+
};
|
|
14
|
+
export function useResourceData() {
|
|
15
|
+
const [state, setState] = useState(initialState);
|
|
16
|
+
const processDirectory = useCallback(async (directory) => {
|
|
17
|
+
setState((prev) => ({ ...prev, isProcessing: true, error: null }));
|
|
18
|
+
try {
|
|
19
|
+
const result = processImportedDirectory(directory, state.activeConfiguration || undefined);
|
|
20
|
+
if (result.isSuccess()) {
|
|
21
|
+
setState((prev) => ({
|
|
22
|
+
...prev,
|
|
23
|
+
isProcessing: false,
|
|
24
|
+
processedResources: result.value,
|
|
25
|
+
hasProcessedData: true,
|
|
26
|
+
isLoadedFromBundle: false,
|
|
27
|
+
bundleMetadata: null
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw new Error(result.message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
setState((prev) => ({
|
|
36
|
+
...prev,
|
|
37
|
+
isProcessing: false,
|
|
38
|
+
error: error instanceof Error ? error.message : String(error)
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
}, [state.activeConfiguration]);
|
|
42
|
+
const processDirectoryWithConfig = useCallback(async (directory, config) => {
|
|
43
|
+
setState((prev) => ({ ...prev, isProcessing: true, error: null, activeConfiguration: config }));
|
|
44
|
+
try {
|
|
45
|
+
const result = processImportedDirectory(directory, config);
|
|
46
|
+
if (result.isSuccess()) {
|
|
47
|
+
setState((prev) => ({
|
|
48
|
+
...prev,
|
|
49
|
+
isProcessing: false,
|
|
50
|
+
processedResources: result.value,
|
|
51
|
+
hasProcessedData: true,
|
|
52
|
+
isLoadedFromBundle: false,
|
|
53
|
+
bundleMetadata: null,
|
|
54
|
+
activeConfiguration: config
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
throw new Error(result.message);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
setState((prev) => ({
|
|
63
|
+
...prev,
|
|
64
|
+
isProcessing: false,
|
|
65
|
+
error: error instanceof Error ? error.message : String(error)
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
}, []);
|
|
69
|
+
const processFiles = useCallback(async (files) => {
|
|
70
|
+
setState((prev) => ({ ...prev, isProcessing: true, error: null }));
|
|
71
|
+
try {
|
|
72
|
+
const result = processImportedFiles(files, state.activeConfiguration || undefined);
|
|
73
|
+
if (result.isSuccess()) {
|
|
74
|
+
setState((prev) => ({
|
|
75
|
+
...prev,
|
|
76
|
+
isProcessing: false,
|
|
77
|
+
processedResources: result.value,
|
|
78
|
+
hasProcessedData: true,
|
|
79
|
+
isLoadedFromBundle: false,
|
|
80
|
+
bundleMetadata: null
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
throw new Error(result.message);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
setState((prev) => ({
|
|
89
|
+
...prev,
|
|
90
|
+
isProcessing: false,
|
|
91
|
+
error: error instanceof Error ? error.message : String(error)
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
}, [state.activeConfiguration]);
|
|
95
|
+
const processBundleFile = useCallback(async (bundle) => {
|
|
96
|
+
console.log('[Bundle Processing] Starting bundle processing...', bundle);
|
|
97
|
+
setState((prev) => ({ ...prev, isProcessing: true, error: null }));
|
|
98
|
+
try {
|
|
99
|
+
console.log('[Bundle Processing] Attempting to extract bundle components...');
|
|
100
|
+
// Extract bundle components (configuration and compiled collection)
|
|
101
|
+
const componentsResult = Bundle.BundleUtils.extractBundleComponents(bundle);
|
|
102
|
+
console.log('[Bundle Processing] Component extraction result:', componentsResult.isSuccess() ? 'SUCCESS' : `FAILED: ${componentsResult.message}`);
|
|
103
|
+
if (componentsResult.isFailure()) {
|
|
104
|
+
throw new Error(`Failed to extract bundle components: ${componentsResult.message}`);
|
|
105
|
+
}
|
|
106
|
+
const { systemConfiguration, compiledCollection, metadata } = componentsResult.value;
|
|
107
|
+
console.log('[Bundle Processing] Extracted components:', {
|
|
108
|
+
hasSystemConfiguration: !!systemConfiguration,
|
|
109
|
+
hasCompiledCollection: !!compiledCollection,
|
|
110
|
+
hasMetadata: !!metadata,
|
|
111
|
+
systemConfiguration: systemConfiguration
|
|
112
|
+
});
|
|
113
|
+
// Use BundleLoader to create a fully functional resource manager from the bundle
|
|
114
|
+
console.log('[Bundle Processing] Using BundleLoader to create resource manager from bundle');
|
|
115
|
+
const bundleManagerResult = Bundle.BundleLoader.createManagerFromBundle({
|
|
116
|
+
bundle: bundle,
|
|
117
|
+
skipChecksumVerification: true // Skip for now since we're in a browser environment
|
|
118
|
+
});
|
|
119
|
+
if (bundleManagerResult.isFailure()) {
|
|
120
|
+
throw new Error(`Failed to create resource manager from bundle: ${bundleManagerResult.message}`);
|
|
121
|
+
}
|
|
122
|
+
// The bundle's IResourceManager contains all the resources and candidates
|
|
123
|
+
// We'll use it directly for both UI and resolution
|
|
124
|
+
const bundleResourceManager = bundleManagerResult.value;
|
|
125
|
+
// Debug: Check what resources are in the original bundle manager
|
|
126
|
+
console.log('[Bundle Processing] Original bundle manager resources:', {
|
|
127
|
+
numResources: bundleResourceManager.numResources,
|
|
128
|
+
numCandidates: bundleResourceManager.numCandidates,
|
|
129
|
+
resourceIds: Array.from(bundleResourceManager.builtResources.keys())
|
|
130
|
+
});
|
|
131
|
+
// Convert the compiled collection to an editable ResourceManagerBuilder
|
|
132
|
+
// using createFromCompiledResourceCollection for exact reconstruction
|
|
133
|
+
const reconstructedBuilderResult = Resources.ResourceManagerBuilder.createFromCompiledResourceCollection(compiledCollection, systemConfiguration);
|
|
134
|
+
if (reconstructedBuilderResult.isFailure()) {
|
|
135
|
+
throw new Error(`Failed to reconstruct builder from compiled collection: ${reconstructedBuilderResult.message}`);
|
|
136
|
+
}
|
|
137
|
+
const editableResourceManager = reconstructedBuilderResult.value;
|
|
138
|
+
console.log('[Bundle Processing] Normalized builder resources:', {
|
|
139
|
+
numResources: editableResourceManager.resources.size,
|
|
140
|
+
numCandidates: Array.from(editableResourceManager.getAllCandidates()).length,
|
|
141
|
+
resourceIds: Array.from(editableResourceManager.resources.keys())
|
|
142
|
+
});
|
|
143
|
+
// Create the system using the normalized, editable resource manager
|
|
144
|
+
const system = {
|
|
145
|
+
qualifierTypes: systemConfiguration.qualifierTypes,
|
|
146
|
+
qualifiers: systemConfiguration.qualifiers,
|
|
147
|
+
resourceTypes: systemConfiguration.resourceTypes,
|
|
148
|
+
resourceManager: editableResourceManager, // Now editable ResourceManagerBuilder
|
|
149
|
+
importManager: Import.ImportManager.create({
|
|
150
|
+
resources: Resources.ResourceManagerBuilder.create({
|
|
151
|
+
qualifiers: systemConfiguration.qualifiers,
|
|
152
|
+
resourceTypes: systemConfiguration.resourceTypes
|
|
153
|
+
}).orThrow()
|
|
154
|
+
}).orThrow(),
|
|
155
|
+
contextQualifierProvider: Runtime.Context.ValidatingSimpleContextQualifierProvider.create({
|
|
156
|
+
qualifiers: systemConfiguration.qualifiers
|
|
157
|
+
}).orThrow()
|
|
158
|
+
};
|
|
159
|
+
// Extract configuration for UI display using the collector API
|
|
160
|
+
// Note: The collectors contain instantiated objects, not raw config
|
|
161
|
+
const configForStorage = {
|
|
162
|
+
name: 'Bundle Configuration',
|
|
163
|
+
description: metadata?.description || 'Configuration extracted from bundle',
|
|
164
|
+
qualifierTypes: Array.from(system.qualifierTypes.values()).map((qt) => {
|
|
165
|
+
console.log('[Bundle Processing] Extracting qualifier type:', qt);
|
|
166
|
+
// Determine the system type based on the class name
|
|
167
|
+
let systemType = 'literal';
|
|
168
|
+
if (qt.constructor?.name === 'LanguageQualifierType') {
|
|
169
|
+
systemType = 'language';
|
|
170
|
+
}
|
|
171
|
+
else if (qt.constructor?.name === 'TerritoryQualifierType') {
|
|
172
|
+
systemType = 'territory';
|
|
173
|
+
}
|
|
174
|
+
else if (qt.constructor?.name === 'LiteralQualifierType') {
|
|
175
|
+
systemType = 'literal';
|
|
176
|
+
}
|
|
177
|
+
// Extract configuration properties based on type
|
|
178
|
+
const configuration = {};
|
|
179
|
+
// Common properties
|
|
180
|
+
if (qt.allowContextList !== undefined) {
|
|
181
|
+
configuration.allowContextList = qt.allowContextList;
|
|
182
|
+
}
|
|
183
|
+
// LiteralQualifierType specific
|
|
184
|
+
if (systemType === 'literal') {
|
|
185
|
+
const qtAny = qt;
|
|
186
|
+
if (qtAny.caseSensitive !== undefined) {
|
|
187
|
+
configuration.caseSensitive = qtAny.caseSensitive;
|
|
188
|
+
}
|
|
189
|
+
if (qtAny.enumeratedValues) {
|
|
190
|
+
configuration.enumeratedValues = qtAny.enumeratedValues;
|
|
191
|
+
}
|
|
192
|
+
if (qtAny.hierarchy) {
|
|
193
|
+
configuration.hierarchy = qtAny.hierarchy;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// TerritoryQualifierType specific
|
|
197
|
+
if (systemType === 'territory') {
|
|
198
|
+
const qtAny = qt;
|
|
199
|
+
if (qtAny.acceptLowercase !== undefined) {
|
|
200
|
+
configuration.acceptLowercase = qtAny.acceptLowercase;
|
|
201
|
+
}
|
|
202
|
+
if (qtAny.allowedTerritories) {
|
|
203
|
+
configuration.allowedTerritories = qtAny.allowedTerritories;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
name: qt.name,
|
|
208
|
+
systemType: systemType,
|
|
209
|
+
configuration: configuration
|
|
210
|
+
};
|
|
211
|
+
}),
|
|
212
|
+
qualifiers: Array.from(system.qualifiers.values()).map((q) => {
|
|
213
|
+
console.log('[Bundle Processing] Extracting qualifier:', q);
|
|
214
|
+
// Instantiated Qualifier objects have .type property which is a QualifierType object
|
|
215
|
+
const qAny = q;
|
|
216
|
+
const typeName = q.type?.name || qAny.typeName;
|
|
217
|
+
if (!typeName) {
|
|
218
|
+
console.error('[Bundle Processing] Missing typeName for qualifier:', q);
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
name: q.name,
|
|
222
|
+
typeName: (typeName || 'unknown'),
|
|
223
|
+
token: q.token,
|
|
224
|
+
defaultPriority: q.defaultPriority || 500,
|
|
225
|
+
defaultValue: q.defaultValue,
|
|
226
|
+
tokenIsOptional: q.tokenIsOptional || false
|
|
227
|
+
};
|
|
228
|
+
}),
|
|
229
|
+
resourceTypes: Array.from(system.resourceTypes.values()).map((rt, index) => {
|
|
230
|
+
console.log('[Bundle Processing] Extracting resource type:', rt);
|
|
231
|
+
// ResourceTypes in bundles might not have a name property
|
|
232
|
+
// Default to 'json' for JsonResourceType
|
|
233
|
+
const rtAny = rt;
|
|
234
|
+
const typeName = rt.constructor?.name === 'JsonResourceType' ? 'json' : rtAny.typeName || 'json';
|
|
235
|
+
return {
|
|
236
|
+
name: (rtAny.name || `resourceType${index}`), // Provide a default name if missing
|
|
237
|
+
typeName: typeName
|
|
238
|
+
};
|
|
239
|
+
})
|
|
240
|
+
};
|
|
241
|
+
console.log('[Bundle Processing] Extracted configuration for UI:', configForStorage);
|
|
242
|
+
// Extract resource IDs from the loaded resource manager
|
|
243
|
+
const resourceIds = [];
|
|
244
|
+
let resourceCount = 0;
|
|
245
|
+
// The resource manager is now fully loaded with all bundle resources
|
|
246
|
+
// Extract resource IDs from the compiled collection for tracking
|
|
247
|
+
if (compiledCollection.resources) {
|
|
248
|
+
for (const resource of compiledCollection.resources) {
|
|
249
|
+
const resourceId = resource.id || `resource-${resourceCount}`;
|
|
250
|
+
resourceIds.push(resourceId);
|
|
251
|
+
resourceCount++;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
console.log(`Bundle loaded with ${resourceCount} resources (with candidates):`, resourceIds);
|
|
255
|
+
// Create a resolver using the bundle's resource manager
|
|
256
|
+
const resolverResult = Runtime.ResourceResolver.create({
|
|
257
|
+
resourceManager: system.resourceManager,
|
|
258
|
+
qualifierTypes: system.qualifierTypes,
|
|
259
|
+
contextQualifierProvider: system.contextQualifierProvider
|
|
260
|
+
});
|
|
261
|
+
if (resolverResult.isFailure()) {
|
|
262
|
+
throw new Error(`Failed to create resolver: ${resolverResult.message}`);
|
|
263
|
+
}
|
|
264
|
+
// No longer create a separate CompiledResourceCollection manager
|
|
265
|
+
// We'll derive the compiled collection from ResourceManagerBuilder when needed
|
|
266
|
+
// Create the processed resources structure with bundle data
|
|
267
|
+
const processedResources = {
|
|
268
|
+
system: {
|
|
269
|
+
qualifierTypes: system.qualifierTypes,
|
|
270
|
+
qualifiers: system.qualifiers,
|
|
271
|
+
resourceTypes: system.resourceTypes,
|
|
272
|
+
resourceManager: system.resourceManager,
|
|
273
|
+
importManager: system.importManager,
|
|
274
|
+
contextQualifierProvider: system.contextQualifierProvider
|
|
275
|
+
},
|
|
276
|
+
compiledCollection,
|
|
277
|
+
resolver: resolverResult.value,
|
|
278
|
+
resourceCount,
|
|
279
|
+
summary: {
|
|
280
|
+
totalResources: resourceCount,
|
|
281
|
+
resourceIds,
|
|
282
|
+
errorCount: 0,
|
|
283
|
+
warnings: [`Bundle loaded with ${resourceCount} resources from compiled collection`]
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
console.log('[Bundle Processing] Setting final state...', {
|
|
287
|
+
resourceCount,
|
|
288
|
+
resourceIds,
|
|
289
|
+
configForStorage,
|
|
290
|
+
hasProcessedResources: !!processedResources
|
|
291
|
+
});
|
|
292
|
+
setState((prev) => ({
|
|
293
|
+
...prev,
|
|
294
|
+
isProcessing: false,
|
|
295
|
+
processedResources,
|
|
296
|
+
hasProcessedData: true,
|
|
297
|
+
error: null,
|
|
298
|
+
activeConfiguration: configForStorage,
|
|
299
|
+
isLoadedFromBundle: true,
|
|
300
|
+
bundleMetadata: metadata
|
|
301
|
+
}));
|
|
302
|
+
console.log('[Bundle Processing] Bundle processing completed successfully!');
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
setState((prev) => ({
|
|
306
|
+
...prev,
|
|
307
|
+
isProcessing: false,
|
|
308
|
+
error: error instanceof Error ? error.message : String(error)
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
}, []);
|
|
312
|
+
const clearError = useCallback(() => {
|
|
313
|
+
setState((prev) => ({ ...prev, error: null }));
|
|
314
|
+
}, []);
|
|
315
|
+
const reset = useCallback(() => {
|
|
316
|
+
setState(initialState);
|
|
317
|
+
}, []);
|
|
318
|
+
const resolveResource = useCallback(async (resourceId, context) => {
|
|
319
|
+
if (!state.processedResources?.system?.resourceManager) {
|
|
320
|
+
return fail('No resources loaded');
|
|
321
|
+
}
|
|
322
|
+
try {
|
|
323
|
+
// Get the resource from the resource manager
|
|
324
|
+
const resourceResult = state.processedResources.system.resourceManager.getBuiltResource(resourceId);
|
|
325
|
+
if (resourceResult.isFailure()) {
|
|
326
|
+
return fail(`Resource not found: ${resourceId}`);
|
|
327
|
+
}
|
|
328
|
+
// Get the resource and convert to JSON
|
|
329
|
+
const resource = resourceResult.value;
|
|
330
|
+
// For now, return a simple representation since we don't have full resolution context
|
|
331
|
+
// TODO: Use proper converters from ts-json-base when implementing full resolution
|
|
332
|
+
const resourceJson = {
|
|
333
|
+
id: resource.id,
|
|
334
|
+
type: resource.resourceType,
|
|
335
|
+
candidateCount: resource.candidates.length
|
|
336
|
+
};
|
|
337
|
+
return succeed(resourceJson);
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
return fail(`Failed to resolve resource: ${error instanceof Error ? error.message : String(error)}`);
|
|
341
|
+
}
|
|
342
|
+
}, [state.processedResources]);
|
|
343
|
+
const applyConfiguration = useCallback((config) => {
|
|
344
|
+
setState((prev) => ({ ...prev, activeConfiguration: config }));
|
|
345
|
+
}, []);
|
|
346
|
+
const updateProcessedResources = useCallback((processedResources) => {
|
|
347
|
+
setState((prev) => ({
|
|
348
|
+
...prev,
|
|
349
|
+
processedResources,
|
|
350
|
+
hasProcessedData: true
|
|
351
|
+
}));
|
|
352
|
+
}, []);
|
|
353
|
+
return {
|
|
354
|
+
state,
|
|
355
|
+
actions: {
|
|
356
|
+
processDirectory,
|
|
357
|
+
processDirectoryWithConfig,
|
|
358
|
+
processFiles,
|
|
359
|
+
processBundleFile,
|
|
360
|
+
clearError,
|
|
361
|
+
reset,
|
|
362
|
+
resolveResource,
|
|
363
|
+
applyConfiguration,
|
|
364
|
+
updateProcessedResources
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
//# sourceMappingURL=useResourceData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResourceData.js","sourceRoot":"","sources":["../../src/hooks/useResourceData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAU,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQtD,OAAO,EAEL,MAAM,EACN,OAAO,EACP,SAAS,EACT,MAAM,EAIP,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EAGzB,MAAM,2BAA2B,CAAC;AAoBnC,MAAM,YAAY,GAAyB;IACzC,YAAY,EAAE,KAAK;IACnB,kBAAkB,EAAE,IAAI;IACxB,KAAK,EAAE,IAAI;IACX,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,KAAK;IACzB,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF,MAAM,UAAU,eAAe;IAC7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,YAAY,CAAC,CAAC;IAEvE,MAAM,gBAAgB,GAAG,WAAW,CAClC,KAAK,EAAE,SAA4B,EAAE,EAAE;QACrC,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,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;AACJ,CAAC","sourcesContent":["import { useState, useCallback } from 'react';\nimport { Result, succeed, fail } from '@fgv/ts-utils';\nimport {\n ResourceManagerState,\n ProcessedResources,\n ImportedDirectory,\n ImportedFile,\n JsonValue\n} from '../types';\nimport {\n Config,\n Bundle,\n Runtime,\n Resources,\n Import,\n QualifierTypes,\n Qualifiers,\n ResourceTypes\n} from '@fgv/ts-res';\nimport {\n processImportedFiles,\n processImportedDirectory,\n createSimpleContext,\n createTsResSystemFromConfig\n} from '../utils/tsResIntegration';\n\nexport interface UseResourceDataReturn {\n state: ResourceManagerState;\n actions: {\n processDirectory: (directory: ImportedDirectory) => Promise<void>;\n processDirectoryWithConfig: (\n directory: ImportedDirectory,\n config: Config.Model.ISystemConfiguration\n ) => Promise<void>;\n processFiles: (files: ImportedFile[]) => Promise<void>;\n processBundleFile: (bundle: Bundle.IBundle) => Promise<void>;\n clearError: () => void;\n reset: () => void;\n resolveResource: (resourceId: string, context?: Record<string, string>) => Promise<Result<JsonValue>>;\n applyConfiguration: (config: Config.Model.ISystemConfiguration) => void;\n updateProcessedResources: (processedResources: ProcessedResources) => void;\n };\n}\n\nconst initialState: ResourceManagerState = {\n isProcessing: false,\n processedResources: null,\n error: null,\n hasProcessedData: false,\n activeConfiguration: null,\n isLoadedFromBundle: false,\n bundleMetadata: null\n};\n\nexport function useResourceData(): UseResourceDataReturn {\n const [state, setState] = useState<ResourceManagerState>(initialState);\n\n const processDirectory = useCallback(\n async (directory: ImportedDirectory) => {\n setState((prev) => ({ ...prev, isProcessing: true, error: null }));\n\n try {\n const result = processImportedDirectory(directory, state.activeConfiguration || undefined);\n\n if (result.isSuccess()) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n processedResources: result.value,\n hasProcessedData: true,\n isLoadedFromBundle: false,\n bundleMetadata: null\n }));\n } else {\n throw new Error(result.message);\n }\n } catch (error) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: error instanceof Error ? error.message : String(error)\n }));\n }\n },\n [state.activeConfiguration]\n );\n\n const processDirectoryWithConfig = useCallback(\n async (directory: ImportedDirectory, config: Config.Model.ISystemConfiguration) => {\n setState((prev) => ({ ...prev, isProcessing: true, error: null, activeConfiguration: config }));\n\n try {\n const result = processImportedDirectory(directory, config);\n\n if (result.isSuccess()) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n processedResources: result.value,\n hasProcessedData: true,\n isLoadedFromBundle: false,\n bundleMetadata: null,\n activeConfiguration: config\n }));\n } else {\n throw new Error(result.message);\n }\n } catch (error) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: error instanceof Error ? error.message : String(error)\n }));\n }\n },\n []\n );\n\n const processFiles = useCallback(\n async (files: ImportedFile[]) => {\n setState((prev) => ({ ...prev, isProcessing: true, error: null }));\n\n try {\n const result = processImportedFiles(files, state.activeConfiguration || undefined);\n\n if (result.isSuccess()) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n processedResources: result.value,\n hasProcessedData: true,\n isLoadedFromBundle: false,\n bundleMetadata: null\n }));\n } else {\n throw new Error(result.message);\n }\n } catch (error) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: error instanceof Error ? error.message : String(error)\n }));\n }\n },\n [state.activeConfiguration]\n );\n\n const processBundleFile = useCallback(async (bundle: Bundle.IBundle) => {\n console.log('[Bundle Processing] Starting bundle processing...', bundle);\n setState((prev) => ({ ...prev, isProcessing: true, error: null }));\n\n try {\n console.log('[Bundle Processing] Attempting to extract bundle components...');\n\n // Extract bundle components (configuration and compiled collection)\n const componentsResult = Bundle.BundleUtils.extractBundleComponents(bundle);\n console.log(\n '[Bundle Processing] Component extraction result:',\n componentsResult.isSuccess() ? 'SUCCESS' : `FAILED: ${componentsResult.message}`\n );\n\n if (componentsResult.isFailure()) {\n throw new Error(`Failed to extract bundle components: ${componentsResult.message}`);\n }\n\n const { systemConfiguration, compiledCollection, metadata } = componentsResult.value;\n console.log('[Bundle Processing] Extracted components:', {\n hasSystemConfiguration: !!systemConfiguration,\n hasCompiledCollection: !!compiledCollection,\n hasMetadata: !!metadata,\n systemConfiguration: systemConfiguration\n });\n\n // Use BundleLoader to create a fully functional resource manager from the bundle\n console.log('[Bundle Processing] Using BundleLoader to create resource manager from bundle');\n\n const bundleManagerResult = Bundle.BundleLoader.createManagerFromBundle({\n bundle: bundle,\n skipChecksumVerification: true // Skip for now since we're in a browser environment\n });\n\n if (bundleManagerResult.isFailure()) {\n throw new Error(`Failed to create resource manager from bundle: ${bundleManagerResult.message}`);\n }\n\n // The bundle's IResourceManager contains all the resources and candidates\n // We'll use it directly for both UI and resolution\n const bundleResourceManager = bundleManagerResult.value;\n\n // Debug: Check what resources are in the original bundle manager\n console.log('[Bundle Processing] Original bundle manager resources:', {\n numResources: bundleResourceManager.numResources,\n numCandidates: bundleResourceManager.numCandidates,\n resourceIds: Array.from(bundleResourceManager.builtResources.keys())\n });\n\n // Convert the compiled collection to an editable ResourceManagerBuilder\n // using createFromCompiledResourceCollection for exact reconstruction\n const reconstructedBuilderResult =\n Resources.ResourceManagerBuilder.createFromCompiledResourceCollection(\n compiledCollection,\n systemConfiguration\n );\n if (reconstructedBuilderResult.isFailure()) {\n throw new Error(\n `Failed to reconstruct builder from compiled collection: ${reconstructedBuilderResult.message}`\n );\n }\n\n const editableResourceManager = reconstructedBuilderResult.value;\n console.log('[Bundle Processing] Normalized builder resources:', {\n numResources: editableResourceManager.resources.size,\n numCandidates: Array.from(editableResourceManager.getAllCandidates()).length,\n resourceIds: Array.from(editableResourceManager.resources.keys())\n });\n\n // Create the system using the normalized, editable resource manager\n const system = {\n qualifierTypes: systemConfiguration.qualifierTypes,\n qualifiers: systemConfiguration.qualifiers,\n resourceTypes: systemConfiguration.resourceTypes,\n resourceManager: editableResourceManager, // Now editable ResourceManagerBuilder\n importManager: Import.ImportManager.create({\n resources: Resources.ResourceManagerBuilder.create({\n qualifiers: systemConfiguration.qualifiers,\n resourceTypes: systemConfiguration.resourceTypes\n }).orThrow()\n }).orThrow(),\n contextQualifierProvider: Runtime.Context.ValidatingSimpleContextQualifierProvider.create({\n qualifiers: systemConfiguration.qualifiers\n }).orThrow()\n };\n\n // Extract configuration for UI display using the collector API\n // Note: The collectors contain instantiated objects, not raw config\n const configForStorage: Config.Model.ISystemConfiguration = {\n name: 'Bundle Configuration',\n description: metadata?.description || 'Configuration extracted from bundle',\n qualifierTypes: Array.from(system.qualifierTypes.values()).map((qt) => {\n console.log('[Bundle Processing] Extracting qualifier type:', qt);\n // Determine the system type based on the class name\n let systemType: 'literal' | 'language' | 'territory' = 'literal';\n if (qt.constructor?.name === 'LanguageQualifierType') {\n systemType = 'language';\n } else if (qt.constructor?.name === 'TerritoryQualifierType') {\n systemType = 'territory';\n } else if (qt.constructor?.name === 'LiteralQualifierType') {\n systemType = 'literal';\n }\n\n // Extract configuration properties based on type\n const configuration: Record<string, unknown> = {};\n\n // Common properties\n if (qt.allowContextList !== undefined) {\n configuration.allowContextList = qt.allowContextList;\n }\n\n // LiteralQualifierType specific\n if (systemType === 'literal') {\n const qtAny = qt as unknown as Record<string, unknown>;\n if (qtAny.caseSensitive !== undefined) {\n configuration.caseSensitive = qtAny.caseSensitive;\n }\n if (qtAny.enumeratedValues) {\n configuration.enumeratedValues = qtAny.enumeratedValues;\n }\n if (qtAny.hierarchy) {\n configuration.hierarchy = qtAny.hierarchy;\n }\n }\n\n // TerritoryQualifierType specific\n if (systemType === 'territory') {\n const qtAny = qt as unknown as Record<string, unknown>;\n if (qtAny.acceptLowercase !== undefined) {\n configuration.acceptLowercase = qtAny.acceptLowercase;\n }\n if (qtAny.allowedTerritories) {\n configuration.allowedTerritories = qtAny.allowedTerritories;\n }\n }\n\n return {\n name: qt.name,\n systemType: systemType,\n configuration: configuration\n };\n }),\n qualifiers: Array.from(system.qualifiers.values()).map((q) => {\n console.log('[Bundle Processing] Extracting qualifier:', q);\n // Instantiated Qualifier objects have .type property which is a QualifierType object\n const qAny = q as unknown as Record<string, unknown>;\n const typeName = (q.type as QualifierTypes.QualifierType)?.name || qAny.typeName;\n if (!typeName) {\n console.error('[Bundle Processing] Missing typeName for qualifier:', q);\n }\n return {\n name: q.name,\n typeName: (typeName || 'unknown') as string,\n token: q.token,\n defaultPriority: q.defaultPriority || 500,\n defaultValue: q.defaultValue,\n tokenIsOptional: q.tokenIsOptional || false\n } as Qualifiers.IQualifierDecl;\n }),\n resourceTypes: Array.from(system.resourceTypes.values()).map((rt, index: number) => {\n console.log('[Bundle Processing] Extracting resource type:', rt);\n // ResourceTypes in bundles might not have a name property\n // Default to 'json' for JsonResourceType\n const rtAny = rt as unknown as Record<string, unknown>;\n const typeName = rt.constructor?.name === 'JsonResourceType' ? 'json' : rtAny.typeName || 'json';\n return {\n name: (rtAny.name || `resourceType${index}`) as string, // Provide a default name if missing\n typeName: typeName as string\n } as ResourceTypes.Config.IResourceTypeConfig;\n })\n };\n\n console.log('[Bundle Processing] Extracted configuration for UI:', configForStorage);\n\n // Extract resource IDs from the loaded resource manager\n const resourceIds: string[] = [];\n let resourceCount = 0;\n\n // The resource manager is now fully loaded with all bundle resources\n // Extract resource IDs from the compiled collection for tracking\n if (compiledCollection.resources) {\n for (const resource of compiledCollection.resources) {\n const resourceId = resource.id || `resource-${resourceCount}`;\n resourceIds.push(resourceId);\n resourceCount++;\n }\n }\n\n console.log(`Bundle loaded with ${resourceCount} resources (with candidates):`, resourceIds);\n\n // Create a resolver using the bundle's resource manager\n const resolverResult = Runtime.ResourceResolver.create({\n resourceManager: system.resourceManager,\n qualifierTypes: system.qualifierTypes,\n contextQualifierProvider: system.contextQualifierProvider\n });\n\n if (resolverResult.isFailure()) {\n throw new Error(`Failed to create resolver: ${resolverResult.message}`);\n }\n\n // No longer create a separate CompiledResourceCollection manager\n // We'll derive the compiled collection from ResourceManagerBuilder when needed\n\n // Create the processed resources structure with bundle data\n const processedResources: ProcessedResources = {\n system: {\n qualifierTypes: system.qualifierTypes,\n qualifiers: system.qualifiers,\n resourceTypes: system.resourceTypes,\n resourceManager: system.resourceManager,\n importManager: system.importManager,\n contextQualifierProvider: system.contextQualifierProvider\n },\n compiledCollection,\n resolver: resolverResult.value,\n resourceCount,\n summary: {\n totalResources: resourceCount,\n resourceIds,\n errorCount: 0,\n warnings: [`Bundle loaded with ${resourceCount} resources from compiled collection`]\n }\n };\n\n console.log('[Bundle Processing] Setting final state...', {\n resourceCount,\n resourceIds,\n configForStorage,\n hasProcessedResources: !!processedResources\n });\n\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n processedResources,\n hasProcessedData: true,\n error: null,\n activeConfiguration: configForStorage,\n isLoadedFromBundle: true,\n bundleMetadata: metadata\n }));\n\n console.log('[Bundle Processing] Bundle processing completed successfully!');\n } catch (error) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: error instanceof Error ? error.message : String(error)\n }));\n }\n }, []);\n\n const clearError = useCallback(() => {\n setState((prev) => ({ ...prev, error: null }));\n }, []);\n\n const reset = useCallback(() => {\n setState(initialState);\n }, []);\n\n const resolveResource = useCallback(\n async (resourceId: string, context?: Record<string, string>): Promise<Result<JsonValue>> => {\n if (!state.processedResources?.system?.resourceManager) {\n return fail('No resources loaded');\n }\n\n try {\n // Get the resource from the resource manager\n const resourceResult = state.processedResources.system.resourceManager.getBuiltResource(resourceId);\n if (resourceResult.isFailure()) {\n return fail(`Resource not found: ${resourceId}`);\n }\n\n // Get the resource and convert to JSON\n const resource = resourceResult.value;\n\n // For now, return a simple representation since we don't have full resolution context\n // TODO: Use proper converters from ts-json-base when implementing full resolution\n const resourceJson = {\n id: resource.id as string,\n type: resource.resourceType as unknown,\n candidateCount: resource.candidates.length\n };\n return succeed(resourceJson as unknown as JsonValue);\n } catch (error) {\n return fail(`Failed to resolve resource: ${error instanceof Error ? error.message : String(error)}`);\n }\n },\n [state.processedResources]\n );\n\n const applyConfiguration = useCallback((config: Config.Model.ISystemConfiguration) => {\n setState((prev) => ({ ...prev, activeConfiguration: config }));\n }, []);\n\n const updateProcessedResources = useCallback((processedResources: ProcessedResources) => {\n setState((prev) => ({\n ...prev,\n processedResources,\n hasProcessedData: true\n }));\n }, []);\n\n return {\n state,\n actions: {\n processDirectory,\n processDirectoryWithConfig,\n processFiles,\n processBundleFile,\n clearError,\n reset,\n resolveResource,\n applyConfiguration,\n updateProcessedResources\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Message } from '../types';
|
|
2
|
+
export interface UseViewStateReturn {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
selectedResourceId: string | null;
|
|
5
|
+
addMessage: (type: Message['type'], message: string) => void;
|
|
6
|
+
clearMessages: () => void;
|
|
7
|
+
selectResource: (resourceId: string | null) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useViewState(): UseViewStateReturn;
|
|
10
|
+
//# sourceMappingURL=useViewState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewState.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,YAAY,IAAI,kBAAkB,CAgCjD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
export function useViewState() {
|
|
3
|
+
const [messages, setMessages] = useState([]);
|
|
4
|
+
const [selectedResourceId, setSelectedResourceId] = useState(null);
|
|
5
|
+
const addMessage = useCallback((type, message) => {
|
|
6
|
+
const newMessage = {
|
|
7
|
+
id: `msg-${Date.now()}-${Math.random()}`,
|
|
8
|
+
type,
|
|
9
|
+
message,
|
|
10
|
+
timestamp: new Date()
|
|
11
|
+
};
|
|
12
|
+
setMessages((prev) => [...prev, newMessage]);
|
|
13
|
+
// No auto-clearing - let users manage messages with filters
|
|
14
|
+
}, []);
|
|
15
|
+
const clearMessages = useCallback(() => {
|
|
16
|
+
setMessages([]);
|
|
17
|
+
}, []);
|
|
18
|
+
const selectResource = useCallback((resourceId) => {
|
|
19
|
+
setSelectedResourceId(resourceId);
|
|
20
|
+
}, []);
|
|
21
|
+
return {
|
|
22
|
+
messages,
|
|
23
|
+
selectedResourceId,
|
|
24
|
+
addMessage,
|
|
25
|
+
clearMessages,
|
|
26
|
+
selectResource
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=useViewState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewState.js","sourceRoot":"","sources":["../../src/hooks/useViewState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAW9C,MAAM,UAAU,YAAY;IAC1B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAY,EAAE,CAAC,CAAC;IACxD,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAElF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,IAAqB,EAAE,OAAe,EAAE,EAAE;QACxE,MAAM,UAAU,GAAY;YAC1B,EAAE,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;YACxC,IAAI;YACJ,OAAO;YACP,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC;QAEF,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;QAE7C,4DAA4D;IAC9D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,WAAW,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,UAAyB,EAAE,EAAE;QAC/D,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,QAAQ;QACR,kBAAkB;QAClB,UAAU;QACV,aAAa;QACb,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useCallback } from 'react';\nimport { Message } from '../types';\n\nexport interface UseViewStateReturn {\n messages: Message[];\n selectedResourceId: string | null;\n addMessage: (type: Message['type'], message: string) => void;\n clearMessages: () => void;\n selectResource: (resourceId: string | null) => void;\n}\n\nexport function useViewState(): UseViewStateReturn {\n const [messages, setMessages] = useState<Message[]>([]);\n const [selectedResourceId, setSelectedResourceId] = useState<string | null>(null);\n\n const addMessage = useCallback((type: Message['type'], message: string) => {\n const newMessage: Message = {\n id: `msg-${Date.now()}-${Math.random()}`,\n type,\n message,\n timestamp: new Date()\n };\n\n setMessages((prev) => [...prev, newMessage]);\n\n // No auto-clearing - let users manage messages with filters\n }, []);\n\n const clearMessages = useCallback(() => {\n setMessages([]);\n }, []);\n\n const selectResource = useCallback((resourceId: string | null) => {\n setSelectedResourceId(resourceId);\n }, []);\n\n return {\n messages,\n selectedResourceId,\n addMessage,\n clearMessages,\n selectResource\n };\n}\n"]}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { ImportView } from './components/views/ImportView';
|
|
3
|
+
export { SourceView } from './components/views/SourceView';
|
|
4
|
+
export { FilterView } from './components/views/FilterView';
|
|
5
|
+
export { CompiledView } from './components/views/CompiledView';
|
|
6
|
+
export { ResolutionView } from './components/views/ResolutionView';
|
|
7
|
+
export { ZipLoaderView } from './components/views/ZipLoaderView';
|
|
8
|
+
export { ConfigurationView } from './components/views/ConfigurationView';
|
|
9
|
+
export { ResourceOrchestrator } from './components/orchestrator/ResourceOrchestrator';
|
|
10
|
+
export { QualifierTypeEditForm } from './components/forms/QualifierTypeEditForm';
|
|
11
|
+
export { QualifierEditForm } from './components/forms/QualifierEditForm';
|
|
12
|
+
export { ResourceTypeEditForm } from './components/forms/ResourceTypeEditForm';
|
|
13
|
+
export { ResourceTreeView } from './components/common/ResourceTreeView';
|
|
14
|
+
export { ResourceListView } from './components/common/ResourceListView';
|
|
15
|
+
export { QualifierContextControl } from './components/common/QualifierContextControl';
|
|
16
|
+
export { useResourceData } from './hooks/useResourceData';
|
|
17
|
+
export { useFilterState } from './hooks/useFilterState';
|
|
18
|
+
export { useViewState } from './hooks/useViewState';
|
|
19
|
+
export { useResolutionState } from './hooks/useResolutionState';
|
|
20
|
+
export { useConfigurationState } from './hooks/useConfigurationState';
|
|
21
|
+
export * from './utils/tsResIntegration';
|
|
22
|
+
export * from './utils/fileProcessing';
|
|
23
|
+
export { createFilteredResourceManagerSimple, analyzeFilteredResources, hasFilterValues, getFilterSummary, type FilterOptions } from './utils/filterResources';
|
|
24
|
+
export * from './utils/resolutionUtils';
|
|
25
|
+
export * from './utils/zipLoader';
|
|
26
|
+
export * from './utils/configurationUtils';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAGtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAGtF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Export types
|
|
2
|
+
export * from './types';
|
|
3
|
+
// Export views
|
|
4
|
+
export { ImportView } from './components/views/ImportView';
|
|
5
|
+
export { SourceView } from './components/views/SourceView';
|
|
6
|
+
export { FilterView } from './components/views/FilterView';
|
|
7
|
+
export { CompiledView } from './components/views/CompiledView';
|
|
8
|
+
export { ResolutionView } from './components/views/ResolutionView';
|
|
9
|
+
export { ZipLoaderView } from './components/views/ZipLoaderView';
|
|
10
|
+
export { ConfigurationView } from './components/views/ConfigurationView';
|
|
11
|
+
// Export orchestrator
|
|
12
|
+
export { ResourceOrchestrator } from './components/orchestrator/ResourceOrchestrator';
|
|
13
|
+
// Export forms
|
|
14
|
+
export { QualifierTypeEditForm } from './components/forms/QualifierTypeEditForm';
|
|
15
|
+
export { QualifierEditForm } from './components/forms/QualifierEditForm';
|
|
16
|
+
export { ResourceTypeEditForm } from './components/forms/ResourceTypeEditForm';
|
|
17
|
+
// Export common components
|
|
18
|
+
export { ResourceTreeView } from './components/common/ResourceTreeView';
|
|
19
|
+
export { ResourceListView } from './components/common/ResourceListView';
|
|
20
|
+
export { QualifierContextControl } from './components/common/QualifierContextControl';
|
|
21
|
+
// Export hooks
|
|
22
|
+
export { useResourceData } from './hooks/useResourceData';
|
|
23
|
+
export { useFilterState } from './hooks/useFilterState';
|
|
24
|
+
export { useViewState } from './hooks/useViewState';
|
|
25
|
+
export { useResolutionState } from './hooks/useResolutionState';
|
|
26
|
+
export { useConfigurationState } from './hooks/useConfigurationState';
|
|
27
|
+
// Export utilities
|
|
28
|
+
export * from './utils/tsResIntegration';
|
|
29
|
+
export * from './utils/fileProcessing';
|
|
30
|
+
export { createFilteredResourceManagerSimple, analyzeFilteredResources, hasFilterValues, getFilterSummary } from './utils/filterResources';
|
|
31
|
+
export * from './utils/resolutionUtils';
|
|
32
|
+
export * from './utils/zipLoader';
|
|
33
|
+
export * from './utils/configurationUtils';
|
|
34
|
+
//# sourceMappingURL=index.js.map
|