@fgv/ts-res-ui-components 5.1.0-2 → 5.1.0-21
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/lib/components/common/AppHeader.d.ts.map +1 -0
- package/lib/components/common/AppHeader.js.map +1 -0
- package/lib/components/common/AppLayout.d.ts.map +1 -0
- package/lib/components/common/AppLayout.js.map +1 -0
- package/lib/components/common/AppSidebar.d.ts.map +1 -0
- package/lib/components/common/AppSidebar.js.map +1 -0
- package/lib/components/common/NavigationWarningModal.d.ts.map +1 -0
- package/lib/components/common/NavigationWarningModal.js.map +1 -0
- package/lib/components/common/QualifierContextControl.d.ts.map +1 -0
- package/lib/components/common/QualifierContextControl.js.map +1 -0
- package/lib/components/common/ResolutionContextOptionsControl.d.ts.map +1 -0
- package/lib/components/common/ResolutionContextOptionsControl.js.map +1 -0
- package/lib/components/common/ResolutionResults/index.d.ts.map +1 -0
- package/lib/components/common/ResolutionResults/index.js.map +1 -0
- package/lib/components/common/ResourceListView.d.ts.map +1 -0
- package/lib/components/common/ResourceListView.js.map +1 -0
- package/lib/components/common/ResourcePickerOptionsControl.d.ts.map +1 -0
- package/lib/components/common/ResourcePickerOptionsControl.js.map +1 -0
- package/lib/components/common/ResourceTreeView.d.ts.map +1 -0
- package/lib/components/common/ResourceTreeView.js.map +1 -0
- package/lib/components/common/SourceResourceDetail/index.d.ts.map +1 -0
- package/lib/components/common/SourceResourceDetail/index.js.map +1 -0
- package/lib/components/forms/GenericQualifierTypeEditForm.d.ts.map +1 -0
- package/lib/components/forms/GenericQualifierTypeEditForm.js.map +1 -0
- package/lib/components/forms/HierarchyEditor.d.ts.map +1 -0
- package/lib/components/forms/HierarchyEditor.js.map +1 -0
- package/lib/components/forms/QualifierEditForm.d.ts.map +1 -0
- package/lib/components/forms/QualifierEditForm.js.map +1 -0
- package/lib/components/forms/QualifierTypeEditForm.d.ts.map +1 -0
- package/lib/components/forms/QualifierTypeEditForm.js.map +1 -0
- package/lib/components/forms/ResourceTypeEditForm.d.ts.map +1 -0
- package/lib/components/forms/ResourceTypeEditForm.js.map +1 -0
- package/lib/components/forms/index.d.ts.map +1 -0
- package/lib/components/forms/index.js.map +1 -0
- package/lib/components/orchestrator/ResourceOrchestrator.d.ts.map +1 -0
- package/lib/components/orchestrator/ResourceOrchestrator.js.map +1 -0
- package/lib/components/pickers/ResourcePicker/ResourceItem.d.ts.map +1 -0
- package/lib/components/pickers/ResourcePicker/ResourceItem.js.map +1 -0
- package/lib/components/pickers/ResourcePicker/ResourcePickerList.d.ts.map +1 -0
- package/lib/components/pickers/ResourcePicker/ResourcePickerList.js.map +1 -0
- package/lib/components/pickers/ResourcePicker/ResourcePickerTree.d.ts.map +1 -0
- package/lib/components/pickers/ResourcePicker/ResourcePickerTree.js.map +1 -0
- package/lib/components/pickers/ResourcePicker/index.d.ts.map +1 -0
- package/lib/components/pickers/ResourcePicker/index.js.map +1 -0
- package/lib/components/pickers/ResourcePicker/types.d.ts.map +1 -0
- package/lib/components/pickers/ResourcePicker/types.js.map +1 -0
- package/lib/components/pickers/ResourcePicker/utils/treeNavigation.d.ts.map +1 -0
- package/lib/components/pickers/ResourcePicker/utils/treeNavigation.js.map +1 -0
- package/lib/components/views/CompiledView/index.d.ts.map +1 -0
- package/lib/components/views/CompiledView/index.js.map +1 -0
- package/lib/components/views/ConfigurationView/index.d.ts.map +1 -0
- package/lib/components/views/ConfigurationView/index.js.map +1 -0
- package/lib/components/views/FilterView/index.d.ts.map +1 -0
- package/lib/components/views/FilterView/index.js.map +1 -0
- package/lib/components/views/GridView/EditableGridCell.d.ts.map +1 -0
- package/lib/components/views/GridView/EditableGridCell.js.map +1 -0
- package/lib/components/views/GridView/GridSelector.d.ts.map +1 -0
- package/lib/components/views/GridView/GridSelector.js.map +1 -0
- package/lib/components/views/GridView/MultiGridView.d.ts.map +1 -0
- package/lib/components/views/GridView/MultiGridView.js.map +1 -0
- package/lib/components/views/GridView/ResourceGrid.d.ts.map +1 -0
- package/lib/components/views/GridView/ResourceGrid.js.map +1 -0
- package/lib/components/views/GridView/SharedContextControls.d.ts.map +1 -0
- package/lib/components/views/GridView/SharedContextControls.js.map +1 -0
- package/lib/components/views/GridView/cells/BooleanCell.d.ts.map +1 -0
- package/lib/components/views/GridView/cells/BooleanCell.js.map +1 -0
- package/lib/components/views/GridView/cells/DropdownCell.d.ts.map +1 -0
- package/lib/components/views/GridView/cells/DropdownCell.js.map +1 -0
- package/lib/components/views/GridView/cells/StringCell.d.ts.map +1 -0
- package/lib/components/views/GridView/cells/StringCell.js.map +1 -0
- package/lib/components/views/GridView/cells/TriStateCell.d.ts.map +1 -0
- package/lib/components/views/GridView/cells/TriStateCell.js.map +1 -0
- package/lib/components/views/GridView/cells/index.d.ts.map +1 -0
- package/lib/components/views/GridView/cells/index.js.map +1 -0
- package/lib/components/views/GridView/index.d.ts.map +1 -0
- package/lib/components/views/GridView/index.js.map +1 -0
- package/lib/components/views/ImportView/index.d.ts.map +1 -0
- package/lib/components/views/ImportView/index.js.map +1 -0
- package/lib/components/views/MessagesWindow/index.d.ts.map +1 -0
- package/lib/components/views/MessagesWindow/index.js.map +1 -0
- package/lib/components/views/ResolutionView/EditableJsonView.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/EditableJsonView.js.map +1 -0
- package/lib/components/views/ResolutionView/NewResourceModal.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/NewResourceModal.js.map +1 -0
- package/lib/components/views/ResolutionView/UnifiedChangeControls.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/UnifiedChangeControls.js.map +1 -0
- package/lib/components/views/ResolutionView/index.d.ts.map +1 -0
- package/lib/components/views/ResolutionView/index.js.map +1 -0
- package/lib/components/views/SourceView/index.d.ts.map +1 -0
- package/lib/components/views/SourceView/index.js.map +1 -0
- package/lib/contexts/ObservabilityContext.d.ts.map +1 -0
- package/lib/contexts/ObservabilityContext.js.map +1 -0
- package/lib/contexts/index.d.ts.map +1 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useConfigurationState.d.ts.map +1 -0
- package/lib/hooks/useConfigurationState.js.map +1 -0
- package/lib/hooks/useFilterState.d.ts.map +1 -0
- package/lib/hooks/useFilterState.js.map +1 -0
- package/lib/hooks/useNavigationWarning.d.ts.map +1 -0
- package/lib/hooks/useNavigationWarning.js.map +1 -0
- package/lib/hooks/useResolutionState.d.ts.map +1 -0
- package/lib/hooks/useResolutionState.js.map +1 -0
- package/lib/hooks/useResourceData.d.ts.map +1 -0
- package/lib/hooks/useResourceData.js.map +1 -0
- package/lib/hooks/useSmartObservability.d.ts.map +1 -0
- package/lib/hooks/useSmartObservability.js.map +1 -0
- package/lib/hooks/useUrlParams.d.ts.map +1 -0
- package/lib/hooks/useUrlParams.js.map +1 -0
- package/lib/hooks/useViewState.d.ts.map +1 -0
- package/lib/hooks/useViewState.js.map +1 -0
- package/lib/index.browser.d.ts.map +1 -0
- package/lib/index.browser.js.map +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/namespaces/ConfigurationTools.d.ts.map +1 -0
- package/lib/namespaces/ConfigurationTools.js.map +1 -0
- package/lib/namespaces/DownloadTools.d.ts.map +1 -0
- package/lib/namespaces/DownloadTools.js.map +1 -0
- package/lib/namespaces/FilterTools.d.ts.map +1 -0
- package/lib/namespaces/FilterTools.js.map +1 -0
- package/lib/namespaces/GridTools.d.ts.map +1 -0
- package/lib/namespaces/GridTools.js.map +1 -0
- package/lib/namespaces/ImportTools.d.ts.map +1 -0
- package/lib/namespaces/ImportTools.js.map +1 -0
- package/lib/namespaces/ObservabilityTools.d.ts.map +1 -0
- package/lib/namespaces/ObservabilityTools.js.map +1 -0
- package/lib/namespaces/PickerTools.d.ts.map +1 -0
- package/lib/namespaces/PickerTools.js.map +1 -0
- package/lib/namespaces/ResolutionTools.d.ts.map +1 -0
- package/lib/namespaces/ResolutionTools.js.map +1 -0
- package/lib/namespaces/ResourceTools.d.ts.map +1 -0
- package/lib/namespaces/ResourceTools.js.map +1 -0
- package/lib/namespaces/TsResTools.d.ts.map +1 -0
- package/lib/namespaces/TsResTools.js.map +1 -0
- package/lib/namespaces/ViewStateTools.d.ts.map +1 -0
- package/lib/namespaces/ViewStateTools.js.map +1 -0
- package/lib/namespaces/ZipTools.d.ts.map +1 -0
- package/lib/namespaces/ZipTools.js.map +1 -0
- package/lib/namespaces/index.d.ts.map +1 -0
- package/lib/namespaces/index.js.map +1 -0
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utils/cellValidation.d.ts.map +1 -0
- package/lib/utils/cellValidation.js.map +1 -0
- package/lib/utils/configurationUtils.d.ts.map +1 -0
- package/lib/utils/configurationUtils.js.map +1 -0
- package/lib/utils/downloadHelper.d.ts.map +1 -0
- package/lib/utils/downloadHelper.js.map +1 -0
- package/lib/utils/filterResources.d.ts.map +1 -0
- package/lib/utils/filterResources.js.map +1 -0
- package/lib/utils/observability/factories.d.ts.map +1 -0
- package/lib/utils/observability/factories.js.map +1 -0
- package/lib/utils/observability/implementations.d.ts.map +1 -0
- package/lib/utils/observability/implementations.js.map +1 -0
- package/lib/utils/observability/index.d.ts.map +1 -0
- package/lib/utils/observability/index.js.map +1 -0
- package/lib/utils/observability/interfaces.d.ts.map +1 -0
- package/lib/utils/observability/interfaces.js.map +1 -0
- package/lib/utils/resolutionEditing.d.ts.map +1 -0
- package/lib/utils/resolutionEditing.js.map +1 -0
- package/lib/utils/resolutionUtils.d.ts.map +1 -0
- package/lib/utils/resolutionUtils.js.map +1 -0
- package/lib/utils/resourceSelector.d.ts.map +1 -0
- package/lib/utils/resourceSelector.js.map +1 -0
- package/lib/utils/resourceSelectors.d.ts.map +1 -0
- package/lib/utils/resourceSelectors.js.map +1 -0
- package/lib/utils/tsResIntegration.d.ts.map +1 -0
- package/lib/utils/tsResIntegration.js.map +1 -0
- package/lib/utils/zipLoader/index.d.ts.map +1 -0
- package/lib/utils/zipLoader/index.js.map +1 -0
- package/lib/utils/zipLoader/zipProcessingHelpers.d.ts.map +1 -0
- package/lib/utils/zipLoader/zipProcessingHelpers.js.map +1 -0
- package/lib/utils/zipLoader/zipUtils.d.ts.map +1 -0
- package/lib/utils/zipLoader/zipUtils.js.map +1 -0
- package/package.json +25 -23
- package/dist/ts-res-ui-components.d.ts +0 -6795
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PickerTools.js","sourceRoot":"","sources":["../../src/namespaces/PickerTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAEH,2CAA2C;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,8CAA8C;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC","sourcesContent":["/**\n * Tools and components for resource selection and picking operations.\n *\n * This namespace contains the ResourcePicker component and related utilities for\n * browsing, searching, and selecting resources with support for annotations,\n * pending resources, and comprehensive selection data.\n *\n * @example\n * ```tsx\n * import { PickerTools } from '@fgv/ts-res-ui-components';\n *\n * // Use the ResourcePicker component\n * <PickerTools.ResourcePicker\n * resources={processedResources}\n * selectedResourceId={currentId}\n * onResourceSelect={(selection) => {\n * setCurrentId(selection.resourceId);\n * if (selection.resourceData) {\n * handleResourceData(selection.resourceData);\n * }\n * }}\n * options={{\n * defaultView: \"tree\",\n * enableSearch: true\n * }}\n * resourceAnnotations={{\n * 'res1': { badge: { text: '3', variant: 'info' } }\n * }}\n * />\n *\n * // Use the ResourcePickerOptionsControl for interactive configuration\n * <PickerTools.ResourcePickerOptionsControl\n * options={pickerOptions}\n * onOptionsChange={setPickerOptions}\n * mode=\"collapsible\"\n * title=\"Picker Settings\"\n * showAdvanced={true}\n * />\n * ```\n *\n * @example\n * ```typescript\n * // Working with resource selection data\n * import { PickerTools } from '@fgv/ts-res-ui-components';\n *\n * const handleResourceSelect = (selection: PickerTools.ResourceSelection<MyResourceType>) => {\n * if (selection.resourceId) {\n * console.log('Selected:', selection.resourceId);\n * if (selection.resourceData) {\n * console.log('Data:', selection.resourceData);\n * }\n * if (selection.isPending) {\n * console.log('Pending operation:', selection.pendingType);\n * }\n * }\n * };\n * ```\n *\n * @example\n * ```typescript\n * // Using annotations and pending resources\n * import { PickerTools } from '@fgv/ts-res-ui-components';\n *\n * const annotations: PickerTools.ResourceAnnotations = {\n * 'user.welcome': {\n * badge: { text: 'Modified', variant: 'warning' },\n * icon: 'pencil'\n * },\n * 'user.goodbye': {\n * badge: { text: 'New', variant: 'success' }\n * }\n * };\n *\n * const pendingResources: PickerTools.PendingResource[] = [\n * {\n * id: 'temp-1',\n * name: 'New Resource',\n * type: 'new',\n * data: { value: 'Temporary data' }\n * }\n * ];\n * ```\n *\n * @public\n */\n\n// Export the main ResourcePicker component\nexport { ResourcePicker } from '../components/pickers/ResourcePicker';\n\n// Export ResourcePicker configuration control\nexport { ResourcePickerOptionsControl } from '../components/common/ResourcePickerOptionsControl';\n\n// Export types related to resource picking and selection\nexport type {\n IResourcePickerProps,\n IResourcePickerOptions,\n IResourceSelection,\n IResourceAnnotations,\n IResourceAnnotation,\n IPendingResource\n} from '../components/pickers/ResourcePicker/types';\n\n// Export types for the options control\nexport type { IResourcePickerOptionsControlProps } from '../components/common/ResourcePickerOptionsControl';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResolutionTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/ResolutionTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAA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C9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,2BAA2B;AAC3B,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EAEzB,MAAM,0BAA0B,CAAC;AAElC,6EAA6E;AAC7E,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC","sourcesContent":["/**\n * Tools and components for resource resolution operations.\n *\n * This namespace contains the ResolutionView component and utility functions for\n * creating resolvers, evaluating conditions, and managing resolution context for\n * resource resolution testing and analysis.\n *\n * @example\n * ```tsx\n * import { ResolutionTools } from '@fgv/ts-res-ui-components';\n *\n * // Use the ResolutionView component\n * <ResolutionTools.ResolutionView\n * resources={processedResources}\n * resolutionState={resolutionState}\n * resolutionActions={resolutionActions}\n * editorFactory={customEditorFactory}\n * />\n *\n * // Or use utility functions\n * const resolver = ResolutionTools.createResolverWithContext(\n * processedResources,\n * { language: 'en-US', platform: 'web' }\n * );\n * ```\n *\n * @public\n */\n\n// Export the main ResolutionView component\nexport { ResolutionView } from '../components/views/ResolutionView';\n\n// Export resolution-related sub-components\nexport { EditableJsonView } from '../components/views/ResolutionView/EditableJsonView';\nexport { UnifiedChangeControls } from '../components/views/ResolutionView/UnifiedChangeControls';\nexport { QualifierContextControl } from '../components/common/QualifierContextControl';\nexport { ResolutionContextOptionsControl } from '../components/common/ResolutionContextOptionsControl';\n\n// Export domain-specific hook\nexport { useResolutionState } from '../hooks/useResolutionState';\n\n// Export utility functions\nexport {\n createResolverWithContext,\n evaluateConditionsForCandidate,\n resolveResourceDetailed,\n getAvailableQualifiers,\n hasPendingContextChanges,\n type IResolutionOptions\n} from '../utils/resolutionUtils';\n\n// Export resource selector utility functions for pending resource management\nexport {\n getPendingAdditionsByType,\n isPendingAddition,\n deriveLeafId,\n deriveFullId,\n getPendingResourceTypes,\n getPendingResourceStats,\n validatePendingResourceKeys\n} from '../utils/resourceSelectors';\n\n// Export types related to resource resolution\nexport type {\n IResolutionState,\n IResolutionActions,\n IResolutionViewProps,\n IResolutionResult,\n ICandidateInfo,\n IConditionEvaluationResult,\n IEditedResourceInfo,\n IResolutionContextOptions,\n IQualifierControlOptions,\n ICreatePendingResourceParams\n} from '../types';\n\n// Export types for resolution components\nexport type { IEditableJsonViewProps } from '../components/views/ResolutionView/EditableJsonView';\nexport type { IResolutionContextOptionsControlProps } from '../components/common/ResolutionContextOptionsControl';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/ResourceTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,YAAY,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceTools.js","sourceRoot":"","sources":["../../src/namespaces/ResourceTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAEH,kDAAkD;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * Tools and hooks for resource data management and orchestration.\n *\n * This namespace contains the core data management functionality for ts-res resources,\n * including the main orchestrator hook that handles resource import, processing, configuration,\n * and resolution. This is the primary entry point for managing resource data state.\n *\n * @example\n * ```typescript\n * import { ResourceTools } from '@fgv/ts-res-ui-components';\n *\n * function ResourceManager() {\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * const handleFileImport = async (files: ImportedFile[]) => {\n * await actions.processFiles(files);\n * if (state.error) {\n * console.error('Import failed:', state.error);\n * } else {\n * console.log('Resources processed:', state.processedResources);\n * }\n * };\n *\n * return React.createElement('div', {},\n * React.createElement('button',\n * { onClick: () => handleFileImport(importedFiles) },\n * 'Process Resources'\n * ),\n * state.isProcessing && React.createElement('div', {}, 'Processing...'),\n * state.error && React.createElement('div', { className: 'error' }, state.error)\n * );\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Resource resolution example\n * import { ResourceTools } from '@fgv/ts-res-ui-components';\n *\n * function ResourceResolver() {\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * const resolveResource = async (resourceId: string, context: Record<string, string>) => {\n * const result = await actions.resolveResource(resourceId, context);\n * if (result.isSuccess()) {\n * console.log('Resolved:', result.value);\n * } else {\n * console.error('Resolution failed:', result.message);\n * }\n * };\n *\n * // Only show resolver if we have processed resources\n * if (!state.processedResources) {\n * return React.createElement('div', {}, 'No resources loaded');\n * }\n *\n * return React.createElement('button', {\n * onClick: () => resolveResource('user.welcome', { language: 'en-US' })\n * }, 'Resolve Resource');\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Configuration and bundle processing\n * import { ResourceTools } from '@fgv/ts-res-ui-components';\n *\n * function ConfigurationManager() {\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * const applyNewConfiguration = (config: Config.Model.ISystemConfiguration) => {\n * actions.applyConfiguration(config);\n * console.log('Configuration applied:', state.activeConfiguration);\n * };\n *\n * const processBundleFile = async (bundle: Bundle.IBundle) => {\n * await actions.processBundleFile(bundle);\n * if (state.isLoadedFromBundle) {\n * console.log('Bundle loaded:', state.bundleMetadata);\n * }\n * };\n *\n * return React.createElement('div', {},\n * React.createElement('h3', {}, 'Resource Orchestrator'),\n * React.createElement('p', {}, `Has data: ${state.hasProcessedData}`),\n * React.createElement('p', {}, `From bundle: ${state.isLoadedFromBundle}`)\n * );\n * }\n * ```\n *\n * @public\n */\n\n// Export the main resource data orchestrator hook\nexport { useResourceData } from '../hooks/useResourceData';\n\n// Export types related to resource management and processing\nexport type {\n IProcessedResources,\n IExtendedProcessedResources,\n IResourceManagerState,\n IResourceEditorFactory,\n ResourceEditorResult,\n IResourceEditorProps,\n IResourceDetailData\n} from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsResTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/TsResTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsResTools.js","sourceRoot":"","sources":["../../src/namespaces/TsResTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,wDAAwD;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,2BAA2B;AAC3B,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,2BAA2B,CAAC","sourcesContent":["/**\n * Tools and components for ts-res system integration and browsing.\n *\n * This namespace contains SourceView and CompiledView components for browsing ts-res\n * resource structures, plus utility functions for creating ts-res systems from\n * configurations, processing imported files, and converting between different resource formats.\n *\n * @example\n * ```tsx\n * import { TsResTools } from '@fgv/ts-res-ui-components';\n *\n * // Use the SourceView component for browsing source resources\n * <TsResTools.SourceView\n * resources={processedResources}\n * onExport={handleExport}\n * />\n *\n * // Use the CompiledView component for browsing compiled resources\n * <TsResTools.CompiledView\n * resources={processedResources}\n * filterState={filterState}\n * filterResult={filterResult}\n * />\n *\n * // Or use utility functions\n * const system = await TsResTools.createTsResSystemFromConfig(config);\n * ```\n *\n * @public\n */\n\n// Export view components for browsing ts-res structures\nexport { SourceView } from '../components/views/SourceView';\nexport { CompiledView } from '../components/views/CompiledView';\n\n// Export utility functions\nexport {\n getDefaultSystemConfiguration,\n createSimpleContext,\n createTsResSystemFromConfig,\n processFileTree\n} from '../utils/tsResIntegration';\n\n// Export view component props\nexport type { ISourceViewProps, ICompiledViewProps } from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewStateTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/ViewStateTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAGzF,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewStateTools.js","sourceRoot":"","sources":["../../src/namespaces/ViewStateTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH,2CAA2C;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,oCAAoC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/**\n * Tools and components for view state management and message handling.\n *\n * This namespace contains components and utilities for managing application view state,\n * displaying messages, and providing user feedback in development tools and interactive\n * applications. Includes the MessagesWindow component for comprehensive message management.\n *\n * @example\n * ```typescript\n * import { ViewStateTools } from '@fgv/ts-res-ui-components';\n *\n * // Use the MessagesWindow component\n * function MyTool() {\n * const [messages, setMessages] = useState<ViewStateTools.Message[]>([]);\n *\n * const addMessage = (type: ViewStateTools.Message['type'], text: string) => {\n * setMessages(prev => [...prev, {\n * id: `msg-${Date.now()}`,\n * type,\n * message: text,\n * timestamp: new Date()\n * }]);\n * };\n *\n * return React.createElement('div', {},\n * React.createElement('button',\n * { onClick: () => addMessage('info', 'Operation started') },\n * 'Add Message'\n * ),\n * React.createElement(ViewStateTools.MessagesWindow, {\n * messages,\n * onClearMessages: () => setMessages([])\n * })\n * );\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Integration with application state\n * import { ViewStateTools } from '@fgv/ts-res-ui-components';\n *\n * interface AppState {\n * messages: ViewStateTools.Message[];\n * // ... other state\n * }\n *\n * function App() {\n * const [state, setState] = useState<AppState>({\n * messages: []\n * });\n *\n * // Use the built-in hook for simpler state management\n * const { viewState, addMessage } = ViewStateTools.useViewState();\n *\n * // Set up observability context that connects to the view state\n * const observabilityContext = ObservabilityTools.createViewStateObservabilityContext(addMessage);\n *\n * // Component creates MessagesWindow at bottom of screen with observability\n * return React.createElement('div', { className: 'flex flex-col h-screen' },\n * React.createElement(ObservabilityProvider, { observabilityContext },\n * React.createElement('div', { className: 'flex-1' },\n * React.createElement(SomeComponent, {}) // Components automatically use observability\n * ),\n * React.createElement(ViewStateTools.MessagesWindow, {\n * messages: viewState.messages,\n * onClearMessages: viewState.clearMessages\n * })\n * )\n * );\n * }\n * ```\n *\n * @public\n */\n\n// Export the main MessagesWindow component\nexport { MessagesWindow } from '../components/views/MessagesWindow';\n\n// Export view state management hook\nexport { useViewState } from '../hooks/useViewState';\n\n// Export types for external consumption\nexport type { IMessage, IMessagesWindowProps } from '../components/views/MessagesWindow';\n\n// Export base view props (shared by all view components)\nexport type { IViewBaseProps } from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZipTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/ZipTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGxD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAGpG,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZipTools.js","sourceRoot":"","sources":["../../src/namespaces/ZipTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,4CAA4C;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,uFAAuF;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,mEAAmE;AACnE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC","sourcesContent":["/**\n * Tools and components for ZIP-based resource bundle management and importing.\n *\n * This namespace contains ImportView component and utilities for working with\n * ZIP-based resource bundles. Uses the ts-res zip-archive packlet for all ZIP operations,\n * and provides processing helpers for integrating ZIP data with ts-res-ui-components.\n *\n * @example\n * ```tsx\n * import { ZipTools } from '@fgv/ts-res-ui-components';\n * import { ZipArchive } from '@fgv/ts-res';\n *\n * // Use the ImportView component (handles ZIP files automatically)\n * <ZipTools.ImportView\n * onImport={handleFileImport}\n * onBundleImport={handleBundleImport}\n * onZipImport={handleZipImport}\n * />\n *\n * // Or use zip-archive packlet directly with processing helpers\n * const loader = new ZipArchive.ZipArchiveLoader();\n * const zipResult = await loader.loadFromFile(zipFile);\n *\n * if (zipResult.isSuccess()) {\n * const processResult = await ZipTools.processZipLoadResult(zipResult.value);\n * if (processResult.isSuccess()) {\n * console.log('Processed resources:', processResult.value);\n * }\n * }\n *\n * // Utility functions\n * const isZip = ZipTools.isZipFile('resources.zip');\n * ```\n *\n * @public\n */\n\n// Export the import-related view components\nexport { ImportView } from '../components/views/ImportView';\n\n// Essential ZIP utilities (other functionality provided by ts-res zip-archive packlet)\nexport { isZipFile } from '../utils/zipLoader/zipUtils';\n\n// ZIP processing helpers for integrating with ts-res-ui-components\nexport { processZipResources, processZipLoadResult } from '../utils/zipLoader/zipProcessingHelpers';\n\n// Export view component props\nexport type { IImportViewProps } from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/namespaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EACL,aAAa,EACb,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,QAAQ,EACR,WAAW,EACX,SAAS,EACT,kBAAkB,EACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/namespaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EACL,aAAa,EACb,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,QAAQ,EACR,WAAW,EACX,SAAS,EACT,kBAAkB,EACnB,CAAC","sourcesContent":["/**\n * Organized tool namespaces for ts-res-ui-components.\n *\n * Tools include both view components and utility functions organized into logical\n * namespaces to improve discoverability and reduce the flat export list in the main API.\n *\n * @example\n * ```tsx\n * import {\n * FilterTools,\n * ResolutionTools,\n * ResourceTools,\n * ViewStateTools,\n * ImportTools,\n * ZipTools,\n * PickerTools\n * } from '@fgv/ts-res-ui-components';\n *\n * // Use view components\n * <FilterTools.FilterView {...filterProps} />\n * <ResolutionTools.ResolutionView {...resolutionProps} />\n * <ViewStateTools.MessagesWindow {...messageProps} />\n * <ImportTools.ImportView {...importProps} />\n * <PickerTools.ResourcePicker {...pickerProps} />\n *\n * // Use hooks for state management\n * const { state, actions } = ResourceTools.useResourceData();\n * const { messages, addMessage } = ViewStateTools.useViewState();\n * const { state: filterState } = FilterTools.useFilterState();\n *\n * // Or use utility functions\n * const hasFilters = FilterTools.hasFilterValues(filterState.values);\n * const resolver = ResolutionTools.createResolverWithContext(resources, context);\n * const files = await ImportTools.readFilesFromInput(fileInput);\n * const zipLoader = ZipTools.createBrowserZipLoader();\n * ```\n *\n * @public\n */\n\nimport * as DownloadTools from './DownloadTools';\nimport * as FilterTools from './FilterTools';\nimport * as ResolutionTools from './ResolutionTools';\nimport * as ConfigurationTools from './ConfigurationTools';\nimport * as ResourceTools from './ResourceTools';\nimport * as ImportTools from './ImportTools';\nimport * as TsResTools from './TsResTools';\nimport * as ViewStateTools from './ViewStateTools';\nimport * as ZipTools from './ZipTools';\nimport * as PickerTools from './PickerTools';\nimport * as GridTools from './GridTools';\nimport * as ObservabilityTools from './ObservabilityTools';\n\nexport {\n DownloadTools,\n FilterTools,\n ResolutionTools,\n ConfigurationTools,\n ResourceTools,\n ImportTools,\n TsResTools,\n ViewStateTools,\n ZipTools,\n PickerTools,\n GridTools,\n ObservabilityTools\n};\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,aAAa,EACb,MAAM,EACP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iB,EACjB,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC","sourcesContent":["import { Result } from '@fgv/ts-utils';\nimport {\n ResourceJson,\n Config,\n Bundle,\n Resources,\n Runtime,\n QualifierTypes,\n Qualifiers,\n ResourceTypes,\n Import\n} from '@fgv/ts-res';\nimport { JsonCompatibleType, JsonValue, FileTree } from '@fgv/ts-json-base';\n// Import File System Access API types\nimport '@fgv/ts-web-extras';\n// IIResourcePickerOptions import removed - unused\nimport type { IObservabilityContext } from '../utils/observability';\nimport type { IResourcePickerOptions } from '../components/pickers/ResourcePicker/types';\n\n/**\n * Configuration options for edit validation.\n *\n * @public\n */\nexport interface IEditValidationResult {\n /** Whether the validation passed */\n isValid: boolean;\n /** Error message if validation failed */\n error?: string;\n}\n\n/**\n * Filter options for resource filtering.\n *\n * @public\n */\nexport interface IFilterOptions {\n /** Whether to enable partial context matching */\n partialContextMatch?: boolean;\n /** Whether to enable debug logging */\n enableDebugLogging?: boolean;\n}\n\n/**\n * Represents a user-facing message with type classification and timestamp.\n * Used throughout the UI components for displaying feedback to users.\n *\n * @public\n */\nexport interface IMessage {\n /** Unique identifier for the message */\n id: string;\n /** Classification of the message for UI styling and behavior */\n type: 'info' | 'warning' | 'error' | 'success';\n /** The text content of the message */\n message: string;\n /** When the message was created */\n timestamp: Date;\n}\n\n/**\n * Represents the current state of resource filtering.\n * Tracks filter configuration, values, and application state.\n *\n * @public\n */\nexport interface IFilterState {\n /** Whether filtering is currently enabled */\n enabled: boolean;\n /** Current filter values being edited (not yet applied) */\n values: Record<string, string | undefined>;\n /** Filter values that have been applied to the resource manager */\n appliedValues: Record<string, string | undefined>;\n /** Whether there are unsaved changes in the filter values */\n hasPendingChanges: boolean;\n /** Whether to reduce qualifiers when filtering (removes unused qualifier dimensions) */\n reduceQualifiers: boolean;\n}\n\n/**\n * Actions available for managing filter state.\n * Provides methods for updating all aspects of resource filtering.\n *\n * @public\n */\nexport interface IFilterActions {\n /** Enable or disable filtering */\n updateFilterEnabled: (enabled: boolean) => void;\n /** Update filter values (does not apply them until applyFilterValues is called) */\n updateFilterValues: (values: Record<string, string | undefined>) => void;\n /** Apply current filter values to create a filtered resource manager */\n applyFilterValues: () => void;\n /** Reset filter values to their applied state (discards pending changes) */\n resetFilterValues: () => void;\n /** Enable or disable qualifier reduction during filtering */\n updateReduceQualifiers: (reduceQualifiers: boolean) => void;\n}\n\n/**\n * Represents a fully processed ts-res system ready for use.\n * Contains both the runtime system components and the compiled resource collection.\n * This is the primary data structure used by all UI components.\n *\n * @public\n */\nexport interface IProcessedResources {\n /** Core ts-res system components */\n system: {\n /** Primary resource manager for building and managing resources */\n resourceManager: Resources.ResourceManagerBuilder;\n /** Collection of qualifier type definitions */\n qualifierTypes: QualifierTypes.ReadOnlyQualifierTypeCollector;\n /** Collection of qualifier declarations */\n qualifiers: Qualifiers.IReadOnlyQualifierCollector;\n /** Collection of resource type definitions */\n resourceTypes: ResourceTypes.ReadOnlyResourceTypeCollector;\n /** Manager for handling resource imports */\n importManager: Import.ImportManager;\n /** Provider for validating and managing runtime context */\n contextQualifierProvider: Runtime.ValidatingSimpleContextQualifierProvider;\n };\n /** Compiled version of the resource collection for efficient resolution */\n compiledCollection: ResourceJson.Compiled.ICompiledResourceCollection;\n /** Resource resolver for runtime resource resolution */\n resolver: Runtime.ResourceResolver;\n /** Total count of resources in the system */\n resourceCount: number;\n /** Summary information about the resource system */\n summary: {\n /** Total number of resources */\n totalResources: number;\n /** Array of all resource identifiers */\n resourceIds: string[];\n /** Number of errors encountered during processing */\n errorCount: number;\n /** Array of warning messages from processing */\n warnings: string[];\n };\n}\n\n/**\n * Extended processed resources with additional metadata and context.\n * Includes information about source configuration and bundle loading.\n *\n * @public\n */\nexport interface IExtendedProcessedResources extends IProcessedResources {\n /** The configuration used to create this resource system */\n activeConfiguration?: Config.Model.ISystemConfiguration | null;\n /** Whether this system was loaded from a bundle file */\n isLoadedFromBundle?: boolean;\n /** Metadata from the bundle file, if loaded from bundle */\n bundleMetadata?: Bundle.IBundleMetadata | null;\n}\n\n/**\n * Represents the current state of the resource manager.\n * Tracks processing status, data, and any errors.\n *\n * @public\n */\nexport interface IResourceManagerState {\n /** Whether the system is currently processing resources */\n isProcessing: boolean;\n /** The processed resource system, or null if not yet processed */\n processedResources: IExtendedProcessedResources | null;\n /** Current error message, or null if no error */\n error: string | null;\n /** Whether any resource data has been successfully processed */\n hasProcessedData: boolean;\n /** The active system configuration */\n activeConfiguration: Config.Model.ISystemConfiguration | null;\n /** Whether the current data was loaded from a bundle */\n isLoadedFromBundle: boolean;\n /** Bundle metadata if loaded from bundle */\n bundleMetadata: Bundle.IBundleMetadata | null;\n}\n\n// IImportedFile and IImportedDirectory interfaces removed - replaced with FileTree\n\n/**\n * Base properties shared by all view components.\n * Provides common functionality for messaging and styling.\n *\n * @public\n */\nexport interface IViewBaseProps {\n /** Additional CSS class names for styling */\n className?: string;\n /** How to present the ResourcePicker options control panel (default: 'hidden' for production use) */\n pickerOptionsPanelPresentation?: 'hidden' | 'inline' | 'collapsible' | 'popup' | 'popover';\n}\n\n/**\n * Props for the ImportView component.\n * Handles importing resource configurations and bundles.\n *\n * @public\n */\nexport interface IImportViewProps extends IViewBaseProps {\n /** Callback when resource files/directories are imported */\n onImport?: (data: FileTree.FileTree) => void;\n /** Callback when a bundle file is imported */\n onBundleImport?: (bundle: Bundle.IBundle) => void;\n /** Callback when a ZIP file is imported with optional configuration */\n onZipImport?: (zipData: FileTree.FileTree, config?: Config.Model.ISystemConfiguration) => void;\n /** File types accepted for import */\n acceptedFileTypes?: string[];\n /** External error state to override local import status */\n importError?: string | null;\n}\n\n/**\n * Props for the SourceView component.\n * Displays and manages the source resource collection.\n *\n * @public\n */\nexport interface ISourceViewProps extends IViewBaseProps {\n /** The processed resource system to display */\n resources?: IExtendedProcessedResources | null;\n /** Optional filter state for filtered views */\n filterState?: IFilterState;\n /** Result of filtering if applied */\n filterResult?: IFilterResult | null;\n /** Currently selected resource ID for detailed view */\n selectedResourceId?: string | null;\n /** Callback when a resource is selected */\n onResourceSelect?: (resourceId: string) => void;\n /** Callback when exporting resource collection data */\n onExport?: (data: unknown, type: 'json') => void;\n /** Optional configuration for the ResourcePicker behavior */\n pickerOptions?: IResourcePickerOptions;\n}\n\n/**\n * Props for the FilterView component.\n * Provides resource filtering functionality.\n *\n * @public\n */\nexport interface IFilterViewProps extends IViewBaseProps {\n /** The resource system to filter */\n resources?: IProcessedResources | null;\n /** Current state of the filter configuration */\n filterState: IFilterState;\n /** Actions for managing filter state */\n filterActions: IFilterActions;\n /** Result of applying the filter */\n filterResult?: IFilterResult | null;\n /** Callback when filter results change */\n onFilterResult?: (result: IFilterResult | null) => void;\n /** Optional configuration for the ResourcePicker behavior */\n pickerOptions?: IResourcePickerOptions;\n /** Optional configuration for context control behavior */\n contextOptions?: IResolutionContextOptions;\n}\n\n/**\n * Props for the CompiledView component.\n * Displays the compiled resource collection structure.\n *\n * @public\n */\nexport interface ICompiledViewProps extends IViewBaseProps {\n /** The resource system to display */\n resources?: IExtendedProcessedResources | null;\n /** Optional filter state for filtered views */\n filterState?: IFilterState;\n /** Result of filtering if applied */\n filterResult?: IFilterResult | null;\n /** Whether to use normalization in display */\n useNormalization?: boolean;\n /** Callback for exporting compiled data or bundles */\n onExport?: (\n data: ResourceJson.Compiled.ICompiledResourceCollection | Bundle.IBundle,\n type: 'json' | 'bundle'\n ) => void;\n /** Optional configuration for the ResourcePicker behavior */\n pickerOptions?: IResourcePickerOptions;\n}\n\n/**\n * Result of attempting to create a resource editor for a specific resource.\n * Used by ResourceEditorFactory to provide type-specific editors.\n *\n * @public\n */\nexport type ResourceEditorResult<T = unknown, TV extends JsonCompatibleType<T> = JsonCompatibleType<T>> =\n | {\n /** Indicates whether the factory was able to create an editor for the resource */\n success: true;\n /** The React component to render for editing this resource */\n editor: React.ComponentType<IResourceEditorProps<T, TV>>;\n }\n | {\n /** Indicates the factory could not create an editor for this resource */\n success: false;\n /** Optional message explaining why no editor could be created */\n message?: string;\n };\n\n/**\n * Props that will be passed to custom resource editors created by ResourceEditorFactory.\n * Custom editors should implement this interface to be compatible with ResolutionView.\n *\n * @public\n */\nexport interface IResourceEditorProps<T = unknown, TV extends JsonCompatibleType<T> = JsonCompatibleType<T>> {\n /** The original JSON value to edit */\n value: TV;\n /** The resource ID for tracking edits */\n resourceId: string;\n /** Whether this resource has been edited */\n isEdited?: boolean;\n /** The current edited value if any */\n editedValue?: TV;\n /** Callback when the user saves an edit */\n onSave?: (resourceId: string, editedValue: TV, originalValue: TV) => void;\n /** Callback when the user cancels an edit */\n onCancel?: (resourceId: string) => void;\n /** Whether editing is currently disabled */\n disabled?: boolean;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Factory interface for creating type-specific resource editors.\n * Allows ResolutionView to provide custom editing experiences for different resource types.\n *\n * @public\n */\nexport interface IResourceEditorFactory<\n T = unknown,\n TV extends JsonCompatibleType<T> = JsonCompatibleType<T>\n> {\n /**\n * Attempts to create a resource editor for the given resource.\n *\n * @param resourceId - The ID of the resource to edit\n * @param resourceType - The type/key of the resource\n * @param value - The current value of the resource\n * @returns ResourceEditorResult indicating success/failure and the editor component or error message\n */\n createEditor(resourceId: string, resourceType: string, value: TV): ResourceEditorResult<T, TV>;\n}\n\n/**\n * Props for the ResolutionView component.\n * Provides resource resolution testing and debugging.\n *\n * @public\n */\nexport interface IResolutionViewProps extends IViewBaseProps {\n /** The resource system for resolution testing */\n resources?: IProcessedResources | null;\n /** Optional filter state */\n filterState?: IFilterState;\n /** Filter results if applied */\n filterResult?: IFilterResult | null;\n /** Current resolution testing state */\n resolutionState?: IResolutionState;\n /** Actions for managing resolution state */\n resolutionActions?: IResolutionActions;\n /** Available qualifiers for context building */\n availableQualifiers?: string[];\n /** Optional factory for creating type-specific resource editors */\n resourceEditorFactory?: IResourceEditorFactory;\n /** Optional configuration for the ResourcePicker behavior */\n pickerOptions?: IResourcePickerOptions;\n /** Optional configuration for the resolution context controls */\n contextOptions?: IResolutionContextOptions;\n /** Lock to a single view state and suppress the view state selector */\n lockedViewMode?: 'composed' | 'best' | 'all' | 'raw';\n /** Custom titles for the main sections */\n sectionTitles?: {\n /** Title for the resources picker section (default: \"Resources\") */\n resources?: string;\n /** Title for the results section (default: \"Results\") */\n results?: string;\n };\n /** Allow creating new resources in the UI */\n allowResourceCreation?: boolean;\n /** Default resource type for new resources (hides type selector if provided) */\n defaultResourceType?: string;\n /** Factory for creating custom resource types */\n resourceTypeFactory?: ResourceTypes.IResourceType[];\n /** Callback when pending resources are applied */\n onPendingResourcesApplied?: (added: ResourceJson.Json.ILooseResourceDecl[], deleted: string[]) => void;\n /** Show pending resources in the resource list with visual distinction */\n showPendingResourcesInList?: boolean;\n}\n\n/**\n * Information about a resource being edited in the resolution view.\n * Tracks changes to resource values and states.\n *\n * @public\n */\nexport interface IEditedResourceInfo<T = unknown, TV extends JsonCompatibleType<T> = JsonCompatibleType<T>> {\n /** Unique identifier of the resource being edited */\n resourceId: string;\n originalValue: TV;\n editedValue: TV;\n timestamp: Date;\n}\n\n// Resolution types\n/**\n * Current state of resource resolution testing and debugging.\n * Tracks context values, resolution results, and editing state.\n *\n * @public\n */\nexport interface IResolutionState {\n /** Current context values applied for resolution */\n contextValues: Record<string, string | undefined>;\n /** Context values being edited but not yet applied */\n pendingContextValues: Record<string, string | undefined>;\n /** ID of the currently selected resource for resolution testing */\n selectedResourceId: string | null;\n /** The resolver instance being used for testing */\n currentResolver: Runtime.ResourceResolver | null;\n /** Result of the most recent resolution attempt */\n resolutionResult: IResolutionResult | null;\n /** Current view mode for displaying resolution results */\n viewMode: 'composed' | 'best' | 'all' | 'raw';\n /** Whether there are pending context changes not yet applied */\n hasPendingChanges: boolean;\n /** Map of resource IDs to their edited values */\n editedResources: Map<string, JsonValue>;\n /** Whether there are unsaved resource edits */\n hasUnsavedEdits: boolean;\n /** Whether edits are currently being applied to the system */\n isApplyingEdits: boolean;\n /** Resources waiting to be added to the system */\n pendingResources: Map<string, ResourceJson.Json.ILooseResourceDecl>;\n /** IDs of resources marked for deletion */\n pendingResourceDeletions: Set<string>;\n /** Draft of a new resource being created */\n newResourceDraft?: {\n resourceId: string;\n resourceType: string;\n template: ResourceJson.Json.ILooseResourceDecl;\n isValid: boolean;\n };\n /** Available resource types for creation */\n availableResourceTypes: ResourceTypes.IResourceType[];\n /** Whether there are pending resource additions or deletions */\n hasPendingResourceChanges: boolean;\n}\n\n/**\n * Parameters for creating a pending resource atomically.\n *\n * @example\n * ```typescript\n * const params: ICreatePendingResourceParams = {\n * id: 'platform.languages.az-AZ',\n * resourceTypeName: 'json',\n * json: { text: 'Welcome', locale: 'az-AZ' }\n * };\n * ```\n *\n * @public\n */\nexport interface ICreatePendingResourceParams<\n T = unknown,\n TV extends JsonCompatibleType<T> = JsonCompatibleType<T>\n> {\n /** Full resource ID (e.g., 'platform.languages.az-AZ') - must be unique */\n id: string;\n /** Name of the resource type to use for validation and template creation */\n resourceTypeName: string;\n /** JSON content for the resource candidate. If undefined, the resource type's base template will be used. */\n json?: TV;\n}\n\n/**\n * Parameters for starting a new resource with optional pre-seeding.\n *\n * @example\n * ```typescript\n * // Basic start with just type\n * const basicParams: IStartNewResourceParams = {\n * defaultTypeName: 'json'\n * };\n *\n * // Pre-seeded start with full data\n * const preSeededParams: IStartNewResourceParams = {\n * id: 'user.welcome',\n * resourceTypeName: 'json',\n * json: { text: 'Welcome!' }\n * };\n * ```\n *\n * @public\n */\nexport interface IStartNewResourceParams<\n T = unknown,\n TV extends JsonCompatibleType<T> = JsonCompatibleType<T>\n> {\n /** Resource type to use (optional - will use first available if not provided) */\n defaultTypeName?: string;\n /** Pre-seed with specific ID (optional) */\n id?: string;\n /** Pre-seed with specific resource type name (optional) */\n resourceTypeName?: string;\n /** Pre-seed with specific JSON content (optional) */\n json?: TV;\n}\n\n/**\n * Actions available for managing resource resolution testing and editing.\n * Provides methods for context management, resource selection, and value editing.\n *\n * @public\n */\nexport interface IResolutionActions {\n /** Update a context value for resolution testing */\n updateContextValue: (qualifierName: string, value: string | undefined) => Result<void>;\n /** Apply pending context changes to the resolver (with optional host-managed values) */\n applyContext: (hostManagedValues?: Record<string, string | undefined>) => Result<void>;\n /** Select a resource for detailed resolution testing */\n selectResource: (resourceId: string) => Result<void>;\n /** Change how resolution results are displayed */\n setViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;\n /** Clear the resolution cache to force fresh resolution */\n resetCache: () => Result<void>;\n /** Save an edit to a resource value */\n saveEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => Result<void>;\n /** Get the edited value for a resource, if any */\n getEditedValue: (resourceId: string) => JsonValue | undefined;\n /** Check if a resource has been edited */\n hasEdit: (resourceId: string) => boolean;\n /** Clear all pending edits */\n clearEdits: () => Result<{ clearedCount: number }>;\n /** Discard all pending edits */\n discardEdits: () => Result<{ discardedCount: number }>;\n\n // Enhanced resource creation actions with Result pattern return values\n /** Create a pending resource atomically with validation */\n createPendingResource: (params: ICreatePendingResourceParams) => Result<void>;\n /** Start creating a new resource (enhanced with optional pre-seeding) */\n startNewResource: (\n params?: IStartNewResourceParams\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n /** Update the resource ID for the new resource being created */\n updateNewResourceId: (\n id: string\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n /** Select a resource type for the new resource */\n selectResourceType: (\n type: string\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n /** Update the JSON content for the new resource being created */\n updateNewResourceJson: (\n json: JsonValue\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n /** Add the new resource to pending resources (not applied yet) */\n saveNewResourceAsPending: () => Result<{\n pendingResources: Map<string, ResourceJson.Json.ILooseResourceDecl>;\n diagnostics: string[];\n }>;\n /** Cancel the new resource creation */\n cancelNewResource: () => void;\n /** Remove a pending resource */\n removePendingResource: (resourceId: string) => Result<void>;\n /** Mark an existing resource for deletion */\n markResourceForDeletion: (resourceId: string) => void;\n /** Apply all pending resource additions and deletions */\n applyPendingResources: () => Promise<\n Result<{\n appliedCount: number;\n existingResourceEditCount: number;\n pendingResourceEditCount: number;\n newResourceCount: number;\n deletionCount: number;\n }>\n >;\n /** Discard all pending resource changes */\n discardPendingResources: () => void;\n}\n\n/**\n * Options for controlling individual qualifier context controls.\n *\n * Provides fine-grained control over the behavior, appearance, and editability\n * of individual qualifier inputs. This allows hosts to customize which qualifiers\n * are editable, provide external values, and control the presentation.\n *\n * @example\n * ```tsx\n * // Make a qualifier readonly with external value\n * const languageOptions: IQualifierControlOptions = {\n * visible: true,\n * editable: false,\n * hostValue: 'en-US',\n * showHostValue: true,\n * placeholder: 'Language managed externally'\n * };\n * ```\n *\n * @public\n */\nexport interface IQualifierControlOptions {\n /** Whether this qualifier should be visible at all */\n visible?: boolean;\n /** Whether this qualifier is editable by the user */\n editable?: boolean;\n /** External/host-managed value that overrides user input */\n hostValue?: string | undefined;\n /** Whether to show host-managed values in the display */\n showHostValue?: boolean;\n /** Custom placeholder text for this qualifier */\n placeholder?: string;\n /** Custom CSS classes for this qualifier control */\n className?: string;\n}\n\n/**\n * Configuration options for the resolution context controls in ResolutionView.\n *\n * Controls the visibility and behavior of the context configuration panel,\n * allowing hosts to customize which qualifiers are editable and provide\n * externally managed context values. Uses QualifierControlOptions for\n * per-qualifier customization.\n *\n * @example\n * ```tsx\n * // Hide context UI entirely - host controls context externally\n * <ResolutionView\n * contextOptions={{ showContextControls: false }}\n * // ... other props\n * />\n *\n * // Fine-grained qualifier control\n * <ResolutionView\n * contextOptions={{\n * showContextControls: true,\n * qualifierOptions: {\n * language: { editable: true, placeholder: 'Select language...' },\n * platform: { editable: false, hostValue: 'web', showHostValue: true },\n * env: { visible: false } // Hidden from UI entirely\n * },\n * hostManagedValues: { env: 'production' } // Invisible but active\n * }}\n * // ... other props\n * />\n * ```\n *\n * @public\n */\nexport interface IResolutionContextOptions {\n /** Visibility options */\n /** Whether to show the context configuration panel at all */\n showContextControls?: boolean;\n /** Whether to show the current context display */\n showCurrentContext?: boolean;\n /** Whether to show the Apply/Reset buttons */\n showContextActions?: boolean;\n\n /** Per-qualifier control options */\n qualifierOptions?: Record<string, IQualifierControlOptions>;\n\n /** Global defaults for qualifiers not specifically configured */\n defaultQualifierEditable?: boolean;\n defaultQualifierVisible?: boolean;\n\n /** Host-managed values that override all user input for invisible qualifiers */\n hostManagedValues?: Record<string, string | undefined>;\n\n /** Appearance options */\n /** Custom title for the context configuration panel */\n contextPanelTitle?: string;\n /** Global placeholder text pattern for qualifier inputs */\n globalPlaceholder?: string | ((qualifierName: string) => string);\n /** Additional CSS classes for the context panel */\n contextPanelClassName?: string;\n}\n\n/**\n * Result of attempting to resolve a specific resource with a given context.\n * Contains the resolved value, matching candidates, and diagnostic information.\n *\n * @public\n */\nexport interface IResolutionResult<T = unknown, TV extends JsonCompatibleType<T> = JsonCompatibleType<T>> {\n /** Whether the resolution was successful */\n success: boolean;\n /** ID of the resource that was resolved */\n resourceId: string;\n /** The resolved resource object, if successful */\n resource?: Runtime.IResource;\n /** The best matching candidate for this context */\n bestCandidate?: Runtime.IResourceCandidate;\n /** All candidates that were considered during resolution */\n allCandidates?: readonly Runtime.IResourceCandidate[];\n /** Detailed information about each candidate's matching process */\n candidateDetails?: ICandidateInfo[];\n /** The final composed/resolved value */\n composedValue?: TV;\n /** Error message if resolution failed */\n error?: string;\n}\n\n/**\n * Detailed information about how a resource candidate was evaluated during resolution.\n * Provides diagnostic data for understanding why candidates matched or didn't match.\n *\n * @public\n */\nexport interface ICandidateInfo {\n /** The candidate that was evaluated */\n candidate: Runtime.IResourceCandidate;\n /** Key identifying the condition set used for evaluation */\n conditionSetKey: string | null;\n /** Index of this candidate within the resource */\n candidateIndex: number;\n /** Whether this candidate matched the resolution context */\n matched: boolean;\n /** Type of match that occurred */\n matchType: 'match' | 'matchAsDefault' | 'noMatch';\n /** Whether this was a default match (fallback when no exact match) */\n isDefaultMatch: boolean;\n /** Detailed evaluation results for each condition */\n conditionEvaluations?: IConditionEvaluationResult[];\n}\n\n/**\n * Result of evaluating a single condition during resource resolution.\n * Shows how a specific qualifier value compared against a condition.\n *\n * @public\n */\nexport interface IConditionEvaluationResult {\n /** Name of the qualifier being evaluated */\n qualifierName: string;\n /** Value of the qualifier in the resolution context */\n qualifierValue: string | undefined;\n /** Value specified in the resource condition */\n conditionValue: string | undefined;\n /** Comparison operator used for evaluation */\n operator: string;\n /** Numeric score for this condition evaluation */\n score: number;\n /** Whether this condition matched */\n matched: boolean;\n /** Type of match that occurred */\n matchType: 'match' | 'matchAsDefault' | 'noMatch';\n /** Score when used as a default match */\n scoreAsDefault?: number;\n /** Index of this condition within the candidate */\n conditionIndex: number;\n}\n\n/**\n * Props for the ConfigurationView component.\n * Handles editing and managing system configuration including qualifiers, qualifier types, and resource types.\n *\n * @public\n */\nexport interface IConfigurationViewProps extends IViewBaseProps {\n /** Current system configuration to display and edit */\n configuration?: Config.Model.ISystemConfiguration | null;\n /** Callback when configuration changes (during editing) */\n onConfigurationChange?: (config: Config.Model.ISystemConfiguration) => void;\n /** Callback when configuration should be saved/applied */\n onSave?: (config: Config.Model.ISystemConfiguration) => void;\n /** Whether there are unsaved changes to the configuration */\n hasUnsavedChanges?: boolean;\n}\n\n// Resource detail types for SourceView\n/**\n * Detailed information about a resource for display in source views.\n * Contains the resource structure including all candidates and their conditions.\n *\n * @public\n */\nexport interface IResourceDetailData {\n /** Unique identifier of the resource */\n id: string;\n /** Type classification of the resource */\n resourceType: string;\n /** Total number of candidates defined for this resource */\n candidateCount: number;\n /** Array of all candidates with their conditions and values */\n candidates: Array<ResourceJson.Normalized.IChildResourceCandidateDecl>;\n}\n\n/**\n * Information about a single resource after filtering has been applied.\n *\n * FilteredResource provides detailed analytics about how filtering affected\n * an individual resource, including candidate count changes and potential\n * issues detected during the filtering process. This information is essential\n * for understanding filtering effectiveness and diagnosing filtering problems.\n *\n * @example\n * ```typescript\n * import { FilterTools } from '@fgv/ts-res-ui-components';\n *\n * // Analyze filter results for resources\n * const filterResult = await FilterTools.createFilteredResourceManagerSimple(\n * processedResources,\n * { language: 'en-US', platform: 'web' }\n * );\n *\n * if (filterResult.isSuccess() && filterResult.value.success) {\n * filterResult.value.filteredResources.forEach((resource: FilteredResource) => {\n * console.log(`Resource ${resource.id}:`);\n * console.log(` Original candidates: ${resource.originalCandidateCount}`);\n * console.log(` Filtered candidates: ${resource.filteredCandidateCount}`);\n *\n * if (resource.hasWarning) {\n * console.warn(` ⚠️ Warning: Potential filtering issue detected`);\n * }\n *\n * const reductionPercent = Math.round(\n * ((resource.originalCandidateCount - resource.filteredCandidateCount) /\n * resource.originalCandidateCount) * 100\n * );\n * console.log(` Reduction: ${reductionPercent}%`);\n * });\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Use FilteredResource data in UI components\n * function FilterResultsSummary({ filteredResources }: { filteredResources: IFilteredResource[] }) {\n * const totalOriginal = filteredResources.reduce((sum, r) => sum + r.originalCandidateCount, 0);\n * const totalFiltered = filteredResources.reduce((sum, r) => sum + r.filteredCandidateCount, 0);\n * const warningCount = filteredResources.filter(r => r.hasWarning).length;\n *\n * return (\n * <div className=\"filter-summary\">\n * <h3>Filter Results Summary</h3>\n * <div className=\"stats\">\n * <div>Resources: {filteredResources.length}</div>\n * <div>Total candidates: {totalOriginal} → {totalFiltered}</div>\n * <div>Reduction: {Math.round(((totalOriginal - totalFiltered) / totalOriginal) * 100)}%</div>\n * {warningCount > 0 && (\n * <div className=\"warnings\">⚠️ {warningCount} resource(s) with warnings</div>\n * )}\n * </div>\n *\n * <div className=\"resource-list\">\n * {filteredResources.map(resource => (\n * <div key={resource.id} className={resource.hasWarning ? 'has-warning' : ''}>\n * <span className=\"resource-id\">{resource.id}</span>\n * <span className=\"candidate-counts\">\n * {resource.originalCandidateCount} → {resource.filteredCandidateCount}\n * </span>\n * {resource.hasWarning && <span className=\"warning-icon\">⚠️</span>}\n * </div>\n * ))}\n * </div>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Filter resources by specific criteria\n * function analyzeFilteredResources(filteredResources: IFilteredResource[]) {\n * // Find resources that were completely filtered out\n * const completelyFiltered = filteredResources.filter(r =>\n * r.filteredCandidateCount === 0 && r.originalCandidateCount > 0\n * );\n *\n * // Find resources with significant candidate reduction\n * const significantReduction = filteredResources.filter(r => {\n * const reductionPercent = (r.originalCandidateCount - r.filteredCandidateCount) / r.originalCandidateCount;\n * return reductionPercent > 0.5; // More than 50% reduction\n * });\n *\n * // Find resources with warnings\n * const withWarnings = filteredResources.filter(r => r.hasWarning);\n *\n * return {\n * completelyFiltered: completelyFiltered.map(r => r.id),\n * significantReduction: significantReduction.map(r => ({\n * id: r.id,\n * reductionPercent: Math.round(\n * ((r.originalCandidateCount - r.filteredCandidateCount) / r.originalCandidateCount) * 100\n * )\n * })),\n * withWarnings: withWarnings.map(r => r.id),\n * totalResources: filteredResources.length\n * };\n * }\n * ```\n *\n * @public\n */\nexport interface IFilteredResource {\n /** The resource ID that was filtered */\n id: string;\n /** Number of candidates before filtering was applied */\n originalCandidateCount: number;\n /** Number of candidates remaining after filtering */\n filteredCandidateCount: number;\n /** Whether this resource has potential filtering issues or warnings */\n hasWarning: boolean;\n}\n\n/**\n * Complete result of a filtering operation including processed data and analysis.\n *\n * IFilterResult encapsulates the outcome of applying resource filtering, providing\n * both the filtered resource system and detailed analytics about the filtering\n * process. It includes success/failure status, processed resources, per-resource\n * analysis, and any warnings or errors encountered during filtering.\n *\n * @example\n * ```typescript\n * import { FilterTools } from '@fgv/ts-res-ui-components';\n *\n * // Apply filtering and handle results\n * async function applyResourceFilter(\n * processedResources: IProcessedResources,\n * context: Record<string, string>\n * ) {\n * const result = await FilterTools.createFilteredResourceManagerSimple(\n * processedResources,\n * context,\n * { partialContextMatch: true, enableDebugLogging: false }\n * );\n *\n * if (result.isSuccess()) {\n * const filterResult: IFilterResult = result.value;\n *\n * if (filterResult.success) {\n * console.log('Filter applied successfully!');\n * console.log(`Processed ${filterResult.filteredResources.length} resources`);\n *\n * // Use the filtered resource system\n * if (filterResult.processedResources) {\n * console.log('Filtered resource system ready for use');\n * return filterResult.processedResources;\n * }\n *\n * // Check for warnings\n * if (filterResult.warnings.length > 0) {\n * filterResult.warnings.forEach(warning => {\n * console.warn(`⚠️ Filter warning: ${warning}`);\n * });\n * }\n * } else {\n * console.error(`Filter failed: ${filterResult.error}`);\n * }\n * } else {\n * console.error(`Filter operation failed: ${result.message}`);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Use IFilterResult in React component for filter management\n * function FilterResultsPanel({ filterResult }: { filterResult: IFilterResult | null }) {\n * if (!filterResult) {\n * return <div className=\"no-filter\">No filter applied</div>;\n * }\n *\n * if (!filterResult.success) {\n * return (\n * <div className=\"filter-error\">\n * <h3>Filter Error</h3>\n * <p>{filterResult.error}</p>\n * </div>\n * );\n * }\n *\n * const stats = filterResult.filteredResources;\n * const totalOriginal = stats.reduce((sum, r) => sum + r.originalCandidateCount, 0);\n * const totalFiltered = stats.reduce((sum, r) => sum + r.filteredCandidateCount, 0);\n * const resourcesWithWarnings = stats.filter(r => r.hasWarning).length;\n *\n * return (\n * <div className=\"filter-results\">\n * <h3>Filter Results</h3>\n *\n * <div className=\"summary\">\n * <div className=\"stat\">\n * <label>Resources Processed:</label>\n * <span>{stats.length}</span>\n * </div>\n * <div className=\"stat\">\n * <label>Total Candidates:</label>\n * <span>{totalOriginal} → {totalFiltered}</span>\n * </div>\n * <div className=\"stat\">\n * <label>Reduction:</label>\n * <span>{Math.round(((totalOriginal - totalFiltered) / totalOriginal) * 100)}%</span>\n * </div>\n * </div>\n *\n * {filterResult.warnings.length > 0 && (\n * <div className=\"warnings\">\n * <h4>Warnings ({filterResult.warnings.length})</h4>\n * <ul>\n * {filterResult.warnings.map((warning, index) => (\n * <li key={index} className=\"warning\">{warning}</li>\n * ))}\n * </ul>\n * </div>\n * )}\n *\n * {resourcesWithWarnings > 0 && (\n * <div className=\"resource-warnings\">\n * <h4>Resources with Issues ({resourcesWithWarnings})</h4>\n * <ul>\n * {stats.filter(r => r.hasWarning).map(resource => (\n * <li key={resource.id} className=\"resource-warning\">\n * {resource.id} - {resource.filteredCandidateCount}/{resource.originalCandidateCount} candidates\n * </li>\n * ))}\n * </ul>\n * </div>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Advanced filter result analysis and validation\n * function validateFilterResults(filterResult: IFilterResult): {\n * isValid: boolean;\n * issues: string[];\n * recommendations: string[];\n * } {\n * const issues: string[] = [];\n * const recommendations: string[] = [];\n *\n * if (!filterResult.success) {\n * issues.push(`Filter operation failed: ${filterResult.error}`);\n * recommendations.push('Check filter configuration and resource data');\n * return { isValid: false, issues, recommendations };\n * }\n *\n * const resources = filterResult.filteredResources;\n *\n * // Check for completely filtered resources\n * const completelyFiltered = resources.filter(r =>\n * r.filteredCandidateCount === 0 && r.originalCandidateCount > 0\n * );\n *\n * if (completelyFiltered.length > 0) {\n * issues.push(`${completelyFiltered.length} resource(s) have no candidates after filtering`);\n * recommendations.push('Consider using partial context matching or reviewing filter criteria');\n * }\n *\n * // Check for excessive warnings\n * const warningCount = filterResult.warnings.length;\n * if (warningCount > resources.length * 0.1) { // More than 10% warning rate\n * issues.push(`High warning rate: ${warningCount} warnings for ${resources.length} resources`);\n * recommendations.push('Review resource configuration and filter parameters');\n * }\n *\n * // Check for minimal filtering effect\n * const totalOriginal = resources.reduce((sum, r) => sum + r.originalCandidateCount, 0);\n * const totalFiltered = resources.reduce((sum, r) => sum + r.filteredCandidateCount, 0);\n * const reductionPercent = ((totalOriginal - totalFiltered) / totalOriginal) * 100;\n *\n * if (reductionPercent < 5) { // Less than 5% reduction\n * issues.push(`Filter had minimal effect: only ${reductionPercent.toFixed(1)}% candidate reduction`);\n * recommendations.push('Consider more specific filter criteria or check if filtering is needed');\n * }\n *\n * return {\n * isValid: issues.length === 0,\n * issues,\n * recommendations\n * };\n * }\n * ```\n *\n * @public\n */\nexport interface IFilterResult {\n /** Whether the filtering operation completed successfully */\n success: boolean;\n /** The filtered processed resources, available if filtering succeeded */\n processedResources?: IProcessedResources;\n /** Analysis of individual resources after filtering, showing per-resource impact */\n filteredResources: IFilteredResource[];\n /** Warning messages about potential filtering issues or edge cases */\n warnings: string[];\n /** Error message if the filtering operation failed */\n error?: string;\n}\n\n// Orchestrator types\n/**\n * Complete state object for the resource orchestrator system.\n *\n * This interface represents the central state management for ts-res resources, encompassing\n * all aspects of resource processing, configuration, filtering, and resolution. It serves as\n * the primary state container for applications using the resource orchestrator.\n *\n * @example\n * ```typescript\n * // Basic usage with the orchestrator hook\n * import { ResourceTools } from '@fgv/ts-res-ui-components';\n *\n * function MyResourceApp() {\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * // Check if resources are loaded\n * if (!state.resources) {\n * return <div>No resources loaded</div>;\n * }\n *\n * // Display current state information\n * return (\n * <div>\n * <p>Resources: {state.resources.summary?.resourceCount || 0}</p>\n * <p>Configuration: {state.configuration ? 'Loaded' : 'Default'}</p>\n * <p>Processing: {state.isProcessing ? 'Yes' : 'No'}</p>\n * <p>Selected: {state.selectedResourceId || 'None'}</p>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Working with filter state\n * const { state } = ResourceTools.useResourceData();\n *\n * // Check if filters are applied\n * const hasActiveFilters = Object.keys(state.filterState.appliedValues).length > 0;\n * const filteredResourceCount = state.filterResult?.resources?.summary?.resourceCount || 0;\n *\n * console.log(`Filters active: ${hasActiveFilters}`);\n * console.log(`Filtered resources: ${filteredResourceCount}`);\n * ```\n *\n * @example\n * ```typescript\n * // Working with resolution state\n * const { state } = ResourceTools.useResourceData();\n *\n * // Check resolution context\n * const hasResolutionContext = Object.keys(state.resolutionState.context).length > 0;\n * const currentMode = state.resolutionState.viewMode;\n * const hasEdits = Object.keys(state.resolutionState.editedResources).length > 0;\n *\n * console.log(`Resolution mode: ${currentMode}`);\n * console.log(`Has context: ${hasResolutionContext}`);\n * console.log(`Has edits: ${hasEdits}`);\n * ```\n *\n * @public\n */\nexport interface IOrchestratorState {\n resources: IExtendedProcessedResources | null;\n configuration: Config.Model.ISystemConfiguration | null;\n filterState: IFilterState;\n filterResult: IFilterResult | null;\n resolutionState: IResolutionState;\n selectedResourceId: string | null;\n isProcessing: boolean;\n error: string | null;\n messages: IMessage[];\n resourceEditorFactory?: IResourceEditorFactory;\n}\n\n/**\n * Complete actions interface for the resource orchestrator system.\n *\n * This interface provides all the methods needed to manage and manipulate the orchestrator state,\n * including resource import/export, configuration management, filtering, resolution, and UI state.\n * All methods are designed to work seamlessly with the Result pattern for consistent error handling.\n *\n * @example\n * ```typescript\n * // Basic resource import workflow\n * import { ResourceTools, FileTools } from '@fgv/ts-res-ui-components';\n *\n * function ResourceImporter() {\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * const handleDirectoryImport = async (files: File[]) => {\n * const directory = await FileTools.convertFilesToDirectory(files);\n * await actions.importDirectory(directory);\n *\n * if (state.error) {\n * console.error('Import failed:', state.error);\n * } else {\n * console.log('Import successful:', state.resources?.summary);\n * }\n * };\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Configuration and filtering workflow\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * // Apply a new configuration\n * actions.applyConfiguration(customConfig);\n *\n * // Set up filters\n * actions.updateFilterState({\n * values: { language: 'en-US', platform: 'web' }\n * });\n *\n * // Apply filters and get results\n * const filterResult = await actions.applyFilter();\n * if (filterResult) {\n * console.log('Filtered resources:', filterResult.resources.summary.resourceCount);\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Resolution context and resource editing\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * // Set resolution context\n * actions.updateResolutionContext('language', 'en-US');\n * actions.updateResolutionContext('platform', 'mobile');\n * actions.applyResolutionContext();\n *\n * // Select a resource for resolution\n * actions.selectResourceForResolution('user.welcome');\n *\n * // Edit a resolved resource value\n * const newValue = { text: 'Updated welcome message' };\n * actions.saveResourceEdit('user.welcome', newValue);\n *\n * // Apply all pending changes (edits + new resources)\n * await actions.applyPendingResources();\n * ```\n *\n * @example\n * ```typescript\n * // Resource resolution and error handling\n * const { actions } = ResourceTools.useResourceData();\n *\n * const resolveUserMessage = async (messageId: string, userContext: Record<string, string>) => {\n * const result = await actions.resolveResource(messageId, userContext);\n *\n * if (result.isSuccess()) {\n * console.log('Resolved message:', result.value);\n * return result.value;\n * } else {\n * console.error('Resolution failed:', result.message);\n * actions.addMessage('error', `Failed to resolve ${messageId}: ${result.message}`);\n * return null;\n * }\n * };\n * ```\n *\n * @example\n * ```typescript\n * // Bundle import and advanced workflows\n * const { actions } = ResourceTools.useResourceData();\n *\n * // Import from a pre-built bundle\n * const bundleData = await loadBundleFromUrl('/api/resources/bundle');\n * await actions.importBundle(bundleData);\n *\n * // Import directory with specific configuration\n * const directory = await loadResourceDirectory();\n * const customConfig = await loadConfiguration();\n * await actions.importDirectoryWithConfig(directory, customConfig);\n * ```\n *\n * @public\n */\nexport interface IOrchestratorActions {\n // Resource management\n importFileTree: (fileTree: FileTree.FileTree) => Promise<void>;\n importFileTreeWithConfig: (\n fileTree: FileTree.FileTree,\n config: Config.Model.ISystemConfiguration\n ) => Promise<void>;\n importBundle: (bundle: Bundle.IBundle) => Promise<void>;\n clearResources: () => void;\n\n // Configuration management\n updateConfiguration: (config: Config.Model.ISystemConfiguration) => void;\n applyConfiguration: (config: Config.Model.ISystemConfiguration) => void;\n\n // Filter management\n updateFilterState: (state: Partial<IFilterState>) => void;\n applyFilter: () => Promise<IFilterResult | null>;\n resetFilter: () => void;\n\n // Resolution management\n updateResolutionContext: (qualifierName: string, value: string | undefined) => Result<void>;\n applyResolutionContext: (hostManagedValues?: Record<string, string | undefined>) => Result<void>;\n selectResourceForResolution: (resourceId: string) => Result<void>;\n setResolutionViewMode: (mode: 'composed' | 'best' | 'all' | 'raw') => void;\n resetResolutionCache: () => Result<void>;\n\n // Resolution editing\n saveResourceEdit: (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue) => Result<void>;\n getEditedValue: (resourceId: string) => JsonValue | undefined;\n hasResourceEdit: (resourceId: string) => boolean;\n clearResourceEdits: () => Result<{ clearedCount: number }>;\n // Removed: unified apply via applyPendingResources\n discardResourceEdits: () => Result<{ discardedCount: number }>;\n\n // Resource creation actions (enhanced with atomic API and Result pattern return values)\n createPendingResource: (params: ICreatePendingResourceParams) => Result<void>;\n startNewResource: (\n params?: IStartNewResourceParams\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n updateNewResourceId: (\n id: string\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n selectResourceType: (\n type: string\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n updateNewResourceJson: (\n json: JsonValue\n ) => Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }>;\n saveNewResourceAsPending: () => Result<{\n pendingResources: Map<string, ResourceJson.Json.ILooseResourceDecl>;\n diagnostics: string[];\n }>;\n cancelNewResource: () => void;\n removePendingResource: (resourceId: string) => Result<void>;\n markResourceForDeletion: (resourceId: string) => void;\n applyPendingResources: () => Promise<\n Result<{\n appliedCount: number;\n existingResourceEditCount: number;\n pendingResourceEditCount: number;\n newResourceCount: number;\n deletionCount: number;\n }>\n >;\n discardPendingResources: () => void;\n\n // Combined pending changes actions removed in favor of unified applyPendingResources\n\n // Export functionality\n exportBundle: () => void;\n exportSource: () => void;\n exportCompiled: () => void;\n\n // UI state management\n selectResource: (resourceId: string | null) => void;\n addMessage: (type: IMessage['type'], message: string) => void;\n clearMessages: () => void;\n\n // Observability context for diagnostic and user logging\n o11y: IObservabilityContext;\n\n // Resource resolution\n resolveResource: (resourceId: string, context?: Record<string, string>) => Result<JsonValue>;\n}\n\n// GridView types\n/**\n * Dropdown option for cell editing.\n *\n * @public\n */\nexport interface IGridDropdownOption {\n /** The value to store when this option is selected */\n value: string;\n /** The label to display for this option */\n label: string;\n /** Whether this option is disabled */\n disabled?: boolean;\n}\n\n/**\n * Validation configuration for grid cells.\n *\n * @public\n */\nexport interface IGridCellValidation {\n /** Whether the field is required */\n required?: boolean;\n /** Regex pattern for validation */\n pattern?: RegExp;\n /** Minimum length for string values */\n minLength?: number;\n /** Maximum length for string values */\n maxLength?: number;\n /** Custom validation function that returns error message or null */\n custom?: (value: JsonValue) => string | null;\n}\n\n/**\n * Configuration for a single column in a resource grid.\n * Defines how to extract, display, and edit values from resolved resources.\n *\n * @public\n */\nexport interface IGridColumnDefinition {\n /** Unique identifier for this column */\n id: string;\n /** Display title for the column header */\n title: string;\n /** Path to the property in the resolved resource value (JSONPath-like) */\n dataPath: string | string[];\n /** Optional fixed width for the column */\n width?: number;\n /** Whether this column can be sorted */\n sortable?: boolean;\n /** Whether values in this column can be edited */\n editable?: boolean;\n /** Type of cell editor to use */\n cellType?: 'string' | 'boolean' | 'tristate' | 'dropdown' | 'custom';\n /** Custom component for rendering cell content */\n cellRenderer?: React.ComponentType<IGridCellProps>;\n /** Custom component for editing cell content */\n cellEditor?: React.ComponentType<IGridCellEditorProps>;\n /** Validation configuration for this column */\n validation?: IGridCellValidation;\n /** Options for dropdown/combobox cells */\n dropdownOptions?: IGridDropdownOption[] | (() => Promise<IGridDropdownOption[]>);\n /** Whether to allow custom values in dropdown (combobox behavior) */\n allowCustomValue?: boolean;\n /** Presentation mode for tristate cells */\n triStatePresentation?: 'checkbox' | 'dropdown';\n /** Custom labels for tristate values */\n triStateLabels?: {\n trueLabel: string;\n falseLabel: string;\n undefinedLabel: string;\n };\n}\n\n/**\n * Props passed to custom grid cell renderers.\n *\n * @public\n */\nexport interface IGridCellProps {\n /** The extracted value for this cell */\n value: JsonValue;\n /** The resource ID for this row */\n resourceId: string;\n /** The column definition for this cell */\n column: IGridColumnDefinition;\n /** The complete resolved resource value */\n resolvedValue: JsonValue;\n /** Whether this cell has been edited */\n isEdited: boolean;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Props passed to custom grid cell editors.\n *\n * @public\n */\nexport interface IGridCellEditorProps extends IGridCellProps {\n /** The current edited value if any */\n editedValue?: JsonValue;\n /** Callback when the user saves an edit */\n onSave: (resourceId: string, newValue: JsonValue, originalValue: JsonValue) => void;\n /** Callback when the user cancels an edit */\n onCancel: () => void;\n /** Whether editing is currently disabled */\n disabled?: boolean;\n}\n\n/**\n * Column mapping configuration for a specific resource type.\n * Defines how resources of a given type should be displayed in the grid.\n *\n * @public\n */\nexport interface IResourceTypeColumnMapping {\n /** The resource type this mapping applies to */\n resourceType: string;\n /** Column definitions for this resource type */\n columns: IGridColumnDefinition[];\n /** Optional default column for unmapped properties */\n defaultColumn?: IGridColumnDefinition;\n}\n\n/**\n * Custom resource selector for advanced filtering logic.\n * Allows hosts to define complex resource selection criteria.\n *\n * @public\n */\nexport interface ICustomResourceSelector {\n /** Unique identifier for this selector */\n id: string;\n /** Function that returns resource IDs to include in the grid */\n select: (resources: IProcessedResources) => string[];\n /** Optional display name for debugging/logging */\n displayName?: string;\n}\n\n/**\n * Resource selection configuration for grid views.\n * Supports simple built-in selectors and custom selection logic.\n *\n * @public\n */\nexport type GridResourceSelector =\n | { type: 'ids'; resourceIds: string[] }\n | { type: 'prefix'; prefix: string }\n | { type: 'suffix'; suffix: string }\n | { type: 'resourceTypes'; types: string[] }\n | { type: 'pattern'; pattern: string }\n | { type: 'all' }\n | { type: 'custom'; selector: ICustomResourceSelector };\n\n/**\n * Presentation options for grid display.\n *\n * @public\n */\nexport interface IGridPresentationOptions {\n /** Enable sorting of grid rows */\n enableSorting?: boolean;\n /** Enable filtering of grid rows */\n enableFiltering?: boolean;\n /** Number of rows per page (0 for no pagination) */\n pageSize?: number;\n /** Whether to show row numbers */\n showRowNumbers?: boolean;\n /** Whether to show a summary row */\n showSummaryRow?: boolean;\n /** Additional CSS classes for the grid container */\n className?: string;\n}\n\n/**\n * Configuration for a single grid instance.\n * Defines resource selection, column mapping, and presentation options.\n *\n * @public\n */\nexport interface IGridViewInitParams {\n /** Unique identifier for this grid */\n id: string;\n /** Display title for this grid */\n title: string;\n /** Optional description for this grid */\n description?: string;\n /** How to select resources for this grid */\n resourceSelection: GridResourceSelector;\n /** Column mappings for resource types in this grid */\n columnMapping: IResourceTypeColumnMapping[];\n /** Optional presentation overrides */\n presentationOptions?: IGridPresentationOptions;\n}\n\n/**\n * Props for the GridView component.\n * Displays a single grid instance with resource editing capabilities.\n *\n * @public\n */\nexport interface IGridViewProps extends IViewBaseProps {\n /** Grid configuration defining what and how to display */\n gridConfig: IGridViewInitParams;\n /** The resource system for resolution */\n resources?: IProcessedResources | null;\n /** Current resolution state (shared with other views) */\n resolutionState?: IResolutionState;\n /** Actions for managing resolution state (shared with other views) */\n resolutionActions?: IResolutionActions;\n /** Available qualifiers for context building */\n availableQualifiers?: string[];\n /** Optional configuration for context controls */\n contextOptions?: IResolutionContextOptions;\n /** Optional filter state integration */\n filterState?: IFilterState;\n /** Filter results if applied */\n filterResult?: IFilterResult | null;\n /** Whether to show context controls (default: true) */\n showContextControls?: boolean;\n /** Whether to show change controls (default: true) */\n showChangeControls?: boolean;\n}\n\n/**\n * Props for the MultiGridView component.\n * Container for multiple grid instances with shared context and batch operations.\n *\n * @public\n */\nexport interface IMultiGridViewProps extends IViewBaseProps {\n /** Multiple grid configurations to display */\n gridConfigurations: IGridViewInitParams[];\n /** The resource system for all grids */\n resources?: IProcessedResources | null;\n /** Shared resolution state across all grids */\n resolutionState?: IResolutionState;\n /** Shared resolution actions across all grids */\n resolutionActions?: IResolutionActions;\n /** Available qualifiers for context building */\n availableQualifiers?: string[];\n /** Shared context options for all grids */\n contextOptions?: IResolutionContextOptions;\n /** Optional filter state integration */\n filterState?: IFilterState;\n /** Filter results if applied */\n filterResult?: IFilterResult | null;\n /** How to present the grid selector */\n tabsPresentation?: 'tabs' | 'cards' | 'accordion' | 'dropdown';\n /** ID of the initially active grid */\n defaultActiveGrid?: string;\n /** Whether users can reorder grid tabs */\n allowGridReordering?: boolean;\n}\n\n// Export utility types\nexport type { Result } from '@fgv/ts-utils';\nexport type { JsonValue } from '@fgv/ts-json-base';\n\n// Resource selector utility functions\nexport {\n getPendingAdditionsByType,\n isPendingAddition,\n deriveLeafId,\n deriveFullId,\n getPendingResourceTypes,\n getPendingResourceStats,\n validatePendingResourceKeys\n} from '../utils/resourceSelectors';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cellValidation.d.ts","sourceRoot":"","sources":["../../src/utils/cellValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,iCAAiC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,EAChB,UAAU,CAAC,EAAE,mBAAmB,GAC/B,MAAM,CAAC,qBAAqB,CAAC,CAoF/B;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAerD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE;IAChC,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,GAAG,IAAI,CAAC;IAC/C,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,GAAG,IAAI,CAAC;IAC/E,KAAK,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS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CAAC;YACtE,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,cAAc,CAAC,OAAO,EAAE,EAAE,CAAC;gBACzD,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAkB;QACrC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,UAAkB,EAAE,QAAgB;QACnD,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;CACF","sourcesContent":["import { Result, succeed, fail } from '@fgv/ts-utils';\nimport { JsonValue } from '@fgv/ts-json-base';\nimport { IGridCellValidation } from '../types';\n\n/**\n * Validation result for a grid cell value.\n */\nexport interface ICellValidationResult {\n /** Whether the value is valid */\n isValid: boolean;\n /** Error message if validation failed */\n error?: string;\n /** Cleaned/normalized value (e.g., trimmed strings) */\n normalizedValue?: JsonValue;\n}\n\n/**\n * Validates a cell value according to the column's validation rules.\n *\n * @param value - The value to validate\n * @param validation - Validation configuration\n * @returns Result containing validation outcome\n * @public\n */\nexport function validateCellValue(\n value: JsonValue,\n validation?: IGridCellValidation\n): Result<ICellValidationResult> {\n if (!validation) {\n return succeed({ isValid: true, normalizedValue: value });\n }\n\n try {\n // Handle null/undefined values\n const isEmpty = value === null || value === undefined || value === '';\n\n // Required field validation\n if (validation.required && isEmpty) {\n return succeed({\n isValid: false,\n error: 'This field is required',\n normalizedValue: value\n });\n }\n\n // If empty and not required, it's valid\n if (isEmpty && !validation.required) {\n return succeed({ isValid: true, normalizedValue: value });\n }\n\n // String-specific validations\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n // Length validations\n if (validation.minLength !== undefined && trimmedValue.length < validation.minLength) {\n return succeed({\n isValid: false,\n error: `Minimum length is ${validation.minLength} characters`,\n normalizedValue: trimmedValue\n });\n }\n\n if (validation.maxLength !== undefined && trimmedValue.length > validation.maxLength) {\n return succeed({\n isValid: false,\n error: `Maximum length is ${validation.maxLength} characters`,\n normalizedValue: trimmedValue\n });\n }\n\n // Pattern validation\n if (validation.pattern && !validation.pattern.test(trimmedValue)) {\n return succeed({\n isValid: false,\n error: 'Value does not match the required format',\n normalizedValue: trimmedValue\n });\n }\n\n // Custom validation\n if (validation.custom) {\n const customError = validation.custom(trimmedValue);\n if (customError) {\n return succeed({\n isValid: false,\n error: customError,\n normalizedValue: trimmedValue\n });\n }\n }\n\n return succeed({ isValid: true, normalizedValue: trimmedValue });\n }\n\n // Non-string values: only custom validation applies\n if (validation.custom) {\n const customError = validation.custom(value);\n if (customError) {\n return succeed({\n isValid: false,\n error: customError,\n normalizedValue: value\n });\n }\n }\n\n return succeed({ isValid: true, normalizedValue: value });\n } catch (error) {\n return fail(`Validation error: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n\n/**\n * Common validation patterns for reuse.\n * @public\n */\nexport const ValidationPatterns: Record<string, RegExp> = {\n /** Email address validation */\n email: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,\n /** URL validation (basic) */\n url: /^https?:\\/\\/.+/,\n /** Phone number (flexible format) */\n phone: /^[\\+]?[1-9][\\d]{0,15}$/,\n /** Alphanumeric only */\n alphanumeric: /^[a-zA-Z0-9]+$/,\n /** No whitespace */\n noWhitespace: /^\\S+$/,\n /** Positive integer */\n positiveInteger: /^[1-9]\\d*$/,\n /** Non-negative integer (including 0) */\n nonNegativeInteger: /^\\d+$/\n};\n\n/**\n * Common validation functions for reuse.\n * @public\n */\nexport const ValidationFunctions: {\n validJson: (value: JsonValue) => string | null;\n numberRange: (min: number, max: number) => (value: JsonValue) => string | null;\n oneOf: (allowedValues: JsonValue[]) => (value: JsonValue) => string | null;\n excludeCharacters: (forbiddenChars: string) => (value: JsonValue) => string | null;\n} = {\n /** Validates that a string represents a valid JSON */\n validJson: (value: JsonValue): string | null => {\n if (typeof value !== 'string') return null;\n try {\n JSON.parse(value);\n return null;\n } catch {\n return 'Must be valid JSON';\n }\n },\n\n /** Validates that a number is within a range */\n numberRange:\n (min: number, max: number) =>\n (value: JsonValue): string | null => {\n const num = typeof value === 'string' ? parseFloat(value) : value;\n if (typeof num !== 'number' || isNaN(num)) {\n return 'Must be a valid number';\n }\n if (num < min || num > max) {\n return `Must be between ${min} and ${max}`;\n }\n return null;\n },\n\n /** Validates that a value is one of the allowed options */\n oneOf:\n (allowedValues: JsonValue[]) =>\n (value: JsonValue): string | null => {\n if (!allowedValues.includes(value)) {\n return `Must be one of: ${allowedValues.join(', ')}`;\n }\n return null;\n },\n\n /** Validates that a string doesn't contain certain characters */\n excludeCharacters:\n (forbiddenChars: string) =>\n (value: JsonValue): string | null => {\n if (typeof value !== 'string') return null;\n\n for (const char of forbiddenChars) {\n if (value.includes(char)) {\n return `Cannot contain the character: ${char}`;\n }\n }\n return null;\n }\n};\n\n/**\n * Grid validation state management utility.\n * @public\n */\nexport class GridValidationState {\n private _cellErrors: Map<string, Map<string, string>> = new Map<string, Map<string, string>>();\n\n /**\n * Set validation error for a specific cell.\n *\n * @param resourceId - Resource ID for the row\n * @param columnId - Column ID for the cell\n * @param error - Error message, or null to clear error\n */\n public setCellError(resourceId: string, columnId: string, error: string | null): void {\n if (!this._cellErrors.has(resourceId)) {\n this._cellErrors.set(resourceId, new Map());\n }\n\n const resourceErrors = this._cellErrors.get(resourceId)!;\n\n if (error) {\n resourceErrors.set(columnId, error);\n } else {\n resourceErrors.delete(columnId);\n\n // Clean up empty resource error maps\n if (resourceErrors.size === 0) {\n this._cellErrors.delete(resourceId);\n }\n }\n }\n\n /**\n * Get validation error for a specific cell.\n */\n public getCellError(resourceId: string, columnId: string): string | null {\n return this._cellErrors.get(resourceId)?.get(columnId) || null;\n }\n\n /**\n * Check if a specific cell has validation errors.\n */\n public hasCellError(resourceId: string, columnId: string): boolean {\n return !!this.getCellError(resourceId, columnId);\n }\n\n /**\n * Get all validation errors for a resource.\n */\n public getResourceErrors(resourceId: string): Map<string, string> {\n return this._cellErrors.get(resourceId) || new Map();\n }\n\n /**\n * Check if any cells have validation errors.\n */\n public get hasErrors(): boolean {\n return this._cellErrors.size > 0;\n }\n\n /**\n * Get total count of validation errors.\n */\n public get errorCount(): number {\n let count = 0;\n for (const resourceErrors of this._cellErrors.values()) {\n count += resourceErrors.size;\n }\n return count;\n }\n\n /**\n * Get all error messages as a flat array.\n */\n public getAllErrors(): Array<{ resourceId: string; columnId: string; error: string }> {\n const errors: Array<{ resourceId: string; columnId: string; error: string }> = [];\n\n for (const [resourceId, resourceErrors] of this._cellErrors.entries()) {\n for (const [columnId, error] of resourceErrors.entries()) {\n errors.push({ resourceId, columnId, error });\n }\n }\n\n return errors;\n }\n\n /**\n * Clear all validation errors.\n */\n public clearAll(): void {\n this._cellErrors.clear();\n }\n\n /**\n * Clear validation errors for a specific resource.\n */\n public clearResource(resourceId: string): void {\n this._cellErrors.delete(resourceId);\n }\n\n /**\n * Clear validation error for a specific cell.\n */\n public clearCell(resourceId: string, columnId: string): void {\n this.setCellError(resourceId, columnId, null);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurationUtils.d.ts","sourceRoot":"","sources":["../../src/utils/configurationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;;GAGG;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,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;IACvE,OAAO,GAAG,QAAQ,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["import { Result, succeed, fail } from '@fgv/ts-utils';\nimport { Config } from '@fgv/ts-res';\n\n/**\n * Configuration change tracking\n * @internal\n */\nexport interface IConfigurationChanges {\n hasChanges: boolean;\n changedSections: string[];\n timestamp: Date;\n}\n\n/**\n * Configuration validation result\n * @internal\n */\nexport interface IConfigurationValidationResult {\n isValid: boolean;\n errors: string[];\n warnings: string[];\n}\n\n/**\n * Configuration export options\n * @internal\n */\nexport interface IConfigurationExportOptions {\n format: 'json' | 'yaml';\n pretty: boolean;\n includeComments?: boolean;\n filename?: string;\n}\n\n/**\n * Configuration template using predefined configurations from ts-res\n * @internal\n */\nexport interface IConfigurationTemplate {\n id: Config.PredefinedSystemConfiguration;\n name: string;\n description: string;\n configuration: Config.Model.ISystemConfiguration;\n category: 'basic' | 'intermediate' | 'advanced';\n}\n\n/**\n * Default system configuration\n * @public\n */\nexport function getDefaultConfiguration(): Config.Model.ISystemConfiguration {\n return Config.getPredefinedDeclaration('default').orThrow();\n}\n\n/**\n * Validate a system configuration\n */\n/**\n * Validates a ts-res system configuration for completeness and correctness.\n *\n * Performs comprehensive validation of configuration structure, required fields,\n * type relationships, and logical consistency. Returns detailed validation results\n * with specific error and warning messages for debugging and user feedback.\n *\n * @example\n * ```typescript\n * import { ConfigurationTools } from '@fgv/ts-res-ui-components';\n *\n * const config = {\n * qualifierTypes: [{ name: 'language', systemType: 'language' }],\n * qualifiers: [{ name: 'en', typeName: 'language', defaultPriority: 100 }],\n * resourceTypes: [{ name: 'string', defaultValue: '' }]\n * };\n *\n * const validation = ConfigurationTools.validateConfiguration(config);\n * if (!validation.isValid) {\n * console.error('Configuration errors:', validation.errors);\n * console.warn('Configuration warnings:', validation.warnings);\n * }\n * ```\n *\n * @param config - The system configuration to validate\n * @returns Validation result with errors, warnings, and validity status\n * @public\n */\nexport function validateConfiguration(\n config: Config.Model.ISystemConfiguration\n): IConfigurationValidationResult {\n const validate = Config.Convert.validateSystemConfiguration(config);\n if (validate.isSuccess()) {\n return {\n isValid: true,\n errors: [],\n warnings: []\n };\n } else {\n return {\n isValid: false,\n errors: [validate.message],\n warnings: []\n };\n }\n}\n\n/**\n * Create a deep copy of a configuration\n */\n/**\n * Creates a deep copy of a system configuration object.\n *\n * Performs a deep clone of the configuration to ensure complete isolation\n * from the original. Useful for creating editable copies, implementing undo/redo,\n * or preserving original state during modifications.\n *\n * @example\n * ```typescript\n * import { ConfigurationTools } from '@fgv/ts-res-ui-components';\n *\n * const originalConfig = getSystemConfiguration();\n * const editableConfig = ConfigurationTools.cloneConfiguration(originalConfig);\n *\n * // Modify the clone without affecting the original\n * editableConfig.qualifiers.push(newQualifier);\n * console.log('Original unchanged:', originalConfig.qualifiers.length);\n * console.log('Clone modified:', editableConfig.qualifiers.length);\n * ```\n *\n * @param config - The configuration to clone\n * @returns A deep copy of the configuration\n * @public\n */\nexport function cloneConfiguration(\n config: Config.Model.ISystemConfiguration\n): Config.Model.ISystemConfiguration {\n return JSON.parse(JSON.stringify(config));\n}\n\n/**\n * Compare two configurations for equality\n */\n/** @internal */\nexport function compareConfigurations(\n config1: Config.Model.ISystemConfiguration,\n config2: Config.Model.ISystemConfiguration\n): boolean {\n return JSON.stringify(config1) === JSON.stringify(config2);\n}\n\n/**\n * Track changes between configurations\n */\n/** @internal */\nexport function trackIConfigurationChanges(\n original: Config.Model.ISystemConfiguration,\n current: Config.Model.ISystemConfiguration\n): IConfigurationChanges {\n const changedSections: string[] = [];\n\n // Check qualifierTypes\n if (JSON.stringify(original.qualifierTypes) !== JSON.stringify(current.qualifierTypes)) {\n changedSections.push('qualifierTypes');\n }\n\n // Check qualifiers\n if (JSON.stringify(original.qualifiers) !== JSON.stringify(current.qualifiers)) {\n changedSections.push('qualifiers');\n }\n\n // Check resourceTypes\n if (JSON.stringify(original.resourceTypes) !== JSON.stringify(current.resourceTypes)) {\n changedSections.push('resourceTypes');\n }\n\n return {\n hasChanges: changedSections.length > 0,\n changedSections,\n timestamp: new Date()\n };\n}\n\n/**\n * Export configuration to JSON string\n */\n/**\n * Exports a system configuration to a formatted string representation.\n *\n * Converts the configuration object to a serialized format (JSON or YAML) with\n * optional formatting and metadata. Supports pretty-printing for human readability\n * and can include comments and custom filenames for enhanced usability.\n *\n * @example\n * ```typescript\n * import { ConfigurationTools } from '@fgv/ts-res-ui-components';\n *\n * const config = getCurrentConfiguration();\n *\n * // Export as pretty-printed JSON\n * const jsonResult = ConfigurationTools.exportConfiguration(config, {\n * format: 'json',\n * pretty: true,\n * includeComments: true\n * });\n *\n * if (jsonResult.isSuccess()) {\n * downloadFile(jsonResult.value, 'my-config.json');\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Export as compact JSON for API transmission\n * const compactResult = ConfigurationTools.exportConfiguration(config, {\n * format: 'json',\n * pretty: false\n * });\n *\n * if (compactResult.isSuccess()) {\n * await sendToApi(compactResult.value);\n * }\n * ```\n *\n * @param config - The configuration to export\n * @param options - Export formatting options\n * @returns Result containing the formatted configuration string or error message\n * @public\n */\nexport function exportConfiguration(\n config: Config.Model.ISystemConfiguration,\n options: IConfigurationExportOptions = { format: 'json', pretty: true }\n): Result<string> {\n try {\n if (options.format === 'json') {\n return succeed(JSON.stringify(config, null, options.pretty ? 2 : 0));\n } else {\n return fail('YAML export not implemented yet');\n }\n } catch (error) {\n return fail(`Failed to export configuration: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n\n/**\n * Import configuration from JSON string\n */\n/**\n * Imports and validates a system configuration from a serialized string.\n *\n * Parses configuration data from JSON or YAML format and performs validation\n * to ensure the imported configuration is structurally sound and contains\n * required fields. Provides detailed error messages for parsing or validation failures.\n *\n * @example\n * ```typescript\n * import { ConfigurationTools } from '@fgv/ts-res-ui-components';\n *\n * // Import from JSON string\n * const jsonData = '{\"qualifierTypes\": [...], \"qualifiers\": [...]}';\n * const importResult = ConfigurationTools.importConfiguration(jsonData);\n *\n * if (importResult.isSuccess()) {\n * console.log('Configuration imported successfully');\n * applyConfiguration(importResult.value);\n * } else {\n * console.error('Import failed:', importResult.message);\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Import from file upload\n * const handleFileImport = async (file: File) => {\n * const text = await file.text();\n * const result = ConfigurationTools.importConfiguration(text);\n *\n * if (result.isFailure()) {\n * showError(`Failed to import ${file.name}: ${result.message}`);\n * return;\n * }\n *\n * // Validate before applying\n * const validation = ConfigurationTools.validateConfiguration(result.value);\n * if (!validation.isValid) {\n * showWarning('Configuration has validation issues', validation.warnings);\n * }\n *\n * setConfiguration(result.value);\n * };\n * ```\n *\n * @param data - The serialized configuration string (JSON or YAML)\n * @returns Result containing the parsed configuration or error message\n * @public\n */\nexport function importConfiguration(data: string): Result<Config.Model.ISystemConfiguration> {\n try {\n const parsed = JSON.parse(data);\n return Config.Convert.validateSystemConfiguration(parsed);\n } catch (error) {\n return fail(`Failed to parse configuration: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n\n/**\n * Get predefined configuration templates from ts-res\n */\n/** @internal */\nexport function getIConfigurationTemplates(): IConfigurationTemplate[] {\n return Config.allPredefinedSystemConfigurations.map((configId) => {\n const config = Config.getPredefinedDeclaration(configId).orThrow();\n\n // Determine category based on configuration complexity\n let category: 'basic' | 'intermediate' | 'advanced';\n if (configId === 'default') {\n category = 'basic';\n } else if (configId === 'extended-example') {\n category = 'advanced';\n } else {\n category = 'intermediate';\n }\n\n return {\n id: configId,\n name: config.name || `${configId.charAt(0).toUpperCase() + configId.slice(1).replace(/-/g, ' ')}`,\n description: config.description || `Predefined ${configId} system configuration`,\n category,\n configuration: config\n };\n });\n}\n\n/**\n * Generate a filename for configuration export\n */\n/** @internal */\nexport function generateConfigurationFilename(configName?: string, format: 'json' | 'yaml' = 'json'): string {\n const timestamp = new Date().toISOString().slice(0, 19).replace(/[:.]/g, '-');\n const baseName = configName ? `${configName}-config` : 'ts-res-config';\n return `${baseName}-${timestamp}.${format}`;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadHelper.d.ts","sourceRoot":"","sources":["../../src/utils/downloadHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgC,MAAM,eAAe,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qFAAqF;IACrF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;CACxD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,GAAE,gBAAqB,GAC7B,MAAM,CAAC,MAAM,CAAC,CA6BhB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAyCtG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI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5B,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBACrD,OAAO,GAAG,IAAI,IAAI,aAAa,KAAK,CAAC;YACvC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Result, succeed, fail, captureResult } from '@fgv/ts-utils';\n\n/**\n * Options for customizing file downloads\n * @public\n */\nexport interface IDownloadOptions {\n /** Base filename (without extension). If not provided, uses 'ts-res-export' */\n baseFilename?: string;\n /** File extension (without dot). Defaults to 'json' */\n extension?: string;\n /** Include timestamp in filename. Defaults to true */\n includeTimestamp?: boolean;\n /** Custom timestamp format. If not provided, uses ISO format with colons replaced */\n timestampFormat?: string;\n /** MIME type for the blob. Defaults to 'application/json' for json, 'text/plain' for others */\n mimeType?: string;\n /** Custom filename transformer function */\n filenameTransformer?: (baseFilename: string) => string;\n}\n\n/**\n * Creates a timestamp string suitable for filenames\n * @public\n */\nexport function createTimestamp(customFormat?: string): string {\n if (customFormat) {\n return customFormat;\n }\n return new Date().toISOString().replace(/[:]/g, '-').split('.')[0];\n}\n\n/**\n * Generates a filename based on options\n * @public\n */\nexport function generateFilename(\n baseFilename: string,\n type?: string,\n options: IDownloadOptions = {}\n): Result<string> {\n if (!baseFilename || !baseFilename.trim()) {\n return fail('Base filename cannot be empty');\n }\n\n const { extension = 'json', includeTimestamp = true, timestampFormat, filenameTransformer } = options;\n\n let filename = baseFilename.trim();\n\n // Add type if provided\n if (type) {\n filename = `${filename}-${type}`;\n }\n\n // Add timestamp if requested\n if (includeTimestamp) {\n const timestamp = createTimestamp(timestampFormat);\n filename = `${filename}-${timestamp}`;\n }\n\n // Apply custom transformer if provided\n if (filenameTransformer) {\n filename = filenameTransformer(filename);\n }\n\n // Add extension\n filename = `${filename}.${extension}`;\n\n return succeed(filename);\n}\n\n/**\n * Downloads data as a file using the browser's download mechanism\n * @public\n */\nexport function downloadFile(data: unknown, type: string, options: IDownloadOptions = {}): Result<void> {\n const { baseFilename = 'ts-res-export', extension = 'json', mimeType } = options;\n\n // Generate filename\n const filenameResult = generateFilename(baseFilename, type, options);\n if (filenameResult.isFailure()) {\n return fail(`Failed to generate filename: ${filenameResult.message}`);\n }\n\n return captureResult(() => {\n // Convert data to string\n let content: string;\n if (typeof data === 'string') {\n content = data;\n } else if (extension === 'json') {\n content = JSON.stringify(data, null, 2);\n } else {\n content = String(data);\n }\n\n // Determine MIME type\n const finalMimeType = mimeType ?? (extension === 'json' ? 'application/json' : 'text/plain');\n\n // Create blob and download\n const blob = new Blob([content], { type: finalMimeType });\n const url = URL.createObjectURL(blob);\n\n // Create temporary download link\n const link = document.createElement('a');\n link.href = url;\n link.download = filenameResult.value;\n link.style.display = 'none';\n\n // Trigger download\n document.body.appendChild(link);\n link.click();\n\n // Cleanup\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n }).withErrorFormat((error) => `Failed to download file: ${error}`);\n}\n\n/**\n * Downloads JSON data with ts-res specific defaults\n * @public\n */\nexport function downloadTsResJson(data: unknown, type: string): Result<void> {\n return downloadFile(data, type, {\n baseFilename: 'ts-res',\n extension: 'json',\n includeTimestamp: true,\n mimeType: 'application/json'\n });\n}\n\n/**\n * Downloads a bundle with enhanced naming\n * @public\n */\nexport function downloadBundle(data: unknown, resourceCount?: number, configName?: string): Result<void> {\n const options: IDownloadOptions = {\n baseFilename: 'ts-res-bundle',\n extension: 'json',\n includeTimestamp: true,\n mimeType: 'application/json',\n filenameTransformer: (base) => {\n let enhanced = base;\n\n // Add resource count if available\n if (resourceCount !== undefined && resourceCount > 0) {\n enhanced = `${enhanced}-${resourceCount}res`;\n }\n\n // Add config name if available\n if (configName) {\n const cleanConfigName = configName.replace(/[^a-zA-Z0-9-_]/g, '-');\n enhanced = `${enhanced}-${cleanConfigName}`;\n }\n\n return enhanced;\n }\n };\n\n return downloadFile(data, '', options);\n}\n\n/**\n * Downloads resource data with enhanced naming\n * @public\n */\nexport function downloadResources(\n data: unknown,\n resourceCount?: number,\n collectionName?: string\n): Result<void> {\n const options: IDownloadOptions = {\n baseFilename: 'ts-res-resources',\n extension: 'json',\n includeTimestamp: true,\n mimeType: 'application/json',\n filenameTransformer: (base) => {\n let enhanced = base;\n\n // Add resource count if available\n if (resourceCount !== undefined && resourceCount > 0) {\n enhanced = `${enhanced}-${resourceCount}items`;\n }\n\n // Add collection name if available\n if (collectionName) {\n const cleanName = collectionName.replace(/[^a-zA-Z0-9-_]/g, '-');\n enhanced = `${enhanced}-${cleanName}`;\n }\n\n return enhanced;\n }\n };\n\n return downloadFile(data, '', options);\n}\n\n/**\n * Downloads compiled resources with specific naming\n * @public\n */\nexport function downloadCompiledResources(data: unknown, resourceCount?: number): Result<void> {\n return downloadFile(data, 'compiled', {\n baseFilename: 'ts-res',\n extension: 'json',\n includeTimestamp: true,\n mimeType: 'application/json',\n filenameTransformer: (base) => {\n if (resourceCount !== undefined && resourceCount > 0) {\n return `${base}-${resourceCount}res`;\n }\n return base;\n }\n });\n}\n\n/**\n * Downloads source resources with specific naming\n * @public\n */\nexport function downloadSourceResources(data: unknown, resourceCount?: number): Result<void> {\n return downloadFile(data, 'source', {\n baseFilename: 'ts-res',\n extension: 'json',\n includeTimestamp: true,\n mimeType: 'application/json',\n filenameTransformer: (base) => {\n if (resourceCount !== undefined && resourceCount > 0) {\n return `${base}-${resourceCount}res`;\n }\n return base;\n }\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterResources.d.ts","sourceRoot":"","sources":["../../src/utils/filterResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAqB,aAAa,EAAE,MAAM,UAAU,CAAC;AAGjF;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sEAAsE;IACtE,kBAAkB,CAAC,E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ClD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,UAAU,IAAI,mBAAmB,EAAE,CAAC;QAC7C,6BAA6B;QAC7B,MAAM,sBAAsB,GAC1B,0BAA0B,CAAC,MAAM,CAAC,eAAe,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjF,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,SAAS,EAAE;YAC/D,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM;YAChD,CAAC,CAAC,CAAC,CAAC;QAEN,6BAA6B;QAC7B,MAAM,sBAAsB,GAC1B,0BAA0B,CAAC,MAAM,CAAC,eAAe,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjF,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,SAAS,EAAE;YAC/D,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM;YAChD,CAAC,CAAC,CAAC,CAAC;QAEN,MAAM,UAAU,GAAG,sBAAsB,KAAK,CAAC,IAAI,sBAAsB,GAAG,CAAC,CAAC;QAC9E,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,CAAC,IAAI,CAAC,YAAY,UAAU,6CAA6C,CAAC,CAAC;QACrF,CAAC;QAED,iBAAiB,CAAC,IAAI,CAAC;YACrB,EAAE,EAAE,UAAU;YACd,sBAAsB;YACtB,sBAAsB;YACtB,UAAU;SACX,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,iBAAiB;QACjB,kBAAkB,EAAE,0BAA0B;QAC9C,QAAQ;KACT,CAAC;AACJ,CAAC","sourcesContent":["import { Result, succeed, fail } from '@fgv/ts-utils';\nimport { Runtime, Import } from '@fgv/ts-res';\nimport { IProcessedResources, IFilteredResource, IFilterResult } from '../types';\nimport { FileTree } from '@fgv/ts-json-base';\n\n/**\n * Options for configuring filtering behavior and output.\n *\n * @public\n */\nexport interface IFilterOptions {\n /** Allow partial context matches when filtering resources */\n partialContextMatch?: boolean;\n /** Enable detailed console logging for debugging filter operations */\n enableDebugLogging?: boolean;\n /** Attempt to reduce qualifier complexity during filtering */\n reduceQualifiers?: boolean;\n}\n\n// Helper function for conditional debug logging\nconst debugLog = (enableDebug: boolean, ...args: unknown[]): void => {\n if (enableDebug) {\n console.log(...args);\n }\n};\n\n/**\n * Checks if a filter values object contains any meaningful (non-empty) filter values.\n *\n * Utility function to determine whether filtering should be applied based on\n * the presence of actual filter values. Ignores undefined and empty string values.\n *\n * @example\n * ```typescript\n * import { FilterTools } from '@fgv/ts-res-ui-components';\n *\n * const filterValues = { language: 'en-US', platform: '', region: undefined };\n *\n * if (FilterTools.hasFilterValues(filterValues)) {\n * console.log('Has active filters'); // Will print this\n * const result = await FilterTools.createFilteredResourceManagerSimple(resources, filterValues);\n * } else {\n * console.log('No filters applied');\n * }\n * ```\n *\n * @param values - Object containing filter key-value pairs\n * @returns True if any filter has a meaningful value, false otherwise\n * @public\n */\nexport function hasFilterValues(values: Record<string, string | undefined>): boolean {\n return Object.values(values).some((value) => value !== undefined && value !== '');\n}\n\n/**\n * Creates a human-readable summary string of active filter values.\n *\n * Generates a comma-separated string representation of all non-empty filter values,\n * useful for displaying current filter state to users or in debug output.\n *\n * @example\n * ```typescript\n * import { FilterTools } from '@fgv/ts-res-ui-components';\n *\n * const filterValues = {\n * language: 'en-US',\n * platform: 'web',\n * region: '',\n * theme: undefined\n * };\n *\n * const summary = FilterTools.getFilterSummary(filterValues);\n * console.log(summary); // \"language=en-US, platform=web\"\n *\n * // For empty filters\n * const emptyFilters = {};\n * console.log(FilterTools.getFilterSummary(emptyFilters)); // \"No filters\"\n * ```\n *\n * @param values - Object containing filter key-value pairs\n * @returns Human-readable string summarizing active filters\n * @public\n */\nexport function getFilterSummary(values: Record<string, string | undefined>): string {\n const activeFilters = Object.entries(values)\n .filter(([, value]) => value !== undefined && value !== '')\n .map(([key, value]) => `${key}=${value}`);\n return activeFilters.length > 0 ? activeFilters.join(', ') : 'No filters';\n}\n\n/**\n * Creates a filtered resource manager using the ResourceManagerBuilder.clone() method.\n * This is a simplified implementation that leverages the built-in filtering functionality.\n */\n/**\n * Creates a filtered resource manager by applying context filters to reduce resource candidates.\n *\n * This function takes an original resource system and applies partial context filtering\n * to create a new resource manager with reduced candidate sets. Useful for creating\n * preview modes, testing specific configurations, or optimizing resource resolution.\n *\n * @example\n * ```typescript\n * import { FilterTools } from '@fgv/ts-res-ui-components';\n *\n * // Basic filtering with partial context\n * const originalResources = getProcessedResources();\n * const filterContext = { language: 'en-US', platform: 'web' };\n *\n * const filteredResult = await FilterTools.createFilteredResourceManagerSimple(\n * originalResources.system,\n * filterContext\n * );\n *\n * if (filteredResult.isSuccess()) {\n * console.log('Filtered resources created successfully');\n * const analysis = FilterTools.analyzeFilteredResources(\n * originalResources.summary.resourceIds,\n * filteredResult.value,\n * originalResources\n * );\n * console.log(`Reduced candidates in ${analysis.filteredResources.length} resources`);\n * }\n * ```\n *\n * @example\n * ```typescript\n * // With advanced options and debug logging\n * const result = await FilterTools.createFilteredResourceManagerSimple(\n * originalSystem,\n * { language: 'fr-CA', region: 'quebec' },\n * {\n * partialContextMatch: true,\n * enableDebugLogging: true,\n * reduceQualifiers: false\n * }\n * );\n *\n * if (result.isFailure()) {\n * console.error('Filtering failed:', result.message);\n * }\n * ```\n *\n * @param originalSystem - The original resource system to filter\n * @param partialContext - Filter values to apply for candidate reduction\n * @param options - Configuration options for filtering behavior\n * @returns Result containing the filtered ProcessedResources or error message\n * @public\n */\nexport const createFilteredResourceManagerSimple = async (\n originalSystem: IProcessedResources['system'],\n partialContext: Record<string, string | undefined>,\n options: IFilterOptions = { partialContextMatch: true }\n): Promise<Result<IProcessedResources>> => {\n const enableDebug = options.enableDebugLogging === true;\n\n debugLog(enableDebug, '=== SIMPLE FILTER CREATION ===');\n debugLog(enableDebug, 'Original system:', originalSystem);\n debugLog(enableDebug, 'Partial context:', partialContext);\n\n // Validate the original system\n if (!originalSystem?.resourceManager) {\n return fail('Original system or resourceManager is undefined');\n }\n\n // Filter out undefined values from the context before processing\n const filteredContext = Object.fromEntries(\n Object.entries(partialContext).filter(([, value]) => value !== undefined)\n ) as Record<string, string>;\n\n // Try to use ResourceManagerBuilder.clone() for proper filtering first\n debugLog(enableDebug, 'Using ResourceManagerBuilder for proper filtering');\n debugLog(enableDebug, 'Validating context and cloning manager:', filteredContext);\n const resourceManagerBuilder = originalSystem.resourceManager;\n\n return resourceManagerBuilder\n .validateContext(filteredContext)\n .onSuccess((validatedContext) => {\n debugLog(enableDebug, 'Context validated, creating clone with context:', validatedContext);\n return resourceManagerBuilder.clone({\n filterForContext: validatedContext,\n reduceQualifiers: options.reduceQualifiers\n });\n })\n .withErrorFormat((e) => `Failed to validate context or clone: ${e}`)\n .onSuccess((filteredManager) => {\n debugLog(enableDebug, 'Filtered manager created:', filteredManager);\n\n // Create new ImportManager for the filtered system\n return FileTree.inMemory([])\n .withErrorFormat((e) => `Failed to create in-memory FileTree: ${e}`)\n .onSuccess((emptyTree) =>\n Import.ImportManager.create({\n resources: filteredManager,\n fileTree: emptyTree\n }).withErrorFormat((e) => `Failed to create filtered import manager: ${e}`)\n )\n .onSuccess((newImportManager) => {\n // Create new ContextQualifierProvider for the filtered system\n return Runtime.ValidatingSimpleContextQualifierProvider.create({\n qualifiers: originalSystem.qualifiers\n })\n .withErrorFormat((e) => `Failed to create filtered context provider: ${e}`)\n .onSuccess((newContextQualifierProvider) => {\n // Build the new system object\n const newSystem = {\n qualifierTypes: originalSystem.qualifierTypes,\n qualifiers: originalSystem.qualifiers,\n resourceTypes: originalSystem.resourceTypes,\n resourceManager: filteredManager,\n importManager: newImportManager,\n contextQualifierProvider: newContextQualifierProvider\n };\n\n // Get compiled collection from the filtered manager\n return filteredManager\n .getCompiledResourceCollection({ includeMetadata: true })\n .withErrorFormat((e) => `Failed to get compiled collection: ${e}`)\n .onSuccess((compiledCollection) => {\n // Create resolver for the filtered system\n return Runtime.ResourceResolver.create({\n resourceManager: filteredManager,\n qualifierTypes: originalSystem.qualifierTypes,\n contextQualifierProvider: newContextQualifierProvider\n })\n .withErrorFormat((e) => `Failed to create resolver: ${e}`)\n .onSuccess((resolver) => {\n // Create summary\n const resourceIds = Array.from(filteredManager.resources.keys());\n const summary = {\n totalResources: resourceIds.length,\n resourceIds,\n errorCount: 0,\n warnings: [] as string[]\n };\n\n const processedResources: IProcessedResources = {\n system: newSystem,\n compiledCollection,\n resolver,\n resourceCount: resourceIds.length,\n summary\n };\n\n debugLog(enableDebug, '=== FILTERED PROCESSING COMPLETE ===');\n debugLog(enableDebug, 'Filtered resource count:', resourceIds.length);\n debugLog(enableDebug, 'Filtered resource IDs:', resourceIds);\n\n return succeed(processedResources);\n });\n });\n });\n });\n })\n .onFailure((error) => {\n debugLog(enableDebug, 'Failed to create filtered resource manager:', error);\n return fail(`Failed to create filtered resource manager: ${error}`);\n });\n};\n\n/**\n * Analyze filtered resources compared to original resources\n */\n/**\n * Analyzes the impact of filtering on resources by comparing original and filtered resource sets.\n *\n * Compares original and filtered resources to provide detailed analysis of how filtering\n * affected each resource's candidate count. Identifies resources with potential issues\n * and provides warnings for resources that may have been over-filtered or have no candidates.\n *\n * @example\n * ```typescript\n * import { FilterTools } from '@fgv/ts-res-ui-components';\n *\n * // After creating filtered resources\n * const originalIds = originalResources.summary.resourceIds;\n * const analysis = FilterTools.analyzeFilteredResources(\n * originalIds,\n * filteredResources,\n * originalResources\n * );\n *\n * if (analysis.success) {\n * console.log(`Analyzed ${analysis.filteredResources.length} resources`);\n *\n * // Find resources with significant candidate reduction\n * const heavilyFiltered = analysis.filteredResources.filter(r =>\n * r.originalCandidateCount > 5 && r.filteredCandidateCount === 1\n * );\n * console.log(`${heavilyFiltered.length} resources heavily filtered`);\n *\n * // Check for warnings\n * if (analysis.warnings.length > 0) {\n * console.warn('Filter warnings:', analysis.warnings);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using analysis for UI display\n * const analysis = FilterTools.analyzeFilteredResources(resourceIds, filtered, original);\n *\n * const resourcesWithIssues = analysis.filteredResources.filter(r => r.hasWarning);\n * if (resourcesWithIssues.length > 0) {\n * showWarningDialog(\n * `${resourcesWithIssues.length} resources may be over-filtered`,\n * resourcesWithIssues.map(r => r.id)\n * );\n * }\n * ```\n *\n * @param originalResourceIds - Array of resource IDs from the original system\n * @param filteredProcessedResources - The filtered resource system to analyze\n * @param originalProcessedResources - The original resource system for comparison\n * @returns Analysis result with per-resource filtering impact and warnings\n * @public\n */\nexport function analyzeFilteredResources(\n originalResourceIds: string[],\n filteredProcessedResources: IProcessedResources,\n originalProcessedResources: IProcessedResources\n): IFilterResult {\n const filteredResources: IFilteredResource[] = [];\n const warnings: string[] = [];\n\n for (const resourceId of originalResourceIds) {\n // Get original resource info\n const originalResourceResult =\n originalProcessedResources.system.resourceManager.getBuiltResource(resourceId);\n const originalCandidateCount = originalResourceResult.isSuccess()\n ? originalResourceResult.value.candidates.length\n : 0;\n\n // Get filtered resource info\n const filteredResourceResult =\n filteredProcessedResources.system.resourceManager.getBuiltResource(resourceId);\n const filteredCandidateCount = filteredResourceResult.isSuccess()\n ? filteredResourceResult.value.candidates.length\n : 0;\n\n const hasWarning = filteredCandidateCount === 0 && originalCandidateCount > 0;\n if (hasWarning) {\n warnings.push(`Resource ${resourceId} has no matching candidates after filtering`);\n }\n\n filteredResources.push({\n id: resourceId,\n originalCandidateCount,\n filteredCandidateCount,\n hasWarning\n });\n }\n\n return {\n success: true,\n filteredResources,\n processedResources: filteredProcessedResources,\n warnings\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../../src/utils/observability/factories.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAA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,IAAI,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,eAAyC,QAAQ,EACjD,eAAyC,QAAQ;IAEjD,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,YAAY,CAAC,CAAC;IAC9C,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC1C,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA0B,iCAAiC,CACjG,MAAM,EACN,MAAM,CACP,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA0B,8BAA8B,EAAE,CAAC;AAEhG;;;;;;;;;GASG;AACH,MAAM,UAAU,mCAAmC,CACjD,UAA6D,EAC7D,eAAyC,MAAM,EAC/C,eAAyC,MAAM;IAE/C,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,IAAI,mBAAmB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAC/D,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Logging } from '@fgv/ts-utils';\nimport type { IObservabilityContext } from './interfaces';\nimport type { IMessage } from '../../types';\nimport {\n ObservabilityContext,\n ConsoleUserLogger,\n NoOpUserLogger,\n ViewStateUserLogger\n} from './implementations';\n\n/**\n * Creates a console-based observability context for development and debugging.\n * @param diagLogLevel - Log level for diagnostic messages.\n * @param userLogLevel - Log level for user messages.\n * @returns A new observability context with console loggers.\n * @public\n */\nexport function createConsoleObservabilityContext(\n diagLogLevel: Logging.ReporterLogLevel = 'info',\n userLogLevel: Logging.ReporterLogLevel = 'info'\n): IObservabilityContext {\n const diag = new Logging.ConsoleLogger(diagLogLevel);\n const user = new ConsoleUserLogger(userLogLevel);\n return new ObservabilityContext(diag, user);\n}\n\n/**\n * Creates a no-op observability context that suppresses all logging.\n * @param diagLogLevel - Log level for diagnostic messages.\n * @param userLogLevel - Log level for user messages.\n * @returns A new observability context with no-op loggers.\n * @public\n */\nexport function createNoOpObservabilityContext(\n diagLogLevel: Logging.ReporterLogLevel = 'silent',\n userLogLevel: Logging.ReporterLogLevel = 'silent'\n): IObservabilityContext {\n const diag = new Logging.NoOpLogger(diagLogLevel);\n const user = new NoOpUserLogger(userLogLevel);\n return new ObservabilityContext(diag, user);\n}\n\n/**\n * Creates a test observability context with no-op loggers and non-upgrade policy.\n * @returns A new observability context configured for testing.\n * @public\n */\nexport function createTestObservabilityContext(): IObservabilityContext {\n const diag = new Logging.NoOpLogger('silent');\n const user = new NoOpUserLogger('silent');\n return new ObservabilityContext(diag, user, { doNotUpgrade: true });\n}\n\n/**\n * Default console-only observability context for general use.\n * @public\n */\nexport const DefaultObservabilityContext: IObservabilityContext = createConsoleObservabilityContext(\n 'info',\n 'info'\n);\n\n/**\n * Test observability context with no-op loggers.\n * @public\n */\nexport const TestObservabilityContext: IObservabilityContext = createTestObservabilityContext();\n\n/**\n * Creates an observability context that forwards user messages to viewState.addMessage().\n * This bridges the observability system with React component state management.\n *\n * @param addMessage - Function to add messages to viewState (typically viewState.addMessage)\n * @param diagLogLevel - Log level for diagnostic messages (defaults to 'info')\n * @param userLogLevel - Log level for user messages (defaults to 'info')\n * @returns A new observability context with ViewState-connected user logger\n * @public\n */\nexport function createViewStateObservabilityContext(\n addMessage: (type: IMessage['type'], message: string) => void,\n diagLogLevel: Logging.ReporterLogLevel = 'info',\n userLogLevel: Logging.ReporterLogLevel = 'info'\n): IObservabilityContext {\n const diag = new Logging.ConsoleLogger(diagLogLevel);\n const user = new ViewStateUserLogger(addMessage, userLogLevel);\n return new ObservabilityContext(diag, user);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementations.d.ts","sourceRoot":"","sources":["../../../src/utils/observability/implementations.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAW,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,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CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAE5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementations.js","sourceRoot":"","sources":["../../../src/utils/observability/implementations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,OAAO,EAA4B,OAAO,EAAE,MAAM,eAAe,CAAC;AAS3E;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO,CAAC,UAAU;IACvD;;;OAGG;IACH,YAAmB,QAAmC;QACpD,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,OAAiB,EAAE,GAAG,UAAqB;QACxD,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACO,IAAI,CAAC,OAAe,EAAE,KAAsB;QACpD,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,OAAO;gBACV,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACvB,MAAM;YACR,KAAK,SAAS;gBACZ,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACtB,MAAM;YACR,KAAK,MAAM;gBACT,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACtB,MAAM;YACR;gBACE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACrB,MAAM;QACV,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,OAAO,CAAC,UAAU;IACpD;;;OAGG;IACH,YAAmB,QAAmC;QACpD,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;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AAI,YAAY,iBAAiB,IAAI,OAAO,CAAC,IAAI,YAAY,cAAc,CAAC;AAC7F,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Logging, MessageLogLevel, Success, succeed } from '@fgv/ts-utils';\nimport type {\n IUserLogger,\n IUserLogReporter,\n IObservabilityContext,\n IObservabilityPolicy\n} from './interfaces';\nimport type { IMessage } from '../../types';\n\n/**\n * Console-based user logger that extends diagnostic logging with success method.\n * @public\n */\nexport class ConsoleUserLogger extends Logging.LoggerBase implements IUserLogger {\n /**\n * Creates a new console user logger.\n * @param logLevel - The level of logging to be used.\n */\n public constructor(logLevel?: Logging.ReporterLogLevel) {\n super(logLevel);\n }\n\n /**\n * {@inheritDoc ObservabilityTools.IUserLogger.success}\n */\n public success(message?: unknown, ...parameters: unknown[]): Success<string | undefined> {\n return this.log('info', message, ...parameters);\n }\n\n /**\n * implements base class _log.\n */\n protected _log(message: string, level: MessageLogLevel): Success<string | undefined> {\n switch (level) {\n case 'error':\n console.error(message);\n break;\n case 'warning':\n console.warn(message);\n break;\n case 'info':\n console.info(message);\n break;\n default:\n console.log(message);\n break;\n }\n return succeed(message);\n }\n}\n\n/**\n * No-op user logger that suppresses all output.\n * @public\n */\nexport class NoOpUserLogger extends Logging.LoggerBase implements IUserLogger {\n /**\n * Creates a new no-op user logger.\n * @param logLevel - The level of logging to be used.\n */\n public constructor(logLevel?: Logging.ReporterLogLevel) {\n super(logLevel);\n }\n\n /**\n * {@inheritDoc ObservabilityTools.IUserLogger.success}\n */\n public success(message?: unknown, ...parameters: unknown[]): Success<string | undefined> {\n return succeed(undefined);\n }\n\n /**\n * Implements base class _log method.\n */\n protected _log(message: string, __level: MessageLogLevel): Success<string | undefined> {\n // no-op\n return succeed(message);\n }\n}\n\n/**\n * ViewState-connected user logger that forwards messages to viewState.addMessage().\n * This logger bridges the observability system with React component state management.\n * @public\n */\nexport class ViewStateUserLogger extends Logging.LoggerBase implements IUserLogger {\n private readonly _addMessage: (type: IMessage['type'], message: string) => void;\n\n /**\n * Creates a new ViewState user logger.\n * @param addMessage - Function to add messages to viewState (typically viewState.addMessage)\n * @param logLevel - The level of logging to be used.\n */\n public constructor(\n addMessage: (type: IMessage['type'], message: string) => void,\n logLevel?: Logging.ReporterLogLevel\n ) {\n super(logLevel);\n this._addMessage = addMessage;\n }\n\n /**\n * {@inheritDoc ObservabilityTools.IUserLogger.success}\n */\n public success(message?: unknown, ...parameters: unknown[]): Success<string | undefined> {\n // Format message manually since we want different behavior than the base class\n const formattedMessage = this._formatLogMessage(message, ...parameters);\n this._addMessage('success', formattedMessage);\n return succeed(formattedMessage);\n }\n\n /**\n * Message formatting helper with better object serialization\n */\n private _formatLogMessage(message?: unknown, ...parameters: unknown[]): string {\n if (message === undefined) {\n return '';\n }\n\n const baseMessage = this._formatValue(message);\n if (parameters.length === 0) {\n return baseMessage;\n }\n\n // Format each parameter with proper object handling\n return `${baseMessage} ${parameters.map((p) => this._formatValue(p)).join(' ')}`;\n }\n\n /**\n * Format a single value with better object serialization\n */\n private _formatValue(value: unknown): string {\n if (value === null) return 'null';\n if (value === undefined) return 'undefined';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\n // For objects, try JSON.stringify with fallback\n try {\n return JSON.stringify(value, null, 0);\n } catch {\n return String(value);\n }\n }\n\n /**\n * Implements base class _log method by forwarding to viewState.addMessage.\n */\n protected _log(message: string, level: MessageLogLevel): Success<string | undefined> {\n // Map MessageLogLevel to IMessage['type']\n const messageType: IMessage['type'] =\n level === 'warning' ? 'warning' : level === 'error' ? 'error' : 'info';\n\n this._addMessage(messageType, message);\n return succeed(message);\n }\n}\n\n/**\n * User logger that extends LogReporter to provide Result reporting capabilities.\n * Wraps an existing IUserLogger to add IResultReporter functionality.\n * @public\n */\nexport class UserLogReporter extends Logging.LogReporter<unknown> implements IUserLogReporter {\n private readonly _userLogger: IUserLogger;\n\n /**\n * Creates a new UserLogReporter.\n * @param userLogger - The user logger to wrap.\n */\n public constructor(userLogger: IUserLogger) {\n super({ logger: userLogger }); // LogReporter wraps the ILogger part\n this._userLogger = userLogger;\n }\n\n /**\n * {@inheritDoc ObservabilityTools.IUserLogger.success}\n */\n public success(message?: unknown, ...parameters: unknown[]): Success<string | undefined> {\n return this._userLogger.success(message, ...parameters);\n }\n\n /**\n * Override reportSuccess to use the success method for user-friendly reporting.\n * @param level - The log level.\n * @param value - The value to report.\n * @param detail - Optional detail.\n */\n public reportSuccess(level: MessageLogLevel, value: unknown, detail?: unknown): void {\n if (!Logging.shouldLog(level, this.logLevel)) {\n return;\n }\n // Use success method for user-friendly success reporting\n const message = typeof value === 'string' ? value : JSON.stringify(value);\n this.success(message);\n }\n}\n\n/**\n * Observability context that provides both diagnostic and user logging capabilities.\n * @public\n */\nexport class ObservabilityContext implements IObservabilityContext {\n /**\n * {@inheritDoc ObservabilityTools.IObservabilityContext.diag}\n */\n public readonly diag: Logging.LogReporter<unknown>;\n\n /**\n * {@inheritDoc ObservabilityTools.IObservabilityContext.user}\n */\n public readonly user: IUserLogReporter;\n\n /**\n * {@inheritDoc ObservabilityTools.IObservabilityContext.policy}\n */\n public readonly policy?: IObservabilityPolicy;\n\n /**\n * Creates a new observability context.\n * @param diag - The diagnostic logger.\n * @param user - The user logger.\n * @param policy - Optional policy configuration.\n */\n public constructor(diag: Logging.ILogger, user: IUserLogger, policy?: IObservabilityPolicy) {\n // Wrap both loggers consistently\n this.diag = new Logging.LogReporter({ logger: diag });\n this.user = new UserLogReporter(user);\n this.policy = policy;\n }\n}\n\n/**\n * Context type classification for observability contexts.\n * @public\n */\nexport type ObservabilityContextType = 'viewstate' | 'console' | 'custom';\n\n/**\n * Detects the type of observability context based on the user logger implementation.\n * @param context - The observability context to analyze\n * @returns The detected context type\n * @public\n */\nexport function detectObservabilityContextType(context: IObservabilityContext): ObservabilityContextType {\n if (context.user instanceof ViewStateUserLogger) {\n return 'viewstate';\n }\n if (context.user instanceof ConsoleUserLogger || context.user instanceof NoOpUserLogger) {\n return 'console';\n }\n return 'custom';\n}\n\n/**\n * Checks if an observability context is connected to ViewState for UI message display.\n * @param context - The observability context to check\n * @returns True if the context sends user messages to ViewState\n * @public\n */\nexport function isViewStateConnected(context: IObservabilityContext): boolean {\n return context.user instanceof ViewStateUserLogger;\n}\n\n/**\n * Checks if an observability context only outputs to console (not UI messages).\n * @param context - The observability context to check\n * @returns True if the context only outputs to console\n * @public\n */\nexport function isConsoleOnlyContext(context: IObservabilityContext): boolean {\n return context.user instanceof ConsoleUserLogger || context.user instanceof NoOpUserLogger;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/observability/index.ts"],"names":[],"mappings":"AAuBA,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,8BAA8B,EAC9B,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAGlE,OAAO,EACL,iCAAiC,EACjC,8BAA8B,EAC9B,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,aAAa,CAAC"}
|