@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":"useFilterState.js","sourceRoot":"","sources":["../../src/hooks/useFilterState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAe9C,MAAM,kBAAkB,GAAiB;IACvC,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,EAAE;IACV,aAAa,EAAE,EAAE;IACjB,iBAAiB,EAAE,KAAK;IACxB,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,0FAA0F;AAC1F,MAAM,eAAe,GAAG,CAAC,IAAwC,EAA0B,EAAE;IAC3F,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC5C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YACxC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,UAAU,cAAc,CAAC,YAAoC;IACjE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe;QAC/C,GAAG,kBAAkB;QACrB,GAAG,YAAY;KACh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;YACjC,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,EAAE;QACzC,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClB,GAAG,IAAI;YACP,MAAM,EAAE,EAAE;YACV,aAAa,EAAE,EAAE;YACjB,iBAAiB,EAAE,KAAK;YACxB,OAAO,EAAE,KAAK;SACf,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,sBAAsB,GAAG,WAAW,CAAC,CAAC,gBAAyB,EAAE,EAAE;QACvE,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClB,GAAG,IAAI;YACP,gBAAgB;SACjB,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GAAmB;QAC9B,mBAAmB;QACnB,kBAAkB;QAClB,iBAAiB;QACjB,iBAAiB;QACjB,sBAAsB;KACvB,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["import { useState, useCallback } from 'react';\nimport { IFilterState, IFilterActions } from '../types';\n\n/**\n * Return type for the useFilterState hook.\n *\n * @public\n */\nexport interface IUseFilterStateReturn {\n /** Current filter state including enabled status and filter values */\n state: IFilterState;\n /** Available actions for managing filter state */\n actions: IFilterActions;\n}\n\nconst initialFilterState: IFilterState = {\n enabled: false,\n values: {},\n appliedValues: {},\n hasPendingChanges: false,\n reduceQualifiers: false\n};\n\n// Normalize values by filtering out undefined and empty strings for consistent comparison\nconst normalizeValues = (vals: Record<string, string | undefined>): Record<string, string> => {\n const normalized: Record<string, string> = {};\n Object.entries(vals).forEach(([key, value]) => {\n if (value !== undefined && value !== '') {\n normalized[key] = value;\n }\n });\n return normalized;\n};\n\n/**\n * Hook for managing resource filtering state.\n *\n * This hook provides state management for resource filtering operations,\n * including filter values, pending changes tracking, and apply/reset operations.\n * It's designed to work with the FilterView component to provide a complete\n * filtering experience with change tracking and validation.\n *\n * Key features:\n * - **Filter Management**: Enable/disable filtering and manage filter values\n * - **Change Tracking**: Track pending changes before applying filters\n * - **Validation**: Prevent invalid filter states and provide user feedback\n * - **Qualifier Reduction**: Option to reduce qualifier scope when filtering\n *\n * @example\n * ```tsx\n * function ResourceFilterView() {\n * const { state, actions } = useFilterState({\n * enabled: true,\n * values: { platform: 'web', locale: 'en' }\n * });\n *\n * return (\n * <div>\n * <FilterControls\n * enabled={state.enabled}\n * values={state.values}\n * hasPendingChanges={state.hasPendingChanges}\n * onEnabledChange={actions.updateFilterEnabled}\n * onValueChange={actions.updateFilterValue}\n * onApply={actions.applyFilters}\n * onReset={actions.resetFilters}\n * />\n *\n * {state.enabled && (\n * <FilteredResourceView filterValues={state.appliedValues} />\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @param initialState - Optional initial filter state\n * @returns Object containing filter state and actions\n * @public\n */\nexport function useFilterState(initialState?: Partial<IFilterState>): IUseFilterStateReturn {\n const [state, setState] = useState<IFilterState>({\n ...initialFilterState,\n ...initialState\n });\n\n const updateFilterEnabled = useCallback((enabled: boolean) => {\n setState((prev) => {\n const normalizedValues = normalizeValues(prev.values);\n const normalizedApplied = normalizeValues(prev.appliedValues);\n const hasChanges = JSON.stringify(normalizedValues) !== JSON.stringify(normalizedApplied);\n\n return {\n ...prev,\n enabled,\n // Only consider filter values when determining pending changes, not the enabled state itself\n hasPendingChanges: enabled && hasChanges\n };\n });\n }, []);\n\n const updateFilterValues = useCallback((values: Record<string, string | undefined>) => {\n setState((prev) => {\n const normalizedValues = normalizeValues(values);\n const normalizedApplied = normalizeValues(prev.appliedValues);\n const hasChanges = JSON.stringify(normalizedValues) !== JSON.stringify(normalizedApplied);\n\n return {\n ...prev,\n values,\n hasPendingChanges: prev.enabled && hasChanges\n };\n });\n }, []);\n\n const applyFilterValues = useCallback(() => {\n setState((prev) => ({\n ...prev,\n appliedValues: { ...prev.values },\n hasPendingChanges: false\n }));\n }, []);\n\n const resetFilterValues = useCallback(() => {\n setState((prev) => ({\n ...prev,\n values: {},\n appliedValues: {},\n hasPendingChanges: false,\n enabled: false\n }));\n }, []);\n\n const updateReduceQualifiers = useCallback((reduceQualifiers: boolean) => {\n setState((prev) => ({\n ...prev,\n reduceQualifiers\n }));\n }, []);\n\n const actions: IFilterActions = {\n updateFilterEnabled,\n updateFilterValues,\n applyFilterValues,\n resetFilterValues,\n updateReduceQualifiers\n };\n\n return { state, actions };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavigationWarning.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavigationWarning.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,OAAO;IAClD,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC,GAAG,OAAO;IACpD,oBAAoB,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,IAAI,CAAC;IACtC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,GAAG,OAAO,OAAK;IACnD,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAClC,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;CAgDvC,CAAC;AAGF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,GAAG,OAAO,IAAI,uBAAuB,CAAC,CAAC,CAAC,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C;IAEP,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,EAAE;QACzC,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC;QAC3C,QAAQ,CAAC,CAAC,IAAgC,EAAE,EAAE,CAAC,CAAC;YAC9C,GAAG,IAAI;YACP,aAAa,EAAE,KAAK;YACpB,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC,CAAC;QACJ,OAAO,gBAAgB,CAAC;IAC1B,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAExB,OAAO;QACL,KAAK;QACL,OAAO,EAAE;YACP,oBAAoB;YACpB,WAAW;YACX,WAAW;YACX,iBAAiB;SAClB;KACF,CAAC;AACJ,CAAC,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 { useState, useCallback } from 'react';\n\n/**\n * @public\n */\nexport interface INavigationWarningState<T = unknown> {\n isWarningOpen: boolean;\n pendingTool: T | null;\n hasUnsavedChanges: boolean;\n}\n\n/**\n * @public\n */\nexport interface INavigationWarningActions<T = unknown> {\n setHasUnsavedChanges: (hasChanges: boolean) => void;\n showWarning: (pendingTool: T) => void;\n hideWarning: () => void;\n confirmNavigation: () => T | null;\n}\n\n/**\n * @public\n */\nexport const useNavigationWarning = <T = unknown>(): {\n state: INavigationWarningState<T>;\n actions: INavigationWarningActions<T>;\n} => {\n const [state, setState] = useState<INavigationWarningState<T>>({\n isWarningOpen: false,\n pendingTool: null,\n hasUnsavedChanges: false\n });\n\n const setHasUnsavedChanges = useCallback((hasChanges: boolean) => {\n setState((prev: INavigationWarningState<T>) => ({ ...prev, hasUnsavedChanges: hasChanges }));\n }, []);\n\n const showWarning = useCallback((pendingTool: T) => {\n setState((prev: INavigationWarningState<T>) => ({\n ...prev,\n isWarningOpen: true,\n pendingTool\n }));\n }, []);\n\n const hideWarning = useCallback(() => {\n setState((prev: INavigationWarningState<T>) => ({\n ...prev,\n isWarningOpen: false,\n pendingTool: null\n }));\n }, []);\n\n const confirmNavigation = useCallback(() => {\n const toolToNavigateTo = state.pendingTool;\n setState((prev: INavigationWarningState<T>) => ({\n ...prev,\n isWarningOpen: false,\n pendingTool: null,\n hasUnsavedChanges: false\n }));\n return toolToNavigateTo;\n }, [state.pendingTool]);\n\n return {\n state,\n actions: {\n setHasUnsavedChanges,\n showWarning,\n hideWarning,\n confirmNavigation\n }\n };\n};\n\n// Backward compatibility type aliases\n/**\n * @deprecated Use INavigationWarningState instead\n * @public\n */\nexport type NavigationWarningState<T = unknown> = INavigationWarningState<T>;\n\n/**\n * @deprecated Use INavigationWarningActions instead\n * @public\n */\nexport type NavigationWarningActions<T = unknown> = INavigationWarningActions<T>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResolutionState.d.ts","sourceRoot":"","sources":["../../src/hooks/useResolutionState.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gB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Ac;QACd,WAAW;QACX,UAAU;QACV,eAAe;QACf,QAAQ;QACR,cAAc;QACd,OAAO;QACP,UAAU;QACV,YAAY;QACZ,qCAAqC;QACrC,qBAAqB;QACrB,gBAAgB;QAChB,mBAAmB;QACnB,kBAAkB;QAClB,qBAAqB;QACrB,wBAAwB;QACxB,iBAAiB;QACjB,qBAAqB;QACrB,uBAAuB;QACvB,qBAAqB;QACrB,uBAAuB;KACxB,CAAC,EACF;QACE,kBAAkB;QAClB,YAAY;QACZ,cAAc;QACd,WAAW;QACX,UAAU;QACV,QAAQ;QACR,cAAc;QACd,OAAO;QACP,UAAU;QACV,YAAY;QACZ,qBAAqB;QACrB,gBAAgB;QAChB,mBAAmB;QACnB,kBAAkB;QAClB,qBAAqB;QACrB,wBAAwB;QACxB,iBAAiB;QACjB,qBAAqB;QACrB,uBAAuB;QACvB,qBAAqB;QACrB,uBAAuB;KACxB,CACF,CAAC;IAEF,OAAO;QACL,KAAK;QACL,OAAO;QACP,mBAAmB;KACpB,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useCallback, useMemo } from 'react';\nimport { Qualifiers, Runtime, ResourceJson, ResourceTypes, Validate, QualifierName } from '@fgv/ts-res';\nimport { Result, succeed, fail, MessageAggregator } from '@fgv/ts-utils';\nimport type { JsonObject as ResourceJsonObject } from '@fgv/ts-json-base';\nimport { isJsonObject } from '@fgv/ts-json-base';\nimport {\n IResolutionState,\n IResolutionActions,\n IResolutionResult,\n IProcessedResources,\n JsonValue,\n ICreatePendingResourceParams,\n IStartNewResourceParams\n} from '../types';\nimport {\n createResolverWithContext,\n resolveResourceDetailed,\n getAvailableQualifiers,\n hasPendingContextChanges\n} from '../utils/resolutionUtils';\nimport { useSmartObservability } from './useSmartObservability';\nimport {\n validateEditedResource,\n computeResourceDelta,\n rebuildSystemWithChanges,\n extractResolutionContext\n} from '../utils/resolutionEditing';\n\n/**\n * Return type for the useResolutionState hook.\n *\n * @public\n */\nexport interface IUseResolutionStateReturn {\n /** Current resolution state including context, results, and editing state */\n state: IResolutionState;\n /** Available actions for managing resolution and editing */\n actions: IResolutionActions;\n /** List of available qualifier keys that can be used in the resolution context */\n availableQualifiers: string[];\n}\n\n/**\n * Helper function to find and validate a resource type by name.\n *\n * @param typeName - The resource type name to find\n * @param availableResourceTypes - Array of available resource types\n * @returns Result containing the found resource type or error\n */\nfunction findResourceType(\n typeName: string,\n availableResourceTypes: ResourceTypes.IResourceType[]\n): Result<ResourceTypes.IResourceType> {\n const resourceType = availableResourceTypes.find((t) => t.key === typeName);\n\n if (!resourceType) {\n const availableTypes = availableResourceTypes.map((t) => t.key).join(', ');\n return fail(`${typeName}: Resource type not found. Available types: ${availableTypes}`);\n }\n\n return succeed(resourceType);\n}\n\n/**\n * Helper function to create condition declarations from context with proper validation.\n *\n * @param effectiveContext - The context values to create conditions from\n * @param qualifiers - The qualifiers collection for validation\n * @returns Result containing condition declarations or error\n */\nfunction createContextConditions(\n effectiveContext: Record<string, string | undefined>,\n qualifiers: Qualifiers.IReadOnlyQualifierCollector | undefined\n): Result<ResourceJson.Json.ILooseConditionDecl[]> {\n // Qualifiers are required for proper validation\n if (!qualifiers) {\n return fail('context-validation: Qualifiers not available - cannot validate context values');\n }\n const contextConditions: ResourceJson.Json.ILooseConditionDecl[] = [];\n const errors: MessageAggregator = new MessageAggregator();\n\n for (const [qualifierName, qualifierValue] of Object.entries(effectiveContext)) {\n if (qualifierValue === undefined || qualifierValue === null) {\n continue; // Skip undefined/null values\n }\n\n qualifiers\n .get(qualifierName as QualifierName)\n .asResult.withErrorFormat((error) => `${qualifierName}: Unknown qualifier - ${error}`)\n .onSuccess((qualifier) => {\n return qualifier\n .validateCondition(qualifierValue)\n .withErrorFormat((error) => `${qualifierName}: Invalid value '${qualifierValue}' - ${error}`);\n })\n .onSuccess((qualifier) => {\n contextConditions.push({ qualifierName, operator: 'matches', value: qualifierValue });\n return succeed(qualifier);\n })\n .aggregateError(errors);\n }\n\n return errors.returnOrReport(succeed(contextConditions));\n}\n\n/**\n * Helper function to check if a resource ID already exists.\n *\n * @param resourceId - The resource ID to check\n * @param processedResources - The processed resources (may be null)\n * @param pendingResources - Map of pending resources\n * @returns true if the ID already exists, false otherwise\n */\nfunction isResourceIdTaken(\n resourceId: string,\n processedResources: IProcessedResources | null,\n pendingResources: Map<string, ResourceJson.Json.ILooseResourceDecl>\n): boolean {\n return (\n processedResources?.summary?.resourceIds?.find((rid) => rid === resourceId) !== undefined ||\n pendingResources.has(resourceId)\n );\n}\n\n/**\n * Hook for managing resource resolution state and editing operations.\n *\n * This hook provides comprehensive state management for resource resolution,\n * including context management, resource editing, and conflict detection.\n * It integrates with the ts-res library to provide real-time resolution\n * results and supports editing resources with validation and preview functionality.\n *\n * Key features:\n * - **Context Management**: Set and update resolution context (qualifiers)\n * - **Resource Resolution**: Real-time resolution with detailed results\n * - **Resource Editing**: Edit resources with validation and conflict detection\n * - **Preview Mode**: See how edits affect resolution without committing\n * - **Change Tracking**: Track pending changes and detect conflicts\n *\n * @example\n * ```tsx\n * function ResourceResolutionView({ processedResources }: { processedResources: ProcessedResources }) {\n * const { state, actions, availableQualifiers } = useResolutionState(\n * processedResources,\n * (updatedResources) => {\n * // Handle system updates when edits are applied\n * setProcessedResources(updatedResources);\n * }\n * );\n *\n * return (\n * <div>\n * <QualifierSelector\n * availableQualifiers={availableQualifiers}\n * context={state.context}\n * onChange={actions.updateContext}\n * />\n *\n * <ResourcePicker\n * selectedResourceId={state.selectedResourceId}\n * onResourceSelect={(selection) => {\n * actions.selectResource(selection.resourceId);\n * }}\n * />\n *\n * {state.resolutionResult && (\n * <ResolutionDisplay\n * result={state.resolutionResult}\n * isEditing={state.isEditing}\n * editedValue={state.editedValue}\n * onEdit={actions.startEditing}\n * onSave={actions.saveEdit}\n * onCancel={actions.cancelEdit}\n * />\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @param processedResources - The processed resources to work with\n * @param onSystemUpdate - Optional callback when the resource system is updated with edits\n * @returns Object containing resolution state, actions, and available qualifiers\n * @public\n */\nexport function useResolutionState(\n processedResources: IProcessedResources | null,\n onSystemUpdate?: (updatedResources: IProcessedResources) => void\n): IUseResolutionStateReturn {\n // Get smart observability context (auto-detects and upgrades as needed)\n const o11y = useSmartObservability();\n // Get available qualifiers\n const availableQualifiers = useMemo(() => {\n if (!processedResources) return [];\n return getAvailableQualifiers(processedResources);\n }, [processedResources]);\n\n // Initialize context with all qualifiers undefined\n const defaultContextValues = useMemo(() => {\n const defaults: Record<string, string | undefined> = {};\n availableQualifiers.forEach((qualifierName) => {\n defaults[qualifierName] = undefined;\n });\n return defaults;\n }, [availableQualifiers]);\n\n // Resolution state - Three layers:\n // 1. appliedUserValues: User values that have been applied (via Apply button)\n // 2. pendingUserValues: User values that haven't been applied yet\n // 3. hostManagedValues: Values controlled by the host (passed as prop)\n // Effective context = appliedUserValues + hostManagedValues (host overrides user)\n\n const [appliedUserValues, setAppliedUserValues] = useState<Record<string, string | undefined>>({});\n const [pendingUserValues, setPendingUserValues] = useState<Record<string, string | undefined>>({});\n const [selectedResourceId, setSelectedResourceId] = useState<string | null>(null);\n const [currentResolver, setCurrentResolver] = useState<Runtime.ResourceResolver | null>(null);\n const [resolutionResult, setResolutionResult] = useState<IResolutionResult | null>(null);\n const [viewMode, setViewMode] = useState<'composed' | 'best' | 'all' | 'raw'>('composed');\n\n // Store host-managed values that can be updated via applyContext\n const [hostManagedValues, setHostManagedValues] = useState<Record<string, string | undefined>>({});\n\n // Compute effective context: user values + host values (host wins)\n const effectiveContext = useMemo(\n () => ({\n ...appliedUserValues,\n ...hostManagedValues\n }),\n [appliedUserValues, hostManagedValues]\n );\n\n // Edit state - stores original, edited, and delta for each resource\n const [editedResourcesInternal, setEditedResourcesInternal] = useState<\n Map<string, { originalValue: JsonValue; editedValue: JsonValue; delta: JsonValue }>\n >(new Map());\n\n // Pending resource edit state - tracks edits to pending resources separately from templates\n const [pendingResourceEdits, setPendingResourceEdits] = useState<\n Map<string, { originalValue: JsonValue; editedValue: JsonValue }>\n >(new Map());\n\n // Convert to the simpler Map format expected by ResolutionState\n const editedResources = useMemo(() => {\n const simpleMap = new Map<string, JsonValue>();\n\n // Include existing resource edits\n editedResourcesInternal.forEach((value, key) => {\n simpleMap.set(key, value.editedValue);\n });\n\n // Include pending resource edits\n pendingResourceEdits.forEach((value, key) => {\n simpleMap.set(key, value.editedValue);\n });\n\n return simpleMap;\n }, [editedResourcesInternal, pendingResourceEdits]);\n const [isApplyingEdits, setIsApplyingEdits] = useState(false);\n\n // Pending resource state\n const [pendingResources, setPendingResources] = useState<Map<string, ResourceJson.Json.ILooseResourceDecl>>(\n new Map()\n );\n const [pendingResourceDeletions, setPendingResourceDeletions] = useState<Set<string>>(new Set());\n const [newResourceDraft, setNewResourceDraft] = useState<\n | {\n resourceId: string;\n resourceType: string;\n template: ResourceJson.Json.ILooseResourceDecl;\n isValid: boolean;\n }\n | undefined\n >(undefined);\n\n // Get available resource types from the processed resources\n const availableResourceTypes = useMemo<ResourceTypes.IResourceType[]>(() => {\n if (!processedResources) return [];\n const types: ResourceTypes.IResourceType[] = [];\n processedResources.system.resourceTypes.forEach((type) => {\n types.push(type as ResourceTypes.IResourceType);\n });\n return types;\n }, [processedResources]);\n\n // Update context state when defaults change\n React.useEffect(() => {\n setAppliedUserValues(defaultContextValues);\n setPendingUserValues(defaultContextValues);\n }, [defaultContextValues]);\n\n // Check for pending changes - only user values, not host values\n const hasPendingChanges = useMemo(() => {\n return hasPendingContextChanges(appliedUserValues, pendingUserValues);\n }, [appliedUserValues, pendingUserValues]);\n\n // Check for unsaved edits\n const hasUnsavedEdits = useMemo(() => {\n return editedResourcesInternal.size > 0 || pendingResourceEdits.size > 0;\n }, [editedResourcesInternal, pendingResourceEdits]);\n\n // Check for pending resource changes\n const hasPendingResourceChanges = useMemo(() => {\n return pendingResources.size > 0 || pendingResourceDeletions.size > 0;\n }, [pendingResources, pendingResourceDeletions]);\n\n // Update context value (only updates pending user values, not host values)\n const updateContextValue = useCallback(\n (qualifierName: string, value: string | undefined): Result<void> => {\n let validatedQualifierName: QualifierName | undefined;\n try {\n // Validate qualifier name using proper ts-res validator\n const qualifierNameResult = Validate.toQualifierName(qualifierName);\n if (qualifierNameResult.isFailure()) {\n const error = `${qualifierName}: Invalid qualifier name - ${qualifierNameResult.message}`;\n o11y.user.error(error);\n return fail(error);\n }\n\n validatedQualifierName = qualifierNameResult.value;\n\n // Validate qualifier exists in system (if available)\n if (processedResources?.system?.qualifiers) {\n const availableQualifiers = Array.from(processedResources.system.qualifiers.keys());\n if (!availableQualifiers.includes(validatedQualifierName)) {\n const error = `${qualifierName}: Unknown qualifier. Available qualifiers: ${availableQualifiers.join(\n ', '\n )}`;\n o11y.user.warn(error);\n // Continue anyway for flexibility, but warn user\n }\n }\n\n setPendingUserValues((prev) => ({\n ...prev,\n [validatedQualifierName as string]: value\n }));\n\n o11y.user.info(`${validatedQualifierName}: Updated context value to ${value ?? 'undefined'}`);\n return succeed(undefined);\n } catch (error) {\n const errorMessage = `${validatedQualifierName ?? qualifierName}: Failed to update context value - ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [processedResources, o11y]\n );\n\n // Apply context changes - applies pending user values and/or updates host values\n const applyContext = useCallback(\n (newHostManagedValues?: Record<string, string | undefined>): Result<void> => {\n if (!processedResources) {\n const error = 'context-apply: No resources loaded - cannot apply context';\n o11y.user.error(error);\n return fail(error);\n }\n\n try {\n if (newHostManagedValues !== undefined) {\n // When called with host values, ONLY update host values\n o11y.diag.info('context-apply: Applying host managed values', newHostManagedValues);\n setHostManagedValues(newHostManagedValues);\n o11y.diag.info('context-apply: Host-managed context values updated');\n return succeed(undefined);\n } else {\n // When called without arguments (from Apply button), apply pending user values\n o11y.diag.info('context-apply: Applying pending user values', pendingUserValues);\n\n // Create resolver with the new effective context to validate first\n const newEffectiveContext = {\n ...pendingUserValues,\n ...hostManagedValues\n };\n\n // Create resolver with effective context to validate the context values\n const resolverResult = createResolverWithContext(processedResources, newEffectiveContext, {\n enableCaching: true,\n enableDebugLogging: false\n });\n\n if (resolverResult.isFailure()) {\n const error = `Failed to create resolver: ${resolverResult.message}`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Only set applied values if validation succeeded\n setAppliedUserValues(pendingUserValues);\n setCurrentResolver(resolverResult.value);\n\n // If a resource is selected, resolve it with the new context (skip pending resources)\n if (selectedResourceId && !pendingResources.has(selectedResourceId)) {\n const resolutionResult = resolveResourceDetailed(\n resolverResult.value,\n selectedResourceId,\n processedResources\n );\n\n if (resolutionResult.isSuccess()) {\n setResolutionResult(resolutionResult.value);\n } else {\n o11y.user.warn(\n `resolution: Failed to resolve selected resource after context change - ${resolutionResult.message}`\n );\n // Don't fail the context apply just because selected resource failed\n }\n } else if (selectedResourceId && pendingResources.has(selectedResourceId)) {\n // Re-create the mock result for pending resource with new context\n const pendingResource = pendingResources.get(selectedResourceId);\n if (pendingResource) {\n const mockResult: IResolutionResult = {\n success: true,\n resourceId: selectedResourceId,\n composedValue: pendingResource.candidates?.[0]?.json || {},\n candidateDetails: (pendingResource.candidates || []).map((c, index) => ({\n candidate: {\n json: c.json || {},\n conditions: c.conditions,\n isPartial: c.isPartial || false,\n mergeMethod: c.mergeMethod || 'replace'\n } as Runtime.IResourceCandidate,\n conditionSetKey: null,\n candidateIndex: index,\n matched: true,\n matchType: 'match' as const,\n isDefaultMatch: false\n }))\n };\n setResolutionResult(mockResult);\n }\n }\n\n const numAppliedValues = Object.keys(pendingUserValues).length;\n const filteredAppliedValues = Object.entries(pendingUserValues).filter(\n ([key, value]) => value !== undefined\n );\n const numFilteredAppliedValues = filteredAppliedValues.length;\n const appliedValuesList = filteredAppliedValues.map(([key, value]) => `${key}=${value}`).join(', ');\n o11y.user.success(\n `Context applied: ${numFilteredAppliedValues}/${numAppliedValues} value(s) (${appliedValuesList})`\n );\n return succeed(undefined);\n }\n } catch (error) {\n const errorMessage = `context-apply: Failed to apply context - ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [processedResources, pendingUserValues, selectedResourceId, o11y, hostManagedValues, pendingResources]\n );\n\n // Select resource and resolve it\n const selectResource = useCallback(\n (resourceId: string): Result<void> => {\n try {\n // Validate resource ID using proper ts-res validator\n const resourceIdResult = Validate.toResourceId(resourceId);\n if (resourceIdResult.isFailure()) {\n const error = `Invalid resource ID: ${resourceIdResult.message}`;\n o11y.user.error(error);\n return fail(error);\n }\n\n const validatedResourceId = resourceIdResult.value;\n\n // Check if this is a pending new resource\n const pendingResource = pendingResources.get(resourceId);\n if (pendingResource) {\n setSelectedResourceId(resourceId);\n setResolutionResult(null);\n\n // For pending new resources, create a mock resolution result\n const mockResult: IResolutionResult = {\n success: true,\n resourceId,\n composedValue: pendingResource.candidates?.[0]?.json || {},\n candidateDetails: (pendingResource.candidates || []).map((c, index) => ({\n candidate: {\n json: c.json || {},\n conditions: c.conditions,\n isPartial: c.isPartial || false,\n mergeMethod: c.mergeMethod || 'replace'\n } as Runtime.IResourceCandidate,\n conditionSetKey: null,\n candidateIndex: index,\n matched: true,\n matchType: 'match' as const,\n isDefaultMatch: false\n }))\n };\n setResolutionResult(mockResult);\n o11y.diag.info(`Selected pending resource: ${resourceId}`);\n return succeed(undefined);\n }\n\n // Check if resource exists in the system before setting selection\n if (!processedResources) {\n const error = 'No resource system available for resource lookup';\n o11y.user.error(error);\n return fail(error);\n }\n\n // Check if resource exists in the system\n const resourceExists = processedResources.summary.resourceIds.includes(resourceId);\n\n if (!resourceExists) {\n // Resource doesn't exist - create error result but still set selection for UI consistency\n setSelectedResourceId(resourceId);\n const errorResult: IResolutionResult = {\n success: false,\n resourceId,\n error: `Failed to get resource: ${resourceId}: not found.`\n };\n setResolutionResult(errorResult);\n const error = `Resource '${resourceId}' not found in the system`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Resource exists, proceed with selection and resolution\n setSelectedResourceId(resourceId);\n setResolutionResult(null);\n\n // For existing resources, resolve normally\n if (!currentResolver) {\n const error = 'No resolver available for resource resolution';\n o11y.user.error(error);\n return fail(error);\n }\n\n return resolveResourceDetailed(currentResolver, validatedResourceId, processedResources)\n .onSuccess((resolvedResult) => {\n setResolutionResult(resolvedResult);\n o11y.user.info(`Selected resource: ${resourceId}`);\n return succeed(undefined);\n })\n .onFailure((resolutionError) => {\n // Create error result\n const errorResult: IResolutionResult = {\n success: false,\n resourceId,\n error: resolutionError\n };\n setResolutionResult(errorResult);\n const error = `Failed to resolve resource '${resourceId}': ${resolutionError}`;\n o11y.user.error(error);\n return fail(error);\n });\n } catch (error) {\n const errorMessage = `Unexpected error selecting resource '${resourceId}': ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [currentResolver, processedResources, pendingResources, o11y]\n );\n\n // Reset cache\n const resetCache = useCallback((): Result<void> => {\n if (!currentResolver) {\n const error = 'No resolver available - cache cannot be cleared';\n o11y.user.warn(error);\n return fail(error);\n }\n\n try {\n currentResolver.clearConditionCache();\n o11y.diag.info('resolution: Cache cleared successfully');\n return succeed(undefined);\n } catch (error) {\n const errorMessage = `Failed to clear cache: ${error instanceof Error ? error.message : String(error)}`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n }, [currentResolver, o11y]);\n\n // Auto-apply when resources are loaded or host values change\n React.useEffect(() => {\n if (!processedResources) return;\n\n o11y.diag.info('context-auto: Auto-applying effective context', effectiveContext);\n o11y.diag.info('context-hook: Host managed values', hostManagedValues);\n o11y.diag.info('context-hook: Applied user values', appliedUserValues);\n\n // Create resolver with effective context whenever host values change\n const resolverResult = createResolverWithContext(processedResources, effectiveContext, {\n enableCaching: true,\n enableDebugLogging: false\n });\n\n if (resolverResult.isSuccess()) {\n setCurrentResolver(resolverResult.value);\n o11y.diag.info('Resolver created successfully with context:', effectiveContext);\n\n // Re-resolve selected resource if any (but skip pending resources)\n if (selectedResourceId && !pendingResources.has(selectedResourceId)) {\n o11y.diag.info('Re-resolving resource:', selectedResourceId);\n const resolutionResult = resolveResourceDetailed(\n resolverResult.value,\n selectedResourceId,\n processedResources\n );\n\n if (resolutionResult.isSuccess()) {\n o11y.diag.info('Resolution successful for resource:', selectedResourceId);\n setResolutionResult(resolutionResult.value);\n } else {\n o11y.diag.error('Resolution failed:', resolutionResult.message);\n }\n } else if (selectedResourceId && pendingResources.has(selectedResourceId)) {\n // Keep the existing mock resolution result for pending resources\n o11y.diag.info('Skipping resolution for pending resource:', selectedResourceId);\n }\n } else {\n o11y.diag.error('Failed to create resolver with effective context:', resolverResult.message);\n }\n }, [\n processedResources,\n effectiveContext,\n selectedResourceId,\n hostManagedValues,\n appliedUserValues,\n pendingResources\n ]);\n\n // Edit management functions\n const saveEdit = useCallback(\n (resourceId: string, editedValue: JsonValue, originalValue?: JsonValue): Result<void> => {\n try {\n // Validate inputs using proper validators\n const resourceIdResult = Validate.toResourceId(resourceId);\n if (resourceIdResult.isFailure()) {\n const error = `Invalid resource ID: ${resourceIdResult.message}`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Validate edited value is not null/undefined (JsonValue allows null, but we need a real value)\n if (editedValue === null || editedValue === undefined) {\n const error = 'Edited value cannot be null or undefined';\n o11y.user.error(error);\n return fail(error);\n }\n\n // Validate the edited value\n const validation = validateEditedResource(editedValue);\n if (!validation.isValid) {\n const error = `Invalid edit: ${validation.errors.join(', ')}`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Show warnings if any\n if (validation.warnings.length > 0) {\n validation.warnings.forEach((warning: string) => o11y.user.warn(warning));\n }\n\n // Check if this is a pending new resource\n const pendingResource = pendingResources.get(resourceId);\n if (pendingResource) {\n // For pending resources, track the edit separately from the original template\n const originalCandidate = pendingResource.candidates?.[0];\n const originalValue = originalCandidate?.json || {};\n\n // Store the edit in pending resource edits\n setPendingResourceEdits((prev) => {\n const newMap = new Map(prev);\n newMap.set(resourceId, {\n originalValue,\n editedValue\n });\n return newMap;\n });\n\n // Update the resolution result to reflect the new value\n if (selectedResourceId === resourceId) {\n const mockResult: IResolutionResult = {\n success: true,\n resourceId,\n composedValue: isJsonObject(editedValue) ? editedValue : { value: editedValue },\n candidateDetails: [\n {\n candidate: {\n json: (isJsonObject(editedValue)\n ? editedValue\n : { value: editedValue }) as ResourceJsonObject,\n conditions: originalCandidate?.conditions,\n isPartial: false,\n mergeMethod: 'replace'\n } as Runtime.IResourceCandidate,\n conditionSetKey: null,\n candidateIndex: 0,\n matched: true,\n matchType: 'match' as const,\n isDefaultMatch: false\n }\n ]\n };\n setResolutionResult(mockResult);\n }\n\n o11y.user.success(`Edit saved for pending resource: ${resourceId}`);\n return succeed(undefined);\n }\n\n // Check if resource exists (for existing resources)\n if (!processedResources?.summary.resourceIds.includes(resourceId)) {\n const error = `Resource '${resourceId}' not found in the system`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // For existing resources, compute the delta and save as edit\n const resolvedValue = originalValue || editedValue; // Use originalValue as the resolved/baseline\n const deltaResult = computeResourceDelta(undefined, resolvedValue, editedValue);\n\n if (deltaResult.isFailure()) {\n o11y.user.warn(`Could not compute delta, saving full value: ${deltaResult.message}`);\n }\n\n const delta = deltaResult.isSuccess() ? deltaResult.value : null;\n\n // Save the edit with original, edited, and delta\n setEditedResourcesInternal((prev) => {\n const newMap = new Map(prev);\n newMap.set(resourceId, {\n originalValue: resolvedValue,\n editedValue,\n delta\n });\n return newMap;\n });\n\n // Log info about delta\n if (delta !== null && delta !== editedValue) {\n const deltaSize = JSON.stringify(delta).length;\n const fullSize = JSON.stringify(editedValue).length;\n const reduction = Math.round((1 - deltaSize / fullSize) * 100);\n o11y.user.success(`Edit saved for ${resourceId} (delta: ${reduction}% smaller)`);\n } else {\n o11y.user.success(`Edit saved for resource ${resourceId}`);\n }\n\n return succeed(undefined);\n } catch (error) {\n const errorMessage = `Failed to save edit: ${error instanceof Error ? error.message : String(error)}`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [o11y, pendingResources, selectedResourceId, effectiveContext, processedResources]\n );\n\n const getEditedValue = useCallback(\n (resourceId: string) => {\n // Check pending resource edits first\n const pendingEdit = pendingResourceEdits.get(resourceId);\n if (pendingEdit) {\n return pendingEdit.editedValue;\n }\n\n // Check existing resource edits\n const existingEdit = editedResourcesInternal.get(resourceId);\n if (existingEdit) {\n return existingEdit.editedValue;\n }\n\n // Fall back to original pending resource value if no edits\n const pendingResource = pendingResources.get(resourceId);\n if (pendingResource) {\n return pendingResource.candidates?.[0]?.json;\n }\n\n return undefined;\n },\n [pendingResourceEdits, editedResourcesInternal, pendingResources]\n );\n\n const hasEdit = useCallback(\n (resourceId: string) => {\n // Check if there are pending resource edits\n if (pendingResourceEdits.has(resourceId)) {\n return true;\n }\n\n // Check if there are existing resource edits\n if (editedResourcesInternal.has(resourceId)) {\n return true;\n }\n\n // No edits found\n return false;\n },\n [pendingResourceEdits, editedResourcesInternal]\n );\n\n const clearEdits = useCallback((): Result<{ clearedCount: number }> => {\n try {\n const existingResourceEditCount = editedResourcesInternal.size;\n const pendingResourceEditCount = pendingResourceEdits.size;\n const totalCount = existingResourceEditCount + pendingResourceEditCount;\n\n // Clear both types of edits\n setEditedResourcesInternal(new Map());\n setPendingResourceEdits(new Map());\n\n const message =\n totalCount > 0\n ? `Cleared ${totalCount} pending edit${\n totalCount === 1 ? '' : 's'\n } (${existingResourceEditCount} existing resource${\n existingResourceEditCount === 1 ? '' : 's'\n }, ${pendingResourceEditCount} pending resource${pendingResourceEditCount === 1 ? '' : 's'})`\n : 'No pending edits to clear';\n\n o11y.diag.info(message);\n return succeed({ clearedCount: totalCount });\n } catch (error) {\n const errorMessage = `Failed to clear edits: ${error instanceof Error ? error.message : String(error)}`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n }, [editedResourcesInternal, pendingResourceEdits, o11y]);\n\n const discardEdits = useCallback((): Result<{ discardedCount: number }> => {\n try {\n const existingResourceEditCount = editedResourcesInternal.size;\n const pendingResourceEditCount = pendingResourceEdits.size;\n const totalCount = existingResourceEditCount + pendingResourceEditCount;\n\n if (!hasUnsavedEdits || totalCount === 0) {\n o11y.diag.info('edits: No unsaved edits to discard');\n return succeed({ discardedCount: 0 });\n }\n\n // Clear both types of edits\n setEditedResourcesInternal(new Map());\n setPendingResourceEdits(new Map());\n\n const message = `Discarded ${totalCount} unsaved edit${\n totalCount === 1 ? '' : 's'\n } (${existingResourceEditCount} existing resource${\n existingResourceEditCount === 1 ? '' : 's'\n }, ${pendingResourceEditCount} pending resource${pendingResourceEditCount === 1 ? '' : 's'})`;\n o11y.diag.info(message);\n return succeed({ discardedCount: totalCount });\n } catch (error) {\n const errorMessage = `Failed to discard edits: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n }, [editedResourcesInternal, pendingResourceEdits, hasUnsavedEdits, o11y]);\n\n // Removed applyEdits in favor of unified applyPendingResources\n\n // Atomic resource creation API\n const createPendingResource = useCallback(\n (params: ICreatePendingResourceParams): Result<void> => {\n try {\n if (!processedResources) {\n return fail('No resource system available');\n }\n\n // Validate resource ID format first (catches empty, null, and invalid formats)\n const resourceIdResult = Validate.toResourceId(params.id);\n if (resourceIdResult.isFailure()) {\n return fail(`Invalid resource ID format '${params.id}': ${resourceIdResult.message}`);\n }\n\n const validatedResourceId = resourceIdResult.value;\n\n // Prevent temporary IDs from being persisted\n if (params.id.startsWith('new-resource-')) {\n return fail(\n `Cannot save resource with temporary ID '${params.id}'. Please provide a final resource ID.`\n );\n }\n\n // Validate resource ID uniqueness\n if (isResourceIdTaken(params.id, processedResources, pendingResources)) {\n return fail(`Resource ID '${params.id}' already exists. Resource IDs must be unique.`);\n }\n\n // Validate resource type exists\n const resourceTypeResult = findResourceType(params.resourceTypeName, availableResourceTypes);\n if (resourceTypeResult.isFailure()) {\n return fail(resourceTypeResult.message);\n }\n const resourceType = resourceTypeResult.value;\n\n // Create conditions from current effective context\n const contextConditionsResult = createContextConditions(\n effectiveContext,\n processedResources?.system.qualifiers\n );\n if (contextConditionsResult.isFailure()) {\n return fail(contextConditionsResult.message);\n }\n const contextConditions = contextConditionsResult.value;\n\n // Prepare initial JSON value - if no json provided, let resource type use its base template\n const initialJson =\n params.json !== undefined\n ? isJsonObject(params.json)\n ? params.json\n : { value: params.json }\n : undefined;\n\n // Create resource template using the new API with conditions and resolver\n // Pass undefined initialJson to allow resource type to provide base template\n const templateResult = resourceType.createTemplate(\n validatedResourceId,\n initialJson,\n contextConditions.length > 0 ? contextConditions : undefined,\n processedResources?.resolver\n );\n if (templateResult.isFailure()) {\n return fail(templateResult.message);\n }\n const looseResourceDecl = templateResult.value;\n\n // Add to pending resources\n setPendingResources((prev) => {\n const newMap = new Map(prev);\n newMap.set(params.id, looseResourceDecl);\n return newMap;\n });\n\n o11y.user.success(`Resource '${params.id}' created and added to pending resources`);\n return succeed(undefined);\n } catch (error) {\n const errorMessage = `Failed to create pending resource: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [processedResources, pendingResources, availableResourceTypes, effectiveContext, o11y]\n );\n\n // Resource creation actions (enhanced with Result pattern return values)\n const startNewResource = useCallback(\n (\n params?: IStartNewResourceParams\n ): Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }> => {\n try {\n // Determine resource type to use\n const targetTypeName = params?.resourceTypeName || params?.defaultTypeName;\n const targetType = targetTypeName\n ? availableResourceTypes.find((t) => t.key === targetTypeName) || availableResourceTypes[0]\n : availableResourceTypes[0];\n\n if (!targetType) {\n const error = 'No resource types available for resource creation';\n o11y.user.error(error);\n const diagnostics = `Available types: ${availableResourceTypes.map((t) => t.key).join(', ')}`;\n return fail(`${error}\\n${diagnostics}`);\n }\n\n // Determine resource ID (pre-seeded or generate temporary)\n const resourceId = params?.id || `new-resource-${Date.now()}`;\n\n // If pre-seeded with an ID, validate it\n if (params?.id) {\n if (isResourceIdTaken(params.id, processedResources, pendingResources)) {\n const error = `Resource ID '${params.id}' already exists. Resource IDs must be unique.`;\n o11y.user.error(error);\n return fail(`${error}\\nUse a different resource ID or let the system generate a temporary one`);\n }\n }\n\n // Stamp conditions from current effective context at creation time\n const contextConditionsResult = createContextConditions(\n effectiveContext,\n processedResources?.system.qualifiers\n );\n if (contextConditionsResult.isFailure()) {\n return fail(contextConditionsResult.message);\n }\n const contextConditions = contextConditionsResult.value;\n\n // Prepare initial JSON value if provided\n const initialJson =\n params?.json !== undefined\n ? isJsonObject(params.json)\n ? params.json\n : { value: params.json }\n : undefined;\n\n // Create template using new API with context conditions and resolver\n // For pre-seeded IDs, use the validated one; for temporary IDs, convert to ResourceId\n if (!Validate.isValidResourceId(resourceId)) {\n return fail(\n `Invalid resource ID '${resourceId}'. Resource IDs must be dot-separated identifiers and cannot be empty.`\n );\n }\n const templateResourceId = resourceId;\n\n const templateResult = targetType.createTemplate(\n templateResourceId,\n initialJson,\n contextConditions.length > 0 ? contextConditions : undefined,\n processedResources?.resolver\n );\n if (templateResult.isFailure()) {\n return fail(templateResult.message);\n }\n const template = templateResult.value;\n\n const draft = {\n resourceId,\n resourceType: targetType.key,\n template,\n isValid: !resourceId.startsWith('new-resource-') && Validate.isValidResourceId(resourceId)\n };\n\n setNewResourceDraft(draft);\n\n const diagnostics = [];\n if (params?.id) diagnostics.push(`Pre-seeded with resource ID '${params.id}'`);\n if (params?.resourceTypeName)\n diagnostics.push(`Pre-seeded with resource type '${params.resourceTypeName}'`);\n if (params?.json) diagnostics.push('Pre-seeded with JSON content');\n if (contextConditions.length > 0)\n diagnostics.push(`Stamped with ${contextConditions.length} context conditions`);\n\n o11y.diag.info(`Started new ${targetType.key} resource: ${resourceId}`);\n return succeed({ draft, diagnostics });\n } catch (error) {\n const errorMessage = `Failed to start new resource: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [availableResourceTypes, o11y, effectiveContext, processedResources, pendingResources]\n );\n\n const updateNewResourceId = useCallback(\n (id: string): Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }> => {\n try {\n if (!newResourceDraft) {\n const error = 'No resource draft in progress. Call startNewResource first.';\n o11y.user.error(error);\n return fail(`${error}\\nUse startNewResource() to begin creating a new resource`);\n }\n\n // Validate ID format\n if (!Validate.isValidResourceId(id)) {\n const error = `Invalid resource ID '${id}'. Resource IDs must be dot-separated identifiers and cannot be empty.`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Check if ID already exists\n const diagnostics = [];\n let isValid = true;\n let validationError: string | undefined;\n\n if (isResourceIdTaken(id, processedResources, pendingResources)) {\n isValid = false;\n validationError = `Resource ID '${id}' already exists. Resource IDs must be unique.`;\n diagnostics.push('ID uniqueness validation failed');\n } else if (id.startsWith('new-resource-')) {\n isValid = false;\n validationError = `Resource ID '${id}' appears to be a temporary ID. Please provide a final resource ID.`;\n } else if (!Validate.isValidResourceId(id)) {\n isValid = false;\n validationError = `Resource ID '${id}' has invalid format. Resource IDs must be dot-separated identifiers.`;\n diagnostics.push('Temporary ID detected - not suitable for saving');\n } else {\n diagnostics.push('ID validation passed');\n }\n\n const updatedDraft = {\n ...newResourceDraft,\n resourceId: id,\n template: {\n ...newResourceDraft.template,\n id\n },\n isValid\n };\n\n setNewResourceDraft(updatedDraft);\n\n if (validationError) {\n o11y.user.warn(validationError);\n return fail(`${validationError}\\n${diagnostics.join('\\n')}`);\n } else {\n o11y.diag.info(`Updated resource ID to: ${id}`);\n return succeed({ draft: updatedDraft, diagnostics });\n }\n } catch (error) {\n const errorMessage = `Failed to update resource ID: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [newResourceDraft, processedResources, pendingResources, o11y]\n );\n\n const selectResourceType = useCallback(\n (typeName: string): Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }> => {\n try {\n if (!newResourceDraft) {\n const error = 'No resource draft in progress. Call startNewResource first.';\n o11y.user.error(error);\n return fail(`${error}\\nUse startNewResource() to begin creating a new resource`);\n }\n\n const typeResult = findResourceType(typeName, availableResourceTypes);\n if (typeResult.isFailure()) {\n return fail(typeResult.message);\n }\n const type = typeResult.value;\n\n // Extract existing JSON content and conditions from current template\n const existingCandidate = newResourceDraft.template.candidates?.[0];\n const existingJson = existingCandidate?.json;\n const existingConditions = existingCandidate?.conditions;\n\n // Create template with new API, preserving existing content and conditions\n if (!Validate.isValidResourceId(newResourceDraft.resourceId)) {\n return fail(\n `${newResourceDraft.resourceId}: Invalid resource ID. Resource IDs must be dot-separated identifiers and cannot be empty.`\n );\n }\n const templateResourceId = newResourceDraft.resourceId;\n\n const templateResult = type.createTemplate(\n templateResourceId,\n existingJson,\n existingConditions,\n processedResources?.resolver\n );\n if (templateResult.isFailure()) {\n return fail(templateResult.message);\n }\n\n const updatedDraft = {\n ...newResourceDraft,\n resourceType: typeName,\n template: templateResult.value\n };\n\n setNewResourceDraft(updatedDraft);\n o11y.diag.info(`Selected resource type: ${typeName}`);\n\n return succeed({\n draft: updatedDraft,\n diagnostics: [`Created ${typeName} template for resource ${newResourceDraft.resourceId}`]\n });\n } catch (error) {\n const errorMessage = `Failed to select resource type: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [newResourceDraft, availableResourceTypes, o11y]\n );\n\n // New public updateNewResourceJson action\n const updateNewResourceJson = useCallback(\n (json: JsonValue): Result<{ draft: IResolutionState['newResourceDraft']; diagnostics: string[] }> => {\n try {\n if (!newResourceDraft) {\n const error = 'No resource draft in progress. Call startNewResource first.';\n o11y.user.error(error);\n return fail(`${error}\\nUse startNewResource() to begin creating a new resource`);\n }\n\n // Validate JSON content using proper validation\n if (json === undefined || json === null) {\n const error = 'JSON content cannot be null or undefined';\n o11y.user.error(error);\n return fail(error);\n }\n\n // Validate that the JSON content is a valid structure\n try {\n // Ensure the JSON can be serialized and is valid\n JSON.stringify(json);\n } catch (jsonError) {\n const error = `Invalid JSON content: ${\n jsonError instanceof Error ? jsonError.message : String(jsonError)\n }`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Update the template with new JSON content\n const updatedTemplate = {\n ...newResourceDraft.template,\n candidates: [\n {\n json: (isJsonObject(json) ? json : { value: json }) as ResourceJsonObject,\n // Preserve existing conditions if any\n conditions: newResourceDraft.template.candidates?.[0]?.conditions,\n isPartial: false,\n mergeMethod: 'replace' as const\n }\n ]\n };\n\n const updatedDraft = {\n ...newResourceDraft,\n template: updatedTemplate\n };\n\n setNewResourceDraft(updatedDraft);\n o11y.diag.info(`Updated JSON content for resource ${newResourceDraft.resourceId}`);\n\n return succeed({\n draft: updatedDraft,\n diagnostics: ['JSON content updated successfully', 'Resource is ready for saving as pending']\n });\n } catch (error) {\n const errorMessage = `Failed to update resource JSON: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [newResourceDraft, o11y]\n );\n\n const saveNewResourceAsPending = useCallback((): Result<{\n pendingResources: Map<string, ResourceJson.Json.ILooseResourceDecl>;\n diagnostics: string[];\n }> => {\n try {\n // Enhanced validation with specific error messages\n if (!newResourceDraft) {\n const error = 'No resource draft in progress. Call startNewResource first.';\n o11y.user.error(error);\n return fail(`${error}\\nUse startNewResource() to begin creating a new resource`);\n }\n\n if (!newResourceDraft.isValid) {\n const errors = [];\n if (newResourceDraft.resourceId.startsWith('new-resource-')) {\n errors.push('Resource ID is temporary - please set a final resource ID');\n } else if (!Validate.isValidResourceId(newResourceDraft.resourceId)) {\n errors.push('Resource ID has invalid format - must be dot-separated identifiers');\n }\n if (!newResourceDraft.resourceType) {\n errors.push('Resource type is not selected');\n }\n if (!newResourceDraft.template.candidates || newResourceDraft.template.candidates.length === 0) {\n errors.push('Resource template has no candidates');\n }\n\n const error = `Cannot save resource with validation errors: ${errors.join(', ')}`;\n o11y.user.error(error);\n return fail(`${error}\\n${errors.join('\\n')}`);\n }\n\n // Prevent temporary IDs from being persisted (additional safety check)\n if (\n newResourceDraft.resourceId.startsWith('new-resource-') ||\n !Validate.isValidResourceId(newResourceDraft.resourceId)\n ) {\n const error = newResourceDraft.resourceId.startsWith('new-resource-')\n ? `Cannot save resource with temporary ID '${newResourceDraft.resourceId}'. Please set a final resource ID first.`\n : `Cannot save resource with invalid ID '${newResourceDraft.resourceId}'. Resource IDs must be dot-separated identifiers.`;\n o11y.user.error(error);\n return fail(`${error}\\nUse updateNewResourceId() to set a final resource ID before saving`);\n }\n\n // Check resource type exists\n if (!newResourceDraft.resourceType) {\n const error = `Resource type is required`;\n o11y.user.error(error);\n return fail(error);\n }\n\n const resourceTypeResult = findResourceType(newResourceDraft.resourceType, availableResourceTypes);\n if (resourceTypeResult.isFailure()) {\n return fail(resourceTypeResult.message);\n }\n\n // Check candidates exist\n if (!newResourceDraft.template.candidates || newResourceDraft.template.candidates.length === 0) {\n const error = 'Resource template must have at least one candidate';\n o11y.user.error(error);\n return fail(`${error}\\nUse updateNewResourceJson() to add JSON content to the resource`);\n }\n\n let updatedPendingResources: Map<string, ResourceJson.Json.ILooseResourceDecl>;\n\n setPendingResources((prev) => {\n const newMap = new Map(prev);\n // Stamp conditions from current effective context onto all candidates for the new resource\n const contextConditionsResult = createContextConditions(\n effectiveContext,\n processedResources?.system.qualifiers\n );\n if (contextConditionsResult.isFailure()) {\n o11y.diag.warn(`Failed to create context conditions: ${contextConditionsResult.message}`);\n return prev; // Return previous state if validation fails\n }\n const contextConditions = contextConditionsResult.value;\n\n const stampedTemplate: ResourceJson.Json.ILooseResourceDecl = {\n ...newResourceDraft.template,\n candidates: (newResourceDraft.template.candidates || []).map((c) => ({\n ...c,\n conditions: contextConditions.length > 0 ? contextConditions : c.conditions\n }))\n };\n\n newMap.set(newResourceDraft.resourceId, stampedTemplate);\n updatedPendingResources = newMap;\n return newMap;\n });\n\n setNewResourceDraft(undefined);\n\n const diagnostics = [];\n if (effectiveContext && Object.keys(effectiveContext).length > 0) {\n const contextKeys = Object.keys(effectiveContext).filter((k) => effectiveContext[k] !== undefined);\n if (contextKeys.length > 0) {\n diagnostics.push(`Stamped with context: ${contextKeys.join(', ')}`);\n }\n }\n diagnostics.push('Resource draft cleared');\n\n o11y.user.success(`${newResourceDraft.resourceId}: Resource added to pending resources`);\n\n return succeed({\n pendingResources: updatedPendingResources!,\n diagnostics\n });\n } catch (error) {\n const errorMessage = `Failed to save resource as pending: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n }, [newResourceDraft, o11y, effectiveContext, availableResourceTypes]);\n\n const cancelNewResource = useCallback(() => {\n setNewResourceDraft(undefined);\n }, []);\n\n const removePendingResource = useCallback(\n (resourceId: string): Result<void> => {\n try {\n // Validate resource ID using proper ts-res validator\n const resourceIdResult = Validate.toResourceId(resourceId);\n if (resourceIdResult.isFailure()) {\n const error = `Invalid resource ID: ${resourceIdResult.message}`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Check if the pending resource exists\n if (!pendingResources.has(resourceId)) {\n const error = `Pending resource '${resourceId}' not found`;\n o11y.user.warn(error);\n return fail(error);\n }\n\n // Remove the pending resource\n setPendingResources((prev) => {\n const newMap = new Map(prev);\n newMap.delete(resourceId);\n return newMap;\n });\n\n // Also remove any edits for this pending resource\n setPendingResourceEdits((prev) => {\n const newMap = new Map(prev);\n newMap.delete(resourceId);\n return newMap;\n });\n\n // Clear selection if this resource was selected\n if (selectedResourceId === resourceId) {\n setSelectedResourceId(null);\n setResolutionResult(null);\n }\n\n o11y.diag.info(`Removed pending resource: ${resourceId}`);\n return succeed(undefined);\n } catch (error) {\n const errorMessage = `Failed to remove pending resource '${resourceId}': ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n }\n },\n [pendingResources, selectedResourceId, o11y]\n );\n\n const markResourceForDeletion = useCallback(\n (resourceId: string) => {\n setPendingResourceDeletions((prev) => {\n const newSet = new Set(prev);\n newSet.add(resourceId);\n return newSet;\n });\n o11y.user.info(`${resourceId}: Marked resource for deletion`);\n },\n [o11y]\n );\n\n const applyPendingResources = useCallback(async (): Promise<\n Result<{\n appliedCount: number;\n existingResourceEditCount: number;\n pendingResourceEditCount: number;\n newResourceCount: number;\n deletionCount: number;\n }>\n > => {\n const hasAnyChanges =\n editedResourcesInternal.size > 0 ||\n pendingResourceEdits.size > 0 ||\n pendingResources.size > 0 ||\n pendingResourceDeletions.size > 0;\n\n if (!hasAnyChanges) {\n const error = 'No pending changes to apply';\n o11y.user.warn(error);\n return fail(error);\n }\n\n if (!processedResources) {\n const error = 'No resource system available';\n o11y.user.error(error);\n return fail(error);\n }\n\n if (!onSystemUpdate) {\n const error = 'No system update handler provided';\n o11y.user.error(error);\n return fail(error);\n }\n\n try {\n setIsApplyingEdits(true);\n // Extract current resolution context (filter out undefined values)\n const cleanedContextValues: Record<string, string> = {};\n Object.entries(effectiveContext).forEach(([key, value]) => {\n if (value !== undefined) {\n cleanedContextValues[key] = value as string;\n }\n });\n\n // Ensure we have a resolver instance to extract context\n let resolverForContext = currentResolver;\n if (!resolverForContext) {\n const resolverCreateResult = Runtime.ResourceResolver.create({\n resourceManager: processedResources.system.resourceManager,\n qualifierTypes: processedResources.system.qualifierTypes,\n contextQualifierProvider: processedResources.system.contextQualifierProvider\n });\n if (resolverCreateResult.isFailure()) {\n const error = `Failed to create resolver: ${resolverCreateResult.message}`;\n o11y.user.error(error);\n return fail(error);\n }\n resolverForContext = resolverCreateResult.value;\n }\n\n const currentContext = extractResolutionContext(resolverForContext, cleanedContextValues);\n\n // Convert pending new resources (map → array) and apply any edits to them\n const newResourcesArray: ResourceJson.Json.ILooseResourceDecl[] = [];\n for (const [resourceId, resource] of pendingResources.entries()) {\n const pendingEdit = pendingResourceEdits.get(resourceId);\n if (pendingEdit) {\n // Apply the edit to the pending resource\n const updatedResource = {\n ...resource,\n candidates: [\n {\n json: (isJsonObject(pendingEdit.editedValue)\n ? pendingEdit.editedValue\n : { value: pendingEdit.editedValue }) as ResourceJsonObject,\n conditions: resource.candidates?.[0]?.conditions,\n isPartial: false,\n mergeMethod: 'replace' as const\n }\n ]\n };\n newResourcesArray.push(updatedResource);\n } else {\n newResourcesArray.push(resource);\n }\n }\n\n // Rebuild system with both edits and new resources in one pass\n const rebuildResult = await rebuildSystemWithChanges(\n processedResources.system,\n {\n editedResources: editedResourcesInternal,\n newResources: newResourcesArray\n },\n currentContext\n );\n\n if (rebuildResult.isFailure()) {\n const error = `Failed to apply changes: ${rebuildResult.message}`;\n o11y.user.error(error);\n return fail(error);\n }\n\n // Capture counts before clearing the state\n const existingResourceEditCount = editedResourcesInternal.size;\n const pendingResourceEditCount = pendingResourceEdits.size;\n const newResourceCount = newResourcesArray.length;\n const deletionCount = pendingResourceDeletions.size;\n const appliedCount =\n existingResourceEditCount + pendingResourceEditCount + newResourceCount + deletionCount;\n\n onSystemUpdate(rebuildResult.value);\n\n o11y.user.success(\n `Applied ${existingResourceEditCount} existing resource edits, ${pendingResourceEditCount} pending resource edits, ${newResourceCount} additions, and ${deletionCount} deletions`\n );\n\n // Clear pending additions and edits after successful application\n setPendingResources(new Map());\n setPendingResourceEdits(new Map());\n setPendingResourceDeletions(new Set());\n setEditedResourcesInternal(new Map());\n\n return succeed({\n appliedCount,\n existingResourceEditCount,\n pendingResourceEditCount,\n newResourceCount,\n deletionCount\n });\n } catch (error) {\n const errorMessage = `Failed to apply pending resources: ${\n error instanceof Error ? error.message : String(error)\n }`;\n o11y.user.error(errorMessage);\n return fail(errorMessage);\n } finally {\n setIsApplyingEdits(false);\n }\n }, [\n pendingResources,\n pendingResourceEdits,\n pendingResourceDeletions,\n processedResources,\n onSystemUpdate,\n o11y,\n effectiveContext,\n currentResolver,\n editedResourcesInternal\n ]);\n\n const discardPendingResources = useCallback(() => {\n if (hasPendingResourceChanges || pendingResourceEdits.size > 0) {\n setPendingResources(new Map());\n setPendingResourceEdits(new Map());\n setPendingResourceDeletions(new Set());\n o11y.user.info('Discarded all pending resource changes and edits');\n }\n }, [hasPendingResourceChanges, pendingResourceEdits, o11y]);\n\n const state: IResolutionState = {\n contextValues: effectiveContext, // Effective context (user + host)\n pendingContextValues: pendingUserValues, // Only user's pending values\n selectedResourceId,\n currentResolver,\n resolutionResult,\n viewMode,\n hasPendingChanges,\n // Edit state\n editedResources,\n hasUnsavedEdits,\n isApplyingEdits,\n // Pending resource state\n pendingResources,\n pendingResourceDeletions,\n newResourceDraft,\n availableResourceTypes,\n hasPendingResourceChanges\n };\n\n const actions: IResolutionActions = useMemo(\n () => ({\n updateContextValue,\n applyContext,\n selectResource,\n setViewMode,\n resetCache,\n // Edit actions\n saveEdit,\n getEditedValue,\n hasEdit,\n clearEdits,\n discardEdits,\n // Enhanced resource creation actions\n createPendingResource,\n startNewResource,\n updateNewResourceId,\n selectResourceType,\n updateNewResourceJson,\n saveNewResourceAsPending,\n cancelNewResource,\n removePendingResource,\n markResourceForDeletion,\n applyPendingResources,\n discardPendingResources\n }),\n [\n updateContextValue,\n applyContext,\n selectResource,\n setViewMode,\n resetCache,\n saveEdit,\n getEditedValue,\n hasEdit,\n clearEdits,\n discardEdits,\n createPendingResource,\n startNewResource,\n updateNewResourceId,\n selectResourceType,\n updateNewResourceJson,\n saveNewResourceAsPending,\n cancelNewResource,\n removePendingResource,\n markResourceForDeletion,\n applyPendingResources,\n discardPendingResources\n ]\n );\n\n return {\n state,\n actions,\n availableQualifiers\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResourceData.d.ts","sourceRoot":"","sources":["../../src/hooks/useResourceData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAA6B,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAA+B,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9G,OAAO,EAAE,MAAM,EAAE,MAAM,EAA8B,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,EAAE,QAAQ,EAA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YAC1D,iBAAiB;YACjB,UAAU;YACV,KAAK;YACL,eAAe;YACf,kBAAkB;YAClB,wBAAwB;SACzB;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useCallback } from 'react';\nimport { Result, succeed, fail, mapResults } from '@fgv/ts-utils';\nimport { IResourceManagerState, IProcessedResources, IExtendedProcessedResources, JsonValue } from '../types';\nimport { Converters } from '@fgv/ts-json-base';\nimport { Config, Bundle, Runtime, Resources, Import, QualifierTypes, ResourceTypes } from '@fgv/ts-res';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { processFileTree } from '../utils/tsResIntegration';\nimport { createResolverWithContext, resolveResourceDetailed } from '../utils/resolutionUtils';\nimport * as ObservabilityTools from '../utils/observability';\n\n/**\n * Parameters for the useResourceData hook.\n * Allows customization of type factories for extended functionality.\n *\n * @public\n */\nexport interface IUseResourceDataParams {\n /** Optional qualifier type factory for creating custom qualifier types */\n qualifierTypeFactory?: Config.IConfigInitFactory<\n QualifierTypes.Config.IAnyQualifierTypeConfig,\n QualifierTypes.QualifierType\n >;\n /** Optional resource type factory for creating custom resource types */\n resourceTypeFactory?: Config.IConfigInitFactory<\n ResourceTypes.Config.IResourceTypeConfig,\n ResourceTypes.ResourceType\n >;\n /** Optional observability context for logging */\n o11y?: ObservabilityTools.IObservabilityContext;\n}\n\n/**\n * Return type for the useResourceData hook.\n * Provides state and actions for managing ts-res data processing.\n *\n * @public\n */\nexport interface IUseResourceDataReturn {\n /** Current state of the resource management system */\n state: IResourceManagerState;\n /** Available actions for processing and managing resources */\n actions: {\n /** Process a FileTree into a resource system */\n processFileTree: (fileTree: FileTree.FileTree) => Promise<Result<void>>;\n /** Process a FileTree with an explicit configuration */\n processFileTreeWithConfig: (\n fileTree: FileTree.FileTree,\n config: Config.Model.ISystemConfiguration\n ) => Promise<Result<void>>;\n /** Process a pre-compiled bundle file */\n processBundleFile: (bundle: Bundle.IBundle) => Promise<void>;\n /** Clear any current error state */\n clearError: () => void;\n /** Reset the entire resource management state */\n reset: () => void;\n /** Resolve a specific resource with optional context */\n resolveResource: (resourceId: string, context?: Record<string, string>) => Result<JsonValue>;\n /** Apply a new configuration to the current system */\n applyConfiguration: (config: Config.Model.ISystemConfiguration) => void;\n /** Update the processed resources state directly */\n updateProcessedResources: (processedResources: IProcessedResources) => void;\n };\n}\n\nconst initialState: IResourceManagerState = {\n isProcessing: false,\n processedResources: null,\n error: null,\n hasProcessedData: false,\n activeConfiguration: null,\n isLoadedFromBundle: false,\n bundleMetadata: null\n};\n\n/**\n * React hook for managing ts-res resource data processing and state.\n *\n * Provides comprehensive functionality for:\n * - Importing and processing resource files and directories\n * - Loading and processing pre-compiled bundles\n * - Resource resolution with context\n * - Configuration management\n * - Error handling and state management\n *\n * @returns Object containing current state and available actions\n *\n * @example\n * ```typescript\n * const { state, actions } = useResourceData();\n *\n * // Process a FileTree\n * await actions.processFileTree(fileTree);\n *\n * // Resolve a resource with context\n * const result = await actions.resolveResource('my.resource', {\n * language: 'en-US',\n * environment: 'production'\n * });\n *\n * // Check processing state\n * if (state.isProcessing) {\n * // Show loading UI\n * } else if (state.error) {\n * // Show error message\n * } else if (state.processedResources) {\n * // Use processed resources\n * }\n * ```\n *\n * @public\n */\nexport function useResourceData(params?: IUseResourceDataParams): IUseResourceDataReturn {\n const [state, setState] = useState<IResourceManagerState>(initialState);\n const o11y = params?.o11y ?? ObservabilityTools.DefaultObservabilityContext;\n\n const processFileTreeAction = useCallback(\n async (fileTree: FileTree.FileTree): Promise<Result<void>> => {\n setState((prev) => ({ ...prev, isProcessing: true, error: null }));\n\n try {\n return processFileTree({\n fileTree,\n systemConfig: state.activeConfiguration || undefined,\n qualifierTypeFactory: params?.qualifierTypeFactory,\n resourceTypeFactory: params?.resourceTypeFactory,\n o11y\n })\n .onSuccess((value) => {\n o11y.diag.info(\n `[useResourceData] FileTree processing succeeded, resources found: ${\n value.summary?.totalResources || 0\n }`\n );\n o11y.diag.info(\n `[useResourceData] Resource IDs: ${JSON.stringify(value.summary?.resourceIds || [])}`\n );\n\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n processedResources: value,\n hasProcessedData: true,\n isLoadedFromBundle: false,\n bundleMetadata: null\n }));\n o11y.diag.info(\n `[useResourceData] State updated with ${value.summary?.totalResources || 0} resources`\n );\n return succeed(undefined);\n })\n .onFailure((errorMessage) => {\n o11y.diag.error(`[useResourceData] FileTree processing failed: ${errorMessage}`);\n o11y.user.error(`FileTree import failed: ${errorMessage}`);\n\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: errorMessage\n }));\n return fail(errorMessage);\n });\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n o11y.diag.error(`[useResourceData] Exception during FileTree processing: ${errorMessage}`);\n o11y.user.error(`FileTree import failed: ${errorMessage}`);\n\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: errorMessage\n }));\n return fail(errorMessage);\n }\n },\n [state.activeConfiguration, params?.qualifierTypeFactory, params?.resourceTypeFactory, o11y]\n );\n\n const processFileTreeWithConfigAction = useCallback(\n async (fileTree: FileTree.FileTree, config: Config.Model.ISystemConfiguration): Promise<Result<void>> => {\n setState((prev) => ({ ...prev, isProcessing: true, error: null, activeConfiguration: config }));\n\n try {\n return processFileTree({\n fileTree,\n systemConfig: config,\n qualifierTypeFactory: params?.qualifierTypeFactory,\n resourceTypeFactory: params?.resourceTypeFactory,\n o11y\n })\n .onSuccess((value) => {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n processedResources: value,\n hasProcessedData: true,\n isLoadedFromBundle: false,\n bundleMetadata: null,\n activeConfiguration: config\n }));\n return succeed(undefined);\n })\n .onFailure((errorMessage) => {\n o11y.user.error(`FileTree import with config failed: ${errorMessage}`);\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: errorMessage\n }));\n return fail(errorMessage);\n });\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n o11y.user.error(`FileTree import with config failed: ${errorMessage}`);\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: errorMessage\n }));\n return fail(errorMessage);\n }\n },\n [params?.qualifierTypeFactory, params?.resourceTypeFactory, o11y]\n );\n\n const processBundleFile = useCallback(\n async (bundle: Bundle.IBundle) => {\n o11y.diag.info('[Bundle Processing] Starting bundle processing...', bundle);\n setState((prev) => ({ ...prev, isProcessing: true, error: null }));\n\n try {\n o11y.diag.info('[Bundle Processing] Attempting to extract bundle components...');\n\n // Extract bundle components (configuration and compiled collection)\n const { systemConfiguration, compiledCollection, metadata } =\n Bundle.BundleUtils.extractBundleComponents(bundle).orThrow(\n (msg) => `Failed to extract bundle components: ${msg}`\n );\n\n o11y.diag.info('[Bundle Processing] Extracted components:', {\n hasSystemConfiguration: !!systemConfiguration,\n hasCompiledCollection: !!compiledCollection,\n hasMetadata: !!metadata,\n systemConfiguration: systemConfiguration\n });\n\n // Use BundleLoader to create a fully functional resource manager from the bundle\n o11y.diag.info('[Bundle Processing] Using BundleLoader to create resource manager from bundle');\n\n // The bundle's IResourceManager contains all the resources and candidates\n // We'll use it directly for both UI and resolution\n const bundleResourceManager = Bundle.BundleLoader.createManagerFromBundle({\n bundle: bundle,\n skipChecksumVerification: true // Skip for now since we're in a browser environment\n }).orThrow((msg) => `Failed to create resource manager from bundle: ${msg}`);\n\n // Debug: Check what resources are in the original bundle manager\n o11y.diag.info('[Bundle Processing] Original bundle manager resources:', {\n numResources: bundleResourceManager.numResources,\n numCandidates: bundleResourceManager.numCandidates,\n resourceIds: Array.from(bundleResourceManager.builtResources.keys())\n });\n\n // Convert the compiled collection to an editable ResourceManagerBuilder\n // using createFromCompiledResourceCollection for exact reconstruction\n const editableResourceManager = Resources.ResourceManagerBuilder.createFromCompiledResourceCollection(\n compiledCollection,\n systemConfiguration\n ).orThrow((msg) => `Failed to reconstruct builder from compiled collection: ${msg}`);\n\n o11y.diag.info('[Bundle Processing] Normalized builder resources:', {\n numResources: editableResourceManager.resources.size,\n numCandidates: Array.from(editableResourceManager.getAllCandidates()).length,\n resourceIds: Array.from(editableResourceManager.resources.keys())\n });\n\n // Create the system using the normalized, editable resource manager\n const system = {\n qualifierTypes: systemConfiguration.qualifierTypes,\n qualifiers: systemConfiguration.qualifiers,\n resourceTypes: systemConfiguration.resourceTypes,\n resourceManager: editableResourceManager, // Now editable ResourceManagerBuilder\n importManager: Import.ImportManager.create({\n resources: Resources.ResourceManagerBuilder.create({\n qualifiers: systemConfiguration.qualifiers,\n resourceTypes: systemConfiguration.resourceTypes\n }).orThrow(),\n fileTree: FileTree.inMemory([]).orThrow()\n }).orThrow(),\n contextQualifierProvider: Runtime.Context.ValidatingSimpleContextQualifierProvider.create({\n qualifiers: systemConfiguration.qualifiers\n }).orThrow()\n };\n\n // Extract configuration for UI display using the new getConfigurationJson method\n const allQualifierTypes = mapResults(\n Array.from(system.qualifierTypes.values()).map((qt) =>\n qt\n .getConfigurationJson()\n .onSuccess((jsonConfig) =>\n QualifierTypes.Config.Convert.anyQualifierTypeConfig.convert(jsonConfig)\n )\n )\n ).orThrow((msg) => `Failed to extract qualifier type configurations: ${msg}`);\n\n const systemQualifierTypes = allQualifierTypes.filter(\n QualifierTypes.Config.isSystemQualifierTypeConfig\n );\n\n const configForStorage: Config.Model.ISystemConfiguration = {\n name: 'Bundle Configuration',\n description: metadata?.description || 'Configuration extracted from bundle',\n qualifierTypes: systemQualifierTypes as QualifierTypes.Config.ISystemQualifierTypeConfig[],\n qualifiers: Array.from(system.qualifiers.values()).map((q) => {\n o11y.diag.info('[Bundle Processing] Extracting qualifier:', q);\n // Instantiated Qualifier objects have .type property which is a QualifierType object\n const typeName = q.type.name;\n if (!typeName) {\n o11y.diag.error('[Bundle Processing] Missing typeName for qualifier:', q);\n }\n return {\n name: q.name,\n typeName,\n token: q.token,\n defaultPriority: q.defaultPriority,\n tokenIsOptional: q.tokenIsOptional,\n ...(q.defaultValue !== undefined ? { defaultValue: q.defaultValue } : {})\n };\n }),\n resourceTypes: Array.from(system.resourceTypes.values()).map((rt, index: number) => {\n o11y.diag.info('[Bundle Processing] Extracting resource type:', rt);\n // ResourceTypes in bundles might not have a name property\n // Default to 'json' for JsonResourceType\n return {\n name: rt.key,\n typeName: rt.systemTypeName\n };\n })\n };\n\n o11y.diag.info('[Bundle Processing] Extracted configuration for UI:', configForStorage);\n\n // Extract resource IDs from the loaded resource manager\n const resourceIds: string[] = [];\n let resourceCount = 0;\n\n // The resource manager is now fully loaded with all bundle resources\n // Extract resource IDs from the compiled collection for tracking\n if (compiledCollection.resources) {\n for (const resource of compiledCollection.resources) {\n const resourceId = resource.id || `resource-${resourceCount}`;\n resourceIds.push(resourceId);\n resourceCount++;\n }\n }\n\n o11y.diag.info(`Bundle loaded with ${resourceCount} resources (with candidates):`, resourceIds);\n\n // Create a resolver using the bundle's resource manager\n const resolver = Runtime.ResourceResolver.create({\n resourceManager: system.resourceManager,\n qualifierTypes: system.qualifierTypes,\n contextQualifierProvider: system.contextQualifierProvider\n }).orThrow((msg) => `Failed to create resolver: ${msg}`);\n\n // No longer create a separate CompiledResourceCollection manager\n // We'll derive the compiled collection from ResourceManagerBuilder when needed\n\n // Create the processed resources structure with bundle data\n const processedResources: IProcessedResources = {\n system: {\n qualifierTypes: system.qualifierTypes,\n qualifiers: system.qualifiers,\n resourceTypes: system.resourceTypes,\n resourceManager: system.resourceManager,\n importManager: system.importManager,\n contextQualifierProvider: system.contextQualifierProvider\n },\n compiledCollection,\n resolver,\n resourceCount,\n summary: {\n totalResources: resourceCount,\n resourceIds,\n errorCount: 0,\n warnings: [`Bundle loaded with ${resourceCount} resources from compiled collection`]\n }\n };\n\n o11y.diag.info('[Bundle Processing] Setting final state...', {\n resourceCount,\n resourceIds,\n configForStorage,\n hasProcessedResources: !!processedResources\n });\n\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n processedResources,\n hasProcessedData: true,\n error: null,\n activeConfiguration: configForStorage,\n isLoadedFromBundle: true,\n bundleMetadata: metadata\n }));\n\n o11y.diag.info('[Bundle Processing] Bundle processing completed successfully!');\n } catch (error) {\n setState((prev) => ({\n ...prev,\n isProcessing: false,\n error: error instanceof Error ? error.message : String(error)\n }));\n }\n },\n [o11y]\n );\n\n const clearError = useCallback(() => {\n setState((prev) => ({ ...prev, error: null }));\n }, []);\n\n const reset = useCallback(() => {\n setState(initialState);\n }, []);\n\n const resolveResource = useCallback(\n (resourceId: string, context?: Record<string, string>): Result<JsonValue> => {\n if (!state.processedResources?.system?.resourceManager) {\n return fail('No resources loaded');\n }\n\n try {\n // Use provided context or empty context\n const contextValues = context || {};\n\n return state.processedResources.system.resourceManager\n .getBuiltResource(resourceId)\n .onFailure(() => fail(`Resource not found: ${resourceId}`))\n .onSuccess(() =>\n createResolverWithContext(state.processedResources!, contextValues, {\n enableDebugLogging: false\n }).withErrorFormat((msg) => `Failed to create resolver: ${msg}`)\n )\n .onSuccess((resolver) =>\n resolveResourceDetailed(resolver, resourceId, state.processedResources!, {\n enableDebugLogging: false\n }).withErrorFormat((msg) => `Failed to resolve resource details: ${msg}`)\n )\n .onSuccess((resolutionResult) => {\n // Return the detailed resolution result as JsonValue\n const detailedJson = {\n success: resolutionResult.success,\n resourceId: resolutionResult.resourceId,\n resource: resolutionResult.resource\n ? {\n id: resolutionResult.resource.id,\n resourceType: resolutionResult.resource.resourceType?.key || 'unknown',\n candidateCount: resolutionResult.resource.candidates.length\n }\n : null,\n bestCandidate: resolutionResult.bestCandidate?.json,\n allCandidates: resolutionResult.allCandidates?.map((c) => c.json),\n candidateDetails: resolutionResult.candidateDetails?.map((cd) => ({\n candidateIndex: cd.candidateIndex,\n matched: cd.matched,\n matchType: cd.matchType,\n isDefaultMatch: cd.isDefaultMatch,\n conditionEvaluations: cd.conditionEvaluations,\n candidateJson: cd.candidate?.json\n })),\n composedValue: resolutionResult.composedValue,\n error: resolutionResult.error\n };\n\n // Convert to JsonValue using proper converter\n return Converters.jsonValue.convert(detailedJson);\n });\n } catch (error) {\n return fail(`Failed to resolve resource: ${error instanceof Error ? error.message : String(error)}`);\n }\n },\n [state.processedResources]\n );\n\n const applyConfiguration = useCallback((config: Config.Model.ISystemConfiguration) => {\n setState((prev) => ({ ...prev, activeConfiguration: config }));\n }, []);\n\n const updateProcessedResources = useCallback((processedResources: IProcessedResources) => {\n setState((prev) => {\n const incomingExtended = processedResources as IExtendedProcessedResources;\n const existingExtended = prev.processedResources;\n\n // Build the extended properties object, only including defined values\n const extendedProps: Partial<IExtendedProcessedResources> = {};\n\n // Handle activeConfiguration - prefer incoming, then existing, then leave undefined\n const activeConfig = incomingExtended.activeConfiguration ?? existingExtended?.activeConfiguration;\n if (activeConfig !== undefined) {\n extendedProps.activeConfiguration = activeConfig;\n }\n\n // Handle isLoadedFromBundle - prefer incoming, then existing, then leave undefined\n const isLoaded = incomingExtended.isLoadedFromBundle ?? existingExtended?.isLoadedFromBundle;\n if (isLoaded !== undefined) {\n extendedProps.isLoadedFromBundle = isLoaded;\n }\n\n // Handle bundleMetadata - prefer incoming, then existing, then leave undefined\n const bundleMeta = incomingExtended.bundleMetadata ?? existingExtended?.bundleMetadata;\n if (bundleMeta !== undefined) {\n extendedProps.bundleMetadata = bundleMeta;\n }\n\n return {\n ...prev,\n processedResources: {\n // Start with the new processedResources (core data)\n ...processedResources,\n // Then add any extended properties that have values\n ...extendedProps\n },\n hasProcessedData: true\n };\n });\n }, []);\n\n return {\n state,\n actions: {\n processFileTree: processFileTreeAction,\n processFileTreeWithConfig: processFileTreeWithConfigAction,\n processBundleFile,\n clearError,\n reset,\n resolveResource,\n applyConfiguration,\n updateProcessedResources\n }\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSmartObservability.d.ts","sourceRoot":"","sources":["../../src/hooks/useSmartObservability.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,IAAI,qBAAqB,CA0F7D;AAED;;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MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,MAAM,WAAW,GAAG,8BAA8B,CAAC,eAAe,CAAC,CAAC;QACpE,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,WAAW,GAAG,WAAW,KAAK,SAAS,IAAI,YAAY,CAAC;QAE9D,OAAO;YACL,WAAW;YACX,YAAY;YACZ,WAAW;YACX,oBAAoB,EAAE,oBAAoB,CAAC,YAAY,CAAC;YACxD,aAAa,EAAE,oBAAoB,CAAC,eAAe,CAAC;SACrD,CAAC;IACJ,CAAC,EAAE,CAAC,eAAe,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAE/C,OAAO;QACL,OAAO,EAAE,YAAY;QACrB,SAAS;KACV,CAAC;AACJ,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 { useMemo, useEffect } from 'react';\nimport { useObservability } from '../contexts';\nimport { useViewState } from './useViewState';\nimport {\n detectObservabilityContextType,\n isViewStateConnected,\n isConsoleOnlyContext,\n createViewStateObservabilityContext,\n DefaultObservabilityContext\n} from '../utils/observability';\nimport type { IObservabilityContext, ObservabilityContextType } from '../utils/observability';\n\n/**\n * Smart observability hook that automatically provides the best available observability context.\n *\n * This hook detects the current observability context type and:\n * - Uses ViewState-connected context when available (best experience)\n * - Auto-creates ViewState connection when only console context is available\n * - Preserves custom contexts provided by consumers\n * - Provides helpful warnings for suboptimal configurations\n *\n * @returns The most appropriate observability context for the current component tree\n *\n * @example\n * ```tsx\n * // In a component that needs user feedback in the UI\n * const MyComponent = () => {\n * const o11y = useSmartObservability();\n *\n * const handleAction = () => {\n * o11y.user.success('Action completed successfully!');\n * };\n *\n * return <button onClick={handleAction}>Do Something</button>;\n * };\n * ```\n *\n * @public\n */\nexport function useSmartObservability(): IObservabilityContext {\n const existingContext = useObservability();\n const viewState = useViewState();\n\n const contextType = useMemo(() => detectObservabilityContextType(existingContext), [existingContext]);\n\n const smartContext = useMemo(() => {\n // If no context exists, create a default one\n if (!existingContext) {\n if (viewState) {\n return createViewStateObservabilityContext(viewState.addMessage);\n }\n return DefaultObservabilityContext;\n }\n\n // If context has doNotUpgrade policy, respect it and return as-is\n if (existingContext.policy?.doNotUpgrade) {\n return existingContext;\n }\n\n // If we already have ViewState connection or custom context, use it\n if (contextType === 'viewstate' || contextType === 'custom') {\n return existingContext;\n }\n\n // If we only have console context but ViewState is available, upgrade\n if (contextType === 'console' && viewState) {\n return createViewStateObservabilityContext(viewState.addMessage);\n }\n\n // Fallback to existing context (console-only)\n return existingContext;\n }, [contextType, existingContext, viewState]);\n\n // Provide helpful warnings for suboptimal usage\n useEffect(() => {\n // Skip warnings if context has doNotUpgrade policy (e.g., in tests)\n if (existingContext?.policy?.doNotUpgrade) {\n return;\n }\n\n if (contextType === 'console') {\n if (viewState) {\n // We auto-upgraded to ViewState, inform developer about better patterns\n console.info(\n `\n🔄 Smart Observability: Auto-created ViewState connection\n User feedback will now appear in UI messages window.\n \n For better performance, consider wrapping your component in:\n • ResourceOrchestrator (recommended for full app integration)\n • ObservabilityProvider with ViewState context\n \n Example:\n <ObservabilityProvider observabilityContext={\n ObservabilityTools.createViewStateObservabilityContext(viewState.addMessage)\n }>\n <YourComponent />\n </ObservabilityProvider>\n `.trim()\n );\n } else {\n // No ViewState available, warn about limited functionality\n console.warn(\n `\n⚠️ Smart Observability: Console-only context detected\n User feedback will only appear in browser console.\n \n To show user feedback in UI messages window:\n 1. Use ViewStateTools.useViewState() in a parent component\n 2. Wrap your component tree in ObservabilityProvider with ViewState context\n \n Example:\n const App = () => {\n const viewState = ViewStateTools.useViewState();\n const o11y = ObservabilityTools.createViewStateObservabilityContext(viewState.addMessage);\n \n return (\n <ObservabilityProvider observabilityContext={o11y}>\n <YourComponent />\n </ObservabilityProvider>\n );\n };\n `.trim()\n );\n }\n }\n }, [contextType, viewState, existingContext]);\n\n return smartContext;\n}\n\n/**\n * Hook that provides smart observability context with additional debugging information.\n * Useful for development and troubleshooting observability setup.\n *\n * @returns Object containing the smart context and debug information\n *\n * @example\n * ```tsx\n * const MyDebugComponent = () => {\n * const { context: o11y, debugInfo } = useSmartObservabilityDebug();\n *\n * console.log('Context type:', debugInfo.contextType);\n * console.log('ViewState available:', debugInfo.hasViewState);\n * console.log('Auto-upgraded:', debugInfo.wasUpgraded);\n *\n * return <div>Check console for observability debug info</div>;\n * };\n * ```\n *\n * @public\n */\nexport function useSmartObservabilityDebug(): {\n context: IObservabilityContext;\n debugInfo: {\n contextType: ObservabilityContextType;\n hasViewState: boolean;\n wasUpgraded: boolean;\n isViewStateConnected: boolean;\n isConsoleOnly: boolean;\n };\n} {\n const existingContext = useObservability();\n const viewState = useViewState();\n const smartContext = useSmartObservability();\n\n const debugInfo = useMemo(() => {\n const contextType = detectObservabilityContextType(existingContext);\n const hasViewState = Boolean(viewState);\n const wasUpgraded = contextType === 'console' && hasViewState;\n\n return {\n contextType,\n hasViewState,\n wasUpgraded,\n isViewStateConnected: isViewStateConnected(smartContext),\n isConsoleOnly: isConsoleOnlyContext(existingContext)\n };\n }, [existingContext, viewState, smartContext]);\n\n return {\n context: smartContext,\n debugInfo\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUrlParams.d.ts","sourceRoot":"","sources":["../../src/hooks/useUrlParams.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,YAAY,IAAI;IAC9B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;CACvB,CA2BA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUrlParams.js","sourceRoot":"","sources":["../../src/hooks/useUrlParams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AAE3E;;;GAGG;AACH,MAAM,UAAU,YAAY;IAI1B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAoB,EAAE,CAAC,CAAC;IAClE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACpC,YAAY,CAAC,MAAM,CAAC,CAAC;QAErB,mDAAmD;QACnD,MAAM,SAAS,GAAG,CAAC,CAAC,CAClB,MAAM,CAAC,KAAK;YACZ,MAAM,CAAC,MAAM;YACb,MAAM,CAAC,aAAa;YACpB,MAAM,CAAC,iBAAiB;YACxB,MAAM,CAAC,aAAa;YACpB,MAAM,CAAC,WAAW,KAAK,SAAS;YAChC,MAAM,CAAC,gBAAgB;YACvB,MAAM,CAAC,WAAW,CACnB,CAAC;QAEF,eAAe,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,SAAS;QACT,YAAY;KACb,CAAC;AACJ,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 { useEffect, useState } from 'react';\nimport { parseUrlParameters, IUrlConfigOptions } from '@fgv/ts-web-extras';\n\n/**\n * Hook to parse and provide URL parameters for initial app configuration\n * @public\n */\nexport function useUrlParams(): {\n urlParams: IUrlConfigOptions;\n hasUrlParams: boolean;\n} {\n const [urlParams, setUrlParams] = useState<IUrlConfigOptions>({});\n const [hasUrlParams, setHasUrlParams] = useState(false);\n\n useEffect(() => {\n const params = parseUrlParameters();\n setUrlParams(params);\n\n // Check if any meaningful parameters were provided\n const hasParams = !!(\n params.input ||\n params.config ||\n params.contextFilter ||\n params.qualifierDefaults ||\n params.resourceTypes ||\n params.maxDistance !== undefined ||\n params.reduceQualifiers ||\n params.interactive\n );\n\n setHasUrlParams(hasParams);\n }, []);\n\n return {\n urlParams,\n hasUrlParams\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewState.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,qCAAqC;IACrC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,4CAA4C;IAC5C,UAAU,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,yBAAyB;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,8BAA8B;IAC9B,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,YAAY,IAAI,mBAAmB,CAgClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewState.js","sourceRoot":"","sources":["../../src/hooks/useViewState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAqB9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAa,EAAE,CAAC,CAAC;IAC1D,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAElF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,IAAsB,EAAE,OAAe,EAAE,EAAE;QACzE,MAAM,UAAU,GAAa;YAC3B,EAAE,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;YACxC,IAAI;YACJ,OAAO;YACP,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC;QAEF,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;QAE9C,4DAA4D;IAC9D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,YAAY,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,UAAyB,EAAE,EAAE;QAC/D,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,QAAQ;QACR,kBAAkB;QAClB,UAAU;QACV,aAAa;QACb,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useCallback } from 'react';\nimport { IMessage } from '../types';\n\n/**\n * Return type for the useViewState hook.\n *\n * @public\n */\nexport interface IUseViewStateReturn {\n /** Array of current messages (info, warning, error, success) */\n messages: IMessage[];\n /** Currently selected resource ID */\n selectedResourceId: string | null;\n /** Add a new message to the message list */\n addMessage: (type: IMessage['type'], message: string) => void;\n /** Clear all messages */\n clearMessages: () => void;\n /** Select a resource by ID */\n selectResource: (resourceId: string | null) => void;\n}\n\n/**\n * Hook for managing view state including messages and resource selection.\n *\n * This hook provides a centralized way to manage common view state concerns\n * like user messages (notifications) and resource selection. It's designed\n * to be used by view components that need to display messages and track\n * the currently selected resource.\n *\n * @example\n * ```tsx\n * function MyResourceView() {\n * const {\n * messages,\n * selectedResourceId,\n * addIMessage,\n * clearIMessages,\n * selectResource\n * } = useViewState();\n *\n * const handleOperation = async () => {\n * try {\n * await someAsyncOperation();\n * addIMessage('success', 'Operation completed successfully');\n * } catch (error) {\n * addIMessage('error', `Operation failed: ${error.message}`);\n * }\n * };\n *\n * return (\n * <div>\n * <IMessageDisplay messages={messages} onClear={clearIMessages} />\n * <ResourcePicker\n * selectedResourceId={selectedResourceId}\n * onResourceSelect={(selection) => selectResource(selection.resourceId)}\n * />\n * </div>\n * );\n * }\n * ```\n *\n * @returns Object containing view state and state management functions\n * @public\n */\nexport function useViewState(): IUseViewStateReturn {\n const [messages, setIMessages] = useState<IMessage[]>([]);\n const [selectedResourceId, setSelectedResourceId] = useState<string | null>(null);\n\n const addMessage = useCallback((type: IMessage['type'], message: string) => {\n const newMessage: IMessage = {\n id: `msg-${Date.now()}-${Math.random()}`,\n type,\n message,\n timestamp: new Date()\n };\n\n setIMessages((prev) => [...prev, newMessage]);\n\n // No auto-clearing - let users manage messages with filters\n }, []);\n\n const clearMessages = useCallback(() => {\n setIMessages([]);\n }, []);\n\n const selectResource = useCallback((resourceId: string | null) => {\n setSelectedResourceId(resourceId);\n }, []);\n\n return {\n messages,\n selectedResourceId,\n addMessage,\n clearMessages,\n selectResource\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG5F,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAenD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAOA,+EAA+E;AAC/E,6FAA6F;AAC7F,6JAA6J;AAC7J,8KAA8K;AAC9K,gEAAgE;AAChE,kEAAkE;AAClE,mDAAmD;AACnD,gDAAgD;AAChD,+CAA+C;AAC/C,qIAAqI;AACrI,iDAAiD;AAEjD,eAAe;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,8DAA8D;AAC9D,cAAc,SAAS,CAAC","sourcesContent":["// Export orchestrator types (main entry point types)\nexport type { IOrchestratorState, IOrchestratorActions, IResolutionActions } from './types';\n\n// Export utility types that are commonly used across namespaces\nexport type { Result } from '@fgv/ts-utils';\nexport type { JsonValue } from '@fgv/ts-json-base';\n\n// Domain-specific types are now available through their respective namespaces:\n// - FilterTools: FilterState, FilterActions, FilterViewProps, FilterResult, FilteredResource\n// - ResolutionTools: ResolutionState, ResolutionActions, ResolutionViewProps, ResolutionResult, CandidateInfo, ConditionEvaluationResult, EditedResourceInfo\n// - ResourceTools: ProcessedResources, ExtendedProcessedResources, ResourceManagerState, ResourceEditorFactory, ResourceEditorResult, ResourceEditorProps, ResourceDetailData\n// - ViewStateTools: ViewBaseProps, Message, MessagesWindowProps\n// - ImportTools: ImportViewProps, ImportedFile, ImportedDirectory\n// - TsResTools: SourceViewProps, CompiledViewProps\n// - ZipTools: ImportViewProps and ZIP utilities\n// - ConfigurationTools: ConfigurationViewProps\n// - GridTools: GridViewProps, MultiGridViewProps, GridColumnDefinition, GridResourceSelector, GridDropdownOption, GridCellValidation\n// - ImportTools: ImportedFile, ImportedDirectory\n\n// Export views\nexport { ImportView } from './components/views/ImportView';\n\n// Browser entry point - re-exports everything from main index\nexport * from './index';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC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EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,gBAAgB,EAAoC,CAAC;AAE5G,qBAAqB;AACrB,cAAc,SAAS,CAAC;AAExB,4DAA4D;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,sBAAsB,MAAM,4CAA4C,CAAC;AAChF,OAAO,SAAS,MAAM,+BAA+B,CAAC;AACtD,OAAO,SAAS,MAAM,+BAA+B,CAAC;AACtD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAExD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,SAAS,EACT,SAAS,EACT,UAAU,EACX,CAAC;AAEF,0EAA0E;AAC1E,6CAA6C;AAC7C,yCAAyC;AACzC,4CAA4C;AAC5C,uCAAuC;AAEvC,8EAA8E;AAC9E,4CAA4C;AAE5C,0FAA0F;AAC1F,mHAAmH;AACnH,qGAAqG;AAErG,kEAAkE;AAClE,4EAA4E;AAC5E,wEAAwE;AACxE,mEAAmE;AACnE,iFAAiF;AACjF,2FAA2F;AAE3F,mCAAmC;AACnC,OAAO,EACL,aAAa,EACb,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,UAAU,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,SAAS,EACT,kBAAkB,EACnB,MAAM,cAAc,CAAC","sourcesContent":["// Export orchestrator types (main entry point types)\nexport type { IOrchestratorState, IOrchestratorActions, IResolutionActions } from './types';\n\n// Export utility types that are commonly used across namespaces\nexport type { Result } from '@fgv/ts-utils';\nexport type { JsonValue } from '@fgv/ts-json-base';\n\n// Domain-specific types are now available through their respective namespaces:\n// - FilterTools: FilterState, FilterActions, FilterViewProps, FilterResult, FilteredResource\n// - ResolutionTools: ResolutionState, ResolutionActions, ResolutionViewProps, ResolutionResult, CandidateInfo, ConditionEvaluationResult, EditedResourceInfo\n// - ResourceTools: ProcessedResources, ExtendedProcessedResources, ResourceManagerState, ResourceEditorFactory, ResourceEditorResult, ResourceEditorProps, ResourceDetailData\n// - ViewStateTools: ViewBaseProps, Message, MessagesWindowProps\n// - ImportTools: ImportViewProps, ImportedFile, ImportedDirectory\n// - TsResTools: SourceViewProps, CompiledViewProps\n// - ZipTools: ImportViewProps and ZIP utilities\n// - ConfigurationTools: ConfigurationViewProps\n// - GridTools: GridViewProps, MultiGridViewProps, GridColumnDefinition, GridResourceSelector, GridDropdownOption, GridCellValidation\n// - ImportTools: ImportedFile, ImportedDirectory\n\n// Export views\nexport { ImportView } from './components/views/ImportView';\nexport { SourceView } from './components/views/SourceView';\nexport { FilterView } from './components/views/FilterView';\nexport { CompiledView } from './components/views/CompiledView';\nexport { ResolutionView } from './components/views/ResolutionView';\nexport { ConfigurationView } from './components/views/ConfigurationView';\nexport { MessagesWindow } from './components/views/MessagesWindow';\nexport { GridView } from './components/views/GridView';\nexport { MultiGridView } from './components/views/GridView/MultiGridView';\n\n// Export orchestrator\nexport { ResourceOrchestrator } from './components/orchestrator/ResourceOrchestrator';\n\n// Export contexts and hooks\nimport { ObservabilityProvider, useObservability, type IObservabilityProviderProps } from './contexts';\nimport { useSmartObservability } from './hooks/useSmartObservability';\n\nexport { useSmartObservability, ObservabilityProvider, useObservability, type IObservabilityProviderProps };\n\n// Export React hooks\nexport * from './hooks';\n\n// Export common components (likely to be used by consumers)\nimport { ResourceTreeView } from './components/common/ResourceTreeView';\nimport { ResourceListView } from './components/common/ResourceListView';\nimport { SourceResourceDetail } from './components/common/SourceResourceDetail';\nimport { ResolutionResults } from './components/common/ResolutionResults';\nimport NavigationWarningModal from './components/common/NavigationWarningModal';\nimport AppLayout from './components/common/AppLayout';\nimport AppHeader from './components/common/AppHeader';\nimport AppSidebar from './components/common/AppSidebar';\n\nexport {\n ResourceTreeView,\n ResourceListView,\n SourceResourceDetail,\n ResolutionResults,\n NavigationWarningModal,\n AppLayout,\n AppHeader,\n AppSidebar\n};\n\n// Form components are now available through ConfigurationTools namespace:\n// - ConfigurationTools.QualifierTypeEditForm\n// - ConfigurationTools.QualifierEditForm\n// - ConfigurationTools.ResourceTypeEditForm\n// - ConfigurationTools.HierarchyEditor\n\n// QualifierContextControl is now available through ResolutionTools namespace:\n// - ResolutionTools.QualifierContextControl\n\n// Resolution and picker components are now available through their respective namespaces:\n// - ResolutionTools.EditableJsonView, ResolutionTools.UnifiedChangeControls, ResolutionTools.EditableJsonViewProps\n// - PickerTools.ResourcePicker, PickerTools.ResourcePickerProps, PickerTools.ResourceSelection, etc.\n\n// All hooks are now organized within their respective namespaces:\n// - useResourceData: ResourceTools.useResourceData (orchestrator data hook)\n// - useViewState: ViewStateTools.useViewState (view state and messages)\n// - useFilterState: FilterTools.useFilterState (filter management)\n// - useResolutionState: ResolutionTools.useResolutionState (resource resolution)\n// - useConfigurationState: ConfigurationTools.useConfigurationState (system configuration)\n\n// Export organized tool namespaces\nexport {\n DownloadTools,\n FilterTools,\n ResolutionTools,\n ConfigurationTools,\n ResourceTools,\n ImportTools,\n TsResTools,\n ZipTools,\n ViewStateTools,\n PickerTools,\n GridTools,\n ObservabilityTools\n} from './namespaces';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/ConfigurationTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAGtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAGrC,YAAY,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationTools.js","sourceRoot":"","sources":["../../src/namespaces/ConfigurationTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,8CAA8C;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,+CAA+C;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,8BAA8B;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,2BAA2B;AAC3B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC","sourcesContent":["/**\n * Tools and components for ts-res system configuration management.\n *\n * This namespace contains the ConfigurationView component and utility functions\n * for creating, validating, and managing ts-res system configurations, including\n * templates and export/import operations.\n *\n * @example\n * ```tsx\n * import { ConfigurationTools } from '@fgv/ts-res-ui-components';\n *\n * // Use the ConfigurationView component\n * <ConfigurationTools.ConfigurationView\n * configuration={systemConfiguration}\n * onConfigurationChange={handleConfigChange}\n * onSave={handleSave}\n * hasUnsavedChanges={hasChanges}\n * />\n *\n * // Use form components for editing individual configuration elements\n * <ConfigurationTools.QualifierTypeEditForm\n * qualifierType={editingQualifierType}\n * onSave={handleSaveQualifierType}\n * onCancel={handleCancel}\n * existingNames={existingTypeNames}\n * />\n *\n * // Use utility functions\n * const config = ConfigurationTools.getDefaultConfiguration();\n * const validation = ConfigurationTools.validateConfiguration(config);\n * ```\n *\n * @public\n */\n\n// Export the main ConfigurationView component\nexport { ConfigurationView } from '../components/views/ConfigurationView';\n\n// Export configuration editing form components\nexport { QualifierTypeEditForm } from '../components/forms/QualifierTypeEditForm';\nexport { QualifierEditForm } from '../components/forms/QualifierEditForm';\nexport { ResourceTypeEditForm } from '../components/forms/ResourceTypeEditForm';\nexport { HierarchyEditor } from '../components/forms/HierarchyEditor';\n\n// Export domain-specific hook\nexport { useIConfigurationState } from '../hooks/useConfigurationState';\n\n// Export utility functions\nexport {\n getDefaultConfiguration,\n validateConfiguration,\n cloneConfiguration,\n exportConfiguration,\n importConfiguration\n} from '../utils/configurationUtils';\n\n// Export types related to configuration management\nexport type { IConfigurationViewProps } from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/DownloadTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadTools.js","sourceRoot":"","sources":["../../src/namespaces/DownloadTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import * as DownloadUtils from '../utils/downloadHelper';\n\nexport { DownloadUtils };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/FilterTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EAClB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterTools.js","sourceRoot":"","sources":["../../src/namespaces/FilterTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,uCAAuC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,8BAA8B;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,2BAA2B;AAC3B,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * Tools and components for resource filtering operations.\n *\n * This namespace contains the FilterView component, utility functions for creating\n * filtered resource managers, analyzing filter results, and managing filter state.\n *\n * @example\n * ```tsx\n * import { FilterTools } from '@fgv/ts-res-ui-components';\n *\n * // Use the FilterView component\n * <FilterTools.FilterView\n * resources={processedResources}\n * filterState={filterState}\n * filterActions={filterActions}\n * />\n *\n * // Or use utility functions\n * if (FilterTools.hasFilterValues(filterState.values)) {\n * const filtered = FilterTools.createFilteredResourceManagerSimple(\n * resources,\n * filterState.appliedValues\n * );\n * }\n * ```\n *\n * @public\n */\n\n// Export the main FilterView component\nexport { FilterView } from '../components/views/FilterView';\n\n// Export domain-specific hook\nexport { useFilterState } from '../hooks/useFilterState';\n\n// Export utility functions\nexport {\n createFilteredResourceManagerSimple,\n analyzeFilteredResources,\n hasFilterValues,\n getFilterSummary,\n type IFilterOptions\n} from '../utils/filterResources';\n\n// Export types related to filtering\nexport type {\n IFilterState,\n IFilterActions,\n IFilterViewProps,\n IFilterResult,\n IFilteredResource\n} from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/GridTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAGzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAGzG,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,+CAA+C,CAAC;AAGvD,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,EACrB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridTools.js","sourceRoot":"","sources":["../../src/namespaces/GridTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEzG,wBAAwB;AACxB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,+CAA+C,CAAC","sourcesContent":["/**\n * GridTools namespace for grid-based resource management components and utilities.\n *\n * Provides components and utilities for displaying and editing multiple resources\n * simultaneously in grid/table format with configurable columns, validation,\n * and batch operations.\n *\n * @example\n * ```tsx\n * import { GridTools, ResourceTools } from '@fgv/ts-res-ui-components';\n *\n * // Single grid usage\n * function UserDataGrid() {\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * const gridConfig: GridTools.GridViewInitParams = {\n * id: 'users',\n * title: 'User Data',\n * resourceSelection: { type: 'prefix', prefix: 'user.' },\n * columnMapping: [{\n * resourceType: 'user-data',\n * columns: [\n * {\n * id: 'name',\n * title: 'Name',\n * dataPath: 'name',\n * editable: true,\n * cellType: 'string',\n * validation: { required: true, maxLength: 100 }\n * },\n * {\n * id: 'email',\n * title: 'Email',\n * dataPath: 'email',\n * editable: true,\n * cellType: 'string',\n * validation: {\n * required: true,\n * pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n * }\n * },\n * {\n * id: 'active',\n * title: 'Active',\n * dataPath: 'active',\n * editable: true,\n * cellType: 'boolean'\n * }\n * ]\n * }]\n * };\n *\n * return (\n * <GridTools.GridView\n * gridConfig={gridConfig}\n * resources={state.resources}\n * resolutionState={state.resolutionState}\n * resolutionActions={actions}\n * availableQualifiers={['language', 'territory']}\n * />\n * );\n * }\n *\n * // Multi-grid usage for admin workflows\n * function AdminPanel() {\n * const { state, actions } = ResourceTools.useResourceData();\n *\n * const gridConfigs: GridTools.GridViewInitParams[] = [\n * {\n * id: 'languages',\n * title: 'Languages',\n * resourceSelection: { type: 'resourceTypes', types: ['language-config'] },\n * columnMapping: [{\n * resourceType: 'language-config',\n * columns: [\n * { id: 'code', title: 'Code', dataPath: 'code' },\n * {\n * id: 'name',\n * title: 'Display Name',\n * dataPath: 'displayName',\n * editable: true,\n * cellType: 'string'\n * }\n * ]\n * }]\n * },\n * {\n * id: 'payment-methods',\n * title: 'Payment Methods',\n * resourceSelection: { type: 'prefix', prefix: 'payment.' },\n * columnMapping: [{\n * resourceType: 'payment-config',\n * columns: [\n * {\n * id: 'status',\n * title: 'Status',\n * dataPath: 'status',\n * editable: true,\n * cellType: 'dropdown',\n * dropdownOptions: [\n * { value: 'active', label: 'Active' },\n * { value: 'inactive', label: 'Inactive' }\n * ]\n * }\n * ]\n * }]\n * }\n * ];\n *\n * return (\n * <GridTools.MultiGridView\n * gridConfigurations={gridConfigs}\n * resources={state.resources}\n * resolutionState={state.resolutionState}\n * resolutionActions={actions}\n * availableQualifiers={['country', 'language', 'environment']}\n * tabsPresentation=\"tabs\"\n * />\n * );\n * }\n * ```\n *\n * @public\n */\n\n// Export grid view components\nexport { GridView } from '../components/views/GridView';\nexport { MultiGridView } from '../components/views/GridView/MultiGridView';\nexport { ResourceGrid } from '../components/views/GridView/ResourceGrid';\nexport { EditableGridCell } from '../components/views/GridView/EditableGridCell';\nexport { SharedContextControls } from '../components/views/GridView/SharedContextControls';\nexport { GridSelector } from '../components/views/GridView/GridSelector';\n\n// Export specialized cell components\nexport { StringCell, BooleanCell, TriStateCell, DropdownCell } from '../components/views/GridView/cells';\n\n// Export grid utilities\nexport { ResourceSelector, defaultResourceSelector, selectResources } from '../utils/resourceSelector';\nexport {\n validateCellValue,\n ValidationPatterns,\n ValidationFunctions,\n GridValidationState\n} from '../utils/cellValidation';\nexport {\n hasGridValidationErrors,\n getAllGridValidationErrors,\n clearAllGridValidationErrors\n} from '../components/views/GridView/EditableGridCell';\n\n// Export grid-related types\nexport type {\n IGridViewProps,\n IMultiGridViewProps,\n IGridViewInitParams,\n IGridColumnDefinition,\n IGridDropdownOption,\n IGridCellValidation,\n GridResourceSelector,\n ICustomResourceSelector,\n IGridPresentationOptions,\n IResourceTypeColumnMapping,\n IGridCellProps,\n IGridCellEditorProps\n} from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/ImportTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAK5D,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAG5E,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportTools.js","sourceRoot":"","sources":["../../src/namespaces/ImportTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,8DAA8D;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,qGAAqG;AAErG,0CAA0C;AAC1C,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/**\n * Tools and utilities for import operations.\n *\n * This namespace contains the ImportView component and re-exports utilities for\n * exporting data in various formats. For file processing operations, use\n * FileTreeHelpers from `@fgv/ts-web-extras` directly.\n *\n * @example\n * ```tsx\n * import { ImportTools } from '@fgv/ts-res-ui-components';\n * import { FileTreeHelpers } from '@fgv/ts-web-extras';\n *\n * // Use the ImportView component for file/directory imports\n * <ImportTools.ImportView\n * onImport={handleFileImport}\n * onBundleImport={handleBundleImport}\n * onZipImport={handleZipImport}\n * />\n *\n * // For file processing, use FileTreeHelpers directly\n * const fileTree = await FileTreeHelpers.fromFileList(fileInput);\n * const dirTree = await FileTreeHelpers.fromDirectoryUpload(dirInput);\n * ImportTools.exportAsJson(data, 'my-resources.json');\n * ```\n *\n * @public\n */\n\n// Export the ImportView component (dual export with ZipTools)\nexport { ImportView } from '../components/views/ImportView';\n\n// File processing utilities have been removed - use FileTreeHelpers from @fgv/ts-web-extras directly\n\n// Export utilities moved to ts-web-extras\nexport { exportAsJson, exportUsingFileSystemAPI } from '@fgv/ts-web-extras';\n\n// Export types related to file handling and processing\nexport type { IImportViewProps } from '../types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservabilityTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/ObservabilityTools.ts"],"names":[],"mappings":"AAuBA,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACjF,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,wBAAwB,EACxB,8BAA8B,EAC9B,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservabilityTools.js","sourceRoot":"","sources":["../../src/namespaces/ObservabilityTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,wBAAwB,EACxB,8BAA8B,EAC9B,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,wBAAwB,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\n// Re-export observability types and utilities\nexport type { IUserLogger, IObservabilityContext } from '../utils/observability';\nexport type { ObservabilityContextType } from '../utils/observability';\n\nexport {\n ConsoleUserLogger,\n NoOpUserLogger,\n ViewStateUserLogger,\n ObservabilityContext,\n createConsoleObservabilityContext,\n createNoOpObservabilityContext,\n createViewStateObservabilityContext,\n DefaultObservabilityContext,\n TestObservabilityContext,\n detectObservabilityContextType,\n isViewStateConnected,\n isConsoleOnlyContext\n} from '../utils/observability';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PickerTools.d.ts","sourceRoot":"","sources":["../../src/namespaces/PickerTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AAGjG,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,4CAA4C,CAAC;AAGpD,YAAY,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC"}
|