@flanksource/clicky-ui 0.3.19 → 0.3.20
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/dist/components/ErrorWrapper.cjs +1 -1
- package/dist/components/ErrorWrapper.cjs.map +1 -1
- package/dist/components/ErrorWrapper.js +1 -1
- package/dist/components/ErrorWrapper.js.map +1 -1
- package/dist/components/UnitStepControls.cjs +55 -0
- package/dist/components/UnitStepControls.cjs.map +1 -0
- package/dist/components/UnitStepControls.d.ts +10 -0
- package/dist/components/UnitStepControls.d.ts.map +1 -0
- package/dist/components/UnitStepControls.js +55 -0
- package/dist/components/UnitStepControls.js.map +1 -0
- package/dist/components/json-schema-form-accordion-array.cjs +5 -73
- package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
- package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-accordion-array.js +3 -71
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-array.cjs +6 -1
- package/dist/components/json-schema-form-array.cjs.map +1 -1
- package/dist/components/json-schema-form-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-array.js +6 -1
- package/dist/components/json-schema-form-array.js.map +1 -1
- package/dist/components/json-schema-form-cards-array.cjs +96 -0
- package/dist/components/json-schema-form-cards-array.cjs.map +1 -0
- package/dist/components/json-schema-form-cards-array.d.ts +7 -0
- package/dist/components/json-schema-form-cards-array.d.ts.map +1 -0
- package/dist/components/json-schema-form-cards-array.js +96 -0
- package/dist/components/json-schema-form-cards-array.js.map +1 -0
- package/dist/components/json-schema-form-item-row.cjs +81 -0
- package/dist/components/json-schema-form-item-row.cjs.map +1 -0
- package/dist/components/json-schema-form-item-row.d.ts +19 -0
- package/dist/components/json-schema-form-item-row.d.ts.map +1 -0
- package/dist/components/json-schema-form-item-row.js +81 -0
- package/dist/components/json-schema-form-item-row.js.map +1 -0
- package/dist/components/json-schema-form-render.cjs +2 -2
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +2 -2
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +1 -1
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.js +1 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-tone.cjs +12 -0
- package/dist/components/json-schema-form-tone.cjs.map +1 -1
- package/dist/components/json-schema-form-tone.js +12 -0
- package/dist/components/json-schema-form-tone.js.map +1 -1
- package/dist/components/json-schema-form-types.d.ts +1 -1
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/unit-form-extension.cjs +126 -0
- package/dist/components/unit-form-extension.cjs.map +1 -0
- package/dist/components/unit-form-extension.d.ts +8 -0
- package/dist/components/unit-form-extension.d.ts.map +1 -0
- package/dist/components/unit-form-extension.js +126 -0
- package/dist/components/unit-form-extension.js.map +1 -0
- package/dist/components.cjs +4 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +4 -0
- package/dist/components.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +61 -8
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +61 -8
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.cjs +10 -4
- package/dist/data/diagnostics/error-diagnostics.cjs.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.d.ts.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.js +10 -4
- package/dist/data/diagnostics/error-diagnostics.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.cjs +12 -6
- package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.js +12 -6
- package/dist/data/query-browser/QueryBrowser.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs +2 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.d.ts +16 -14
- package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.js +2 -1
- package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/string.cjs +8 -0
- package/dist/lib/string.cjs.map +1 -1
- package/dist/lib/string.d.ts +1 -0
- package/dist/lib/string.d.ts.map +1 -1
- package/dist/lib/string.js +8 -0
- package/dist/lib/string.js.map +1 -1
- package/dist/profiles/catalogTree.cjs +133 -0
- package/dist/profiles/catalogTree.cjs.map +1 -0
- package/dist/profiles/catalogTree.d.ts +11 -0
- package/dist/profiles/catalogTree.d.ts.map +1 -0
- package/dist/profiles/catalogTree.js +133 -0
- package/dist/profiles/catalogTree.js.map +1 -0
- package/dist/profiles/connectionBrowserModel.cjs +185 -0
- package/dist/profiles/connectionBrowserModel.cjs.map +1 -0
- package/dist/profiles/connectionBrowserModel.d.ts +169 -0
- package/dist/profiles/connectionBrowserModel.d.ts.map +1 -0
- package/dist/profiles/connectionBrowserModel.js +185 -0
- package/dist/profiles/connectionBrowserModel.js.map +1 -0
- package/dist/profiles/connectionQueryWorkspace.cjs +185 -0
- package/dist/profiles/connectionQueryWorkspace.cjs.map +1 -0
- package/dist/profiles/connectionQueryWorkspace.d.ts +63 -0
- package/dist/profiles/connectionQueryWorkspace.d.ts.map +1 -0
- package/dist/profiles/connectionQueryWorkspace.js +185 -0
- package/dist/profiles/connectionQueryWorkspace.js.map +1 -0
- package/dist/profiles/connectionQueryWorkspaceModel.cjs +28 -0
- package/dist/profiles/connectionQueryWorkspaceModel.cjs.map +1 -0
- package/dist/profiles/connectionQueryWorkspaceModel.d.ts +38 -0
- package/dist/profiles/connectionQueryWorkspaceModel.d.ts.map +1 -0
- package/dist/profiles/connectionQueryWorkspaceModel.js +28 -0
- package/dist/profiles/connectionQueryWorkspaceModel.js.map +1 -0
- package/dist/profiles/esFieldValues.cjs +64 -0
- package/dist/profiles/esFieldValues.cjs.map +1 -0
- package/dist/profiles/esFieldValues.d.ts +48 -0
- package/dist/profiles/esFieldValues.d.ts.map +1 -0
- package/dist/profiles/esFieldValues.js +64 -0
- package/dist/profiles/esFieldValues.js.map +1 -0
- package/dist/profiles/esParamMappingModel.cjs +301 -0
- package/dist/profiles/esParamMappingModel.cjs.map +1 -0
- package/dist/profiles/esParamMappingModel.d.ts +37 -0
- package/dist/profiles/esParamMappingModel.d.ts.map +1 -0
- package/dist/profiles/esParamMappingModel.js +301 -0
- package/dist/profiles/esParamMappingModel.js.map +1 -0
- package/dist/profiles/esParamMappingPill.cjs +24 -0
- package/dist/profiles/esParamMappingPill.cjs.map +1 -0
- package/dist/profiles/esParamMappingPill.d.ts +13 -0
- package/dist/profiles/esParamMappingPill.d.ts.map +1 -0
- package/dist/profiles/esParamMappingPill.js +24 -0
- package/dist/profiles/esParamMappingPill.js.map +1 -0
- package/dist/profiles/esParamOperandExtension.cjs +75 -0
- package/dist/profiles/esParamOperandExtension.cjs.map +1 -0
- package/dist/profiles/esParamOperandExtension.d.ts +11 -0
- package/dist/profiles/esParamOperandExtension.d.ts.map +1 -0
- package/dist/profiles/esParamOperandExtension.js +75 -0
- package/dist/profiles/esParamOperandExtension.js.map +1 -0
- package/dist/profiles/esQueryBuilder.cjs +205 -0
- package/dist/profiles/esQueryBuilder.cjs.map +1 -0
- package/dist/profiles/esQueryBuilder.d.ts +35 -0
- package/dist/profiles/esQueryBuilder.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilder.js +205 -0
- package/dist/profiles/esQueryBuilder.js.map +1 -0
- package/dist/profiles/esQueryBuilderExtension.cjs +23 -0
- package/dist/profiles/esQueryBuilderExtension.cjs.map +1 -0
- package/dist/profiles/esQueryBuilderExtension.d.ts +5 -0
- package/dist/profiles/esQueryBuilderExtension.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilderExtension.js +23 -0
- package/dist/profiles/esQueryBuilderExtension.js.map +1 -0
- package/dist/profiles/esQueryBuilderForm.cjs +26 -0
- package/dist/profiles/esQueryBuilderForm.cjs.map +1 -0
- package/dist/profiles/esQueryBuilderForm.d.ts +18 -0
- package/dist/profiles/esQueryBuilderForm.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilderForm.js +26 -0
- package/dist/profiles/esQueryBuilderForm.js.map +1 -0
- package/dist/profiles/esQueryBuilderModel.cjs +131 -0
- package/dist/profiles/esQueryBuilderModel.cjs.map +1 -0
- package/dist/profiles/esQueryBuilderModel.d.ts +108 -0
- package/dist/profiles/esQueryBuilderModel.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilderModel.js +131 -0
- package/dist/profiles/esQueryBuilderModel.js.map +1 -0
- package/dist/profiles/esQueryClauseGroup.cjs +144 -0
- package/dist/profiles/esQueryClauseGroup.cjs.map +1 -0
- package/dist/profiles/esQueryClauseGroup.d.ts +10 -0
- package/dist/profiles/esQueryClauseGroup.d.ts.map +1 -0
- package/dist/profiles/esQueryClauseGroup.js +144 -0
- package/dist/profiles/esQueryClauseGroup.js.map +1 -0
- package/dist/profiles/esQueryCompile.cjs +47 -0
- package/dist/profiles/esQueryCompile.cjs.map +1 -0
- package/dist/profiles/esQueryCompile.d.ts +39 -0
- package/dist/profiles/esQueryCompile.d.ts.map +1 -0
- package/dist/profiles/esQueryCompile.js +47 -0
- package/dist/profiles/esQueryCompile.js.map +1 -0
- package/dist/profiles/esQueryConditionRow.cjs +168 -0
- package/dist/profiles/esQueryConditionRow.cjs.map +1 -0
- package/dist/profiles/esQueryConditionRow.d.ts +37 -0
- package/dist/profiles/esQueryConditionRow.d.ts.map +1 -0
- package/dist/profiles/esQueryConditionRow.js +168 -0
- package/dist/profiles/esQueryConditionRow.js.map +1 -0
- package/dist/profiles/esQueryGroupModel.cjs +12 -0
- package/dist/profiles/esQueryGroupModel.cjs.map +1 -0
- package/dist/profiles/esQueryGroupModel.d.ts +9 -0
- package/dist/profiles/esQueryGroupModel.d.ts.map +1 -0
- package/dist/profiles/esQueryGroupModel.js +12 -0
- package/dist/profiles/esQueryGroupModel.js.map +1 -0
- package/dist/profiles/esQueryOccur.cjs +16 -0
- package/dist/profiles/esQueryOccur.cjs.map +1 -0
- package/dist/profiles/esQueryOccur.d.ts +11 -0
- package/dist/profiles/esQueryOccur.d.ts.map +1 -0
- package/dist/profiles/esQueryOccur.js +16 -0
- package/dist/profiles/esQueryOccur.js.map +1 -0
- package/dist/profiles/esQueryOperandEditors.cjs +279 -0
- package/dist/profiles/esQueryOperandEditors.cjs.map +1 -0
- package/dist/profiles/esQueryOperandEditors.d.ts +24 -0
- package/dist/profiles/esQueryOperandEditors.d.ts.map +1 -0
- package/dist/profiles/esQueryOperandEditors.js +279 -0
- package/dist/profiles/esQueryOperandEditors.js.map +1 -0
- package/dist/profiles/esQueryOperandModel.cjs +28 -0
- package/dist/profiles/esQueryOperandModel.cjs.map +1 -0
- package/dist/profiles/esQueryOperandModel.d.ts +17 -0
- package/dist/profiles/esQueryOperandModel.d.ts.map +1 -0
- package/dist/profiles/esQueryOperandModel.js +28 -0
- package/dist/profiles/esQueryOperandModel.js.map +1 -0
- package/dist/profiles/esQueryOperators.cjs +165 -0
- package/dist/profiles/esQueryOperators.cjs.map +1 -0
- package/dist/profiles/esQueryOperators.d.ts +83 -0
- package/dist/profiles/esQueryOperators.d.ts.map +1 -0
- package/dist/profiles/esQueryOperators.js +165 -0
- package/dist/profiles/esQueryOperators.js.map +1 -0
- package/dist/profiles/esQueryOutputEditor.cjs +138 -0
- package/dist/profiles/esQueryOutputEditor.cjs.map +1 -0
- package/dist/profiles/esQueryOutputEditor.d.ts +7 -0
- package/dist/profiles/esQueryOutputEditor.d.ts.map +1 -0
- package/dist/profiles/esQueryOutputEditor.js +138 -0
- package/dist/profiles/esQueryOutputEditor.js.map +1 -0
- package/dist/profiles/esQueryOutputModel.cjs +16 -0
- package/dist/profiles/esQueryOutputModel.cjs.map +1 -0
- package/dist/profiles/esQueryOutputModel.d.ts +14 -0
- package/dist/profiles/esQueryOutputModel.d.ts.map +1 -0
- package/dist/profiles/esQueryOutputModel.js +16 -0
- package/dist/profiles/esQueryOutputModel.js.map +1 -0
- package/dist/profiles/esQueryPreview.cjs +30 -0
- package/dist/profiles/esQueryPreview.cjs.map +1 -0
- package/dist/profiles/esQueryPreview.d.ts +6 -0
- package/dist/profiles/esQueryPreview.d.ts.map +1 -0
- package/dist/profiles/esQueryPreview.js +30 -0
- package/dist/profiles/esQueryPreview.js.map +1 -0
- package/dist/profiles/esQuerySortEditor.cjs +143 -0
- package/dist/profiles/esQuerySortEditor.cjs.map +1 -0
- package/dist/profiles/esQuerySortEditor.d.ts +9 -0
- package/dist/profiles/esQuerySortEditor.d.ts.map +1 -0
- package/dist/profiles/esQuerySortEditor.js +143 -0
- package/dist/profiles/esQuerySortEditor.js.map +1 -0
- package/dist/profiles/esQuerySortModel.cjs +13 -0
- package/dist/profiles/esQuerySortModel.cjs.map +1 -0
- package/dist/profiles/esQuerySortModel.d.ts +4 -0
- package/dist/profiles/esQuerySortModel.d.ts.map +1 -0
- package/dist/profiles/esQuerySortModel.js +13 -0
- package/dist/profiles/esQuerySortModel.js.map +1 -0
- package/dist/profiles/esValueCombobox.cjs +86 -0
- package/dist/profiles/esValueCombobox.cjs.map +1 -0
- package/dist/profiles/esValueCombobox.d.ts +15 -0
- package/dist/profiles/esValueCombobox.d.ts.map +1 -0
- package/dist/profiles/esValueCombobox.js +86 -0
- package/dist/profiles/esValueCombobox.js.map +1 -0
- package/dist/profiles/jsonPathSample.cjs +75 -0
- package/dist/profiles/jsonPathSample.cjs.map +1 -0
- package/dist/profiles/jsonPathSample.d.ts +27 -0
- package/dist/profiles/jsonPathSample.d.ts.map +1 -0
- package/dist/profiles/jsonPathSample.js +75 -0
- package/dist/profiles/jsonPathSample.js.map +1 -0
- package/dist/profiles/jsonPathSampleRow.cjs +14 -0
- package/dist/profiles/jsonPathSampleRow.cjs.map +1 -0
- package/dist/profiles/jsonPathSampleRow.d.ts +6 -0
- package/dist/profiles/jsonPathSampleRow.d.ts.map +1 -0
- package/dist/profiles/jsonPathSampleRow.js +14 -0
- package/dist/profiles/jsonPathSampleRow.js.map +1 -0
- package/dist/profiles/profileApi.cjs +37 -0
- package/dist/profiles/profileApi.cjs.map +1 -0
- package/dist/profiles/profileApi.d.ts +32 -0
- package/dist/profiles/profileApi.d.ts.map +1 -0
- package/dist/profiles/profileApi.js +37 -0
- package/dist/profiles/profileApi.js.map +1 -0
- package/dist/profiles/profileBuilder.cjs +65 -0
- package/dist/profiles/profileBuilder.cjs.map +1 -0
- package/dist/profiles/profileBuilder.d.ts +11 -0
- package/dist/profiles/profileBuilder.d.ts.map +1 -0
- package/dist/profiles/profileBuilder.js +65 -0
- package/dist/profiles/profileBuilder.js.map +1 -0
- package/dist/profiles/profileBuilderExtension.cjs +25 -0
- package/dist/profiles/profileBuilderExtension.cjs.map +1 -0
- package/dist/profiles/profileBuilderExtension.d.ts +5 -0
- package/dist/profiles/profileBuilderExtension.d.ts.map +1 -0
- package/dist/profiles/profileBuilderExtension.js +25 -0
- package/dist/profiles/profileBuilderExtension.js.map +1 -0
- package/dist/profiles/profileBuilderWorkspace.cjs +368 -0
- package/dist/profiles/profileBuilderWorkspace.cjs.map +1 -0
- package/dist/profiles/profileBuilderWorkspace.d.ts +21 -0
- package/dist/profiles/profileBuilderWorkspace.d.ts.map +1 -0
- package/dist/profiles/profileBuilderWorkspace.js +368 -0
- package/dist/profiles/profileBuilderWorkspace.js.map +1 -0
- package/dist/profiles/profileColumnModel.cjs +23 -0
- package/dist/profiles/profileColumnModel.cjs.map +1 -0
- package/dist/profiles/profileColumnModel.d.ts +8 -0
- package/dist/profiles/profileColumnModel.d.ts.map +1 -0
- package/dist/profiles/profileColumnModel.js +23 -0
- package/dist/profiles/profileColumnModel.js.map +1 -0
- package/dist/profiles/profileColumnPicker.cjs +68 -0
- package/dist/profiles/profileColumnPicker.cjs.map +1 -0
- package/dist/profiles/profileColumnPicker.d.ts +11 -0
- package/dist/profiles/profileColumnPicker.d.ts.map +1 -0
- package/dist/profiles/profileColumnPicker.js +68 -0
- package/dist/profiles/profileColumnPicker.js.map +1 -0
- package/dist/profiles/profileEditor.cjs +386 -0
- package/dist/profiles/profileEditor.cjs.map +1 -0
- package/dist/profiles/profileEditor.d.ts +19 -0
- package/dist/profiles/profileEditor.d.ts.map +1 -0
- package/dist/profiles/profileEditor.js +386 -0
- package/dist/profiles/profileEditor.js.map +1 -0
- package/dist/profiles/profileEditorModel.cjs +181 -0
- package/dist/profiles/profileEditorModel.cjs.map +1 -0
- package/dist/profiles/profileEditorModel.d.ts +74 -0
- package/dist/profiles/profileEditorModel.d.ts.map +1 -0
- package/dist/profiles/profileEditorModel.js +181 -0
- package/dist/profiles/profileEditorModel.js.map +1 -0
- package/dist/profiles/profileEditorPreview.cjs +38 -0
- package/dist/profiles/profileEditorPreview.cjs.map +1 -0
- package/dist/profiles/profileEditorPreview.d.ts +12 -0
- package/dist/profiles/profileEditorPreview.d.ts.map +1 -0
- package/dist/profiles/profileEditorPreview.js +38 -0
- package/dist/profiles/profileEditorPreview.js.map +1 -0
- package/dist/profiles/profileEditorRail.cjs +46 -0
- package/dist/profiles/profileEditorRail.cjs.map +1 -0
- package/dist/profiles/profileEditorRail.d.ts +8 -0
- package/dist/profiles/profileEditorRail.d.ts.map +1 -0
- package/dist/profiles/profileEditorRail.js +46 -0
- package/dist/profiles/profileEditorRail.js.map +1 -0
- package/dist/profiles/profileEditorRaw.cjs +118 -0
- package/dist/profiles/profileEditorRaw.cjs.map +1 -0
- package/dist/profiles/profileEditorRaw.d.ts +7 -0
- package/dist/profiles/profileEditorRaw.d.ts.map +1 -0
- package/dist/profiles/profileEditorRaw.js +118 -0
- package/dist/profiles/profileEditorRaw.js.map +1 -0
- package/dist/profiles/profileEditorRoutes.cjs +7 -0
- package/dist/profiles/profileEditorRoutes.cjs.map +1 -0
- package/dist/profiles/profileEditorRoutes.d.ts +2 -0
- package/dist/profiles/profileEditorRoutes.d.ts.map +1 -0
- package/dist/profiles/profileEditorRoutes.js +7 -0
- package/dist/profiles/profileEditorRoutes.js.map +1 -0
- package/dist/profiles/profileEditorSections.cjs +213 -0
- package/dist/profiles/profileEditorSections.cjs.map +1 -0
- package/dist/profiles/profileEditorSections.d.ts +23 -0
- package/dist/profiles/profileEditorSections.d.ts.map +1 -0
- package/dist/profiles/profileEditorSections.js +213 -0
- package/dist/profiles/profileEditorSections.js.map +1 -0
- package/dist/profiles/profileFieldEditor.cjs +200 -0
- package/dist/profiles/profileFieldEditor.cjs.map +1 -0
- package/dist/profiles/profileFieldEditor.d.ts +34 -0
- package/dist/profiles/profileFieldEditor.d.ts.map +1 -0
- package/dist/profiles/profileFieldEditor.js +200 -0
- package/dist/profiles/profileFieldEditor.js.map +1 -0
- package/dist/profiles/profileFieldGrid.cjs +250 -0
- package/dist/profiles/profileFieldGrid.cjs.map +1 -0
- package/dist/profiles/profileFieldGrid.d.ts +20 -0
- package/dist/profiles/profileFieldGrid.d.ts.map +1 -0
- package/dist/profiles/profileFieldGrid.js +250 -0
- package/dist/profiles/profileFieldGrid.js.map +1 -0
- package/dist/profiles/profileFieldManager.cjs +103 -0
- package/dist/profiles/profileFieldManager.cjs.map +1 -0
- package/dist/profiles/profileFieldManager.d.ts +9 -0
- package/dist/profiles/profileFieldManager.d.ts.map +1 -0
- package/dist/profiles/profileFieldManager.js +103 -0
- package/dist/profiles/profileFieldManager.js.map +1 -0
- package/dist/profiles/profileFieldState.cjs +136 -0
- package/dist/profiles/profileFieldState.cjs.map +1 -0
- package/dist/profiles/profileFieldState.d.ts +41 -0
- package/dist/profiles/profileFieldState.d.ts.map +1 -0
- package/dist/profiles/profileFieldState.js +136 -0
- package/dist/profiles/profileFieldState.js.map +1 -0
- package/dist/profiles/profileFieldTypes.cjs +17 -0
- package/dist/profiles/profileFieldTypes.cjs.map +1 -0
- package/dist/profiles/profileFieldTypes.d.ts +8 -0
- package/dist/profiles/profileFieldTypes.d.ts.map +1 -0
- package/dist/profiles/profileFieldTypes.js +17 -0
- package/dist/profiles/profileFieldTypes.js.map +1 -0
- package/dist/profiles/profileParamModel.cjs +78 -0
- package/dist/profiles/profileParamModel.cjs.map +1 -0
- package/dist/profiles/profileParamModel.d.ts +3 -0
- package/dist/profiles/profileParamModel.d.ts.map +1 -0
- package/dist/profiles/profileParamModel.js +78 -0
- package/dist/profiles/profileParamModel.js.map +1 -0
- package/dist/profiles/profileSamplePayload.cjs +15 -0
- package/dist/profiles/profileSamplePayload.cjs.map +1 -0
- package/dist/profiles/profileSamplePayload.d.ts +13 -0
- package/dist/profiles/profileSamplePayload.d.ts.map +1 -0
- package/dist/profiles/profileSamplePayload.js +15 -0
- package/dist/profiles/profileSamplePayload.js.map +1 -0
- package/dist/profiles/profileWizard.cjs +257 -0
- package/dist/profiles/profileWizard.cjs.map +1 -0
- package/dist/profiles/profileWizard.d.ts +12 -0
- package/dist/profiles/profileWizard.d.ts.map +1 -0
- package/dist/profiles/profileWizard.js +257 -0
- package/dist/profiles/profileWizard.js.map +1 -0
- package/dist/profiles/profileWizardHelp.cjs +10 -0
- package/dist/profiles/profileWizardHelp.cjs.map +1 -0
- package/dist/profiles/profileWizardHelp.d.ts +13 -0
- package/dist/profiles/profileWizardHelp.d.ts.map +1 -0
- package/dist/profiles/profileWizardHelp.js +10 -0
- package/dist/profiles/profileWizardHelp.js.map +1 -0
- package/dist/profiles/profileWizardModel.cjs +198 -0
- package/dist/profiles/profileWizardModel.cjs.map +1 -0
- package/dist/profiles/profileWizardModel.d.ts +255 -0
- package/dist/profiles/profileWizardModel.d.ts.map +1 -0
- package/dist/profiles/profileWizardModel.js +198 -0
- package/dist/profiles/profileWizardModel.js.map +1 -0
- package/dist/profiles/profileWizardQueryStep.cjs +215 -0
- package/dist/profiles/profileWizardQueryStep.cjs.map +1 -0
- package/dist/profiles/profileWizardQueryStep.d.ts +18 -0
- package/dist/profiles/profileWizardQueryStep.d.ts.map +1 -0
- package/dist/profiles/profileWizardQueryStep.js +215 -0
- package/dist/profiles/profileWizardQueryStep.js.map +1 -0
- package/dist/profiles/profileWizardSteps.cjs +214 -0
- package/dist/profiles/profileWizardSteps.cjs.map +1 -0
- package/dist/profiles/profileWizardSteps.d.ts +35 -0
- package/dist/profiles/profileWizardSteps.d.ts.map +1 -0
- package/dist/profiles/profileWizardSteps.js +214 -0
- package/dist/profiles/profileWizardSteps.js.map +1 -0
- package/dist/profiles/profileYaml.cjs +19 -0
- package/dist/profiles/profileYaml.cjs.map +1 -0
- package/dist/profiles/profileYaml.d.ts +4 -0
- package/dist/profiles/profileYaml.d.ts.map +1 -0
- package/dist/profiles/profileYaml.js +19 -0
- package/dist/profiles/profileYaml.js.map +1 -0
- package/dist/profiles/prometheusResults.cjs +60 -0
- package/dist/profiles/prometheusResults.cjs.map +1 -0
- package/dist/profiles/prometheusResults.d.ts +7 -0
- package/dist/profiles/prometheusResults.d.ts.map +1 -0
- package/dist/profiles/prometheusResults.js +60 -0
- package/dist/profiles/prometheusResults.js.map +1 -0
- package/dist/profiles/queryRowLimits.cjs +82 -0
- package/dist/profiles/queryRowLimits.cjs.map +1 -0
- package/dist/profiles/queryRowLimits.d.ts +9 -0
- package/dist/profiles/queryRowLimits.d.ts.map +1 -0
- package/dist/profiles/queryRowLimits.js +82 -0
- package/dist/profiles/queryRowLimits.js.map +1 -0
- package/dist/profiles/queryRowLimitsModel.cjs +10 -0
- package/dist/profiles/queryRowLimitsModel.cjs.map +1 -0
- package/dist/profiles/queryRowLimitsModel.d.ts +9 -0
- package/dist/profiles/queryRowLimitsModel.d.ts.map +1 -0
- package/dist/profiles/queryRowLimitsModel.js +10 -0
- package/dist/profiles/queryRowLimitsModel.js.map +1 -0
- package/dist/profiles/queryTargetPicker.cjs +42 -0
- package/dist/profiles/queryTargetPicker.cjs.map +1 -0
- package/dist/profiles/queryTargetPicker.d.ts +8 -0
- package/dist/profiles/queryTargetPicker.d.ts.map +1 -0
- package/dist/profiles/queryTargetPicker.js +42 -0
- package/dist/profiles/queryTargetPicker.js.map +1 -0
- package/dist/profiles/testSchema.d.ts +3 -0
- package/dist/profiles/testSchema.d.ts.map +1 -0
- package/dist/profiles.cjs +223 -0
- package/dist/profiles.cjs.map +1 -0
- package/dist/profiles.d.ts +68 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +223 -0
- package/dist/profiles.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBrowser.js","sources":["../../../src/data/query-browser/QueryBrowser.tsx"],"sourcesContent":["import { Compartment, EditorState } from \"@codemirror/state\";\nimport { EditorView } from \"@codemirror/view\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { JsonSchemaForm } from \"../../components/JsonSchemaForm\";\nimport { cn } from \"../../lib/utils\";\nimport { SplitPane } from \"../../layout/SplitPane\";\nimport { Icon } from \"../Icon\";\nimport { UiDebug, UiPlay } from \"../../icons\";\nimport type { DataTablePagination } from \"../DataTable\";\nimport { inferColumns } from \"../data-table-utils\";\nimport type { DataTableFilterSelection } from \"../data-table-filter-values\";\nimport {\n serverColumnsToDataTableColumns,\n serverFiltersToFilterBar,\n type DataTableFilterLookup,\n type DataTableServerColumn,\n} from \"../data-table-server-filters\";\nimport { ErrorDetails } from \"../diagnostics/ErrorDetails\";\nimport {\n queryBrowserEditorExtensions,\n queryBrowserLanguageExtension,\n readQueryBrowserHistory,\n rememberQueryBrowserQuery,\n type QueryBrowserHistoryEntry,\n} from \"./QueryBrowser.editor\";\nimport { QueryBrowserDiagnosticsPanel } from \"./QueryBrowserDiagnosticsPanel\";\nimport { QueryBrowserResults } from \"./QueryBrowserResults\";\nimport {\n QueryBrowserExecutionError,\n type QueryBrowserDiagnostics,\n type QueryBrowserProps,\n type QueryBrowserRequest,\n type QueryBrowserResult,\n} from \"./QueryBrowser.types\";\n\nexport function QueryBrowser({\n id,\n title,\n language = \"text\",\n initialQuery = \"\",\n queryLabel = \"Query\",\n optionsSchema,\n initialOptions,\n completion,\n onQueryChange,\n onOptionsChange,\n navigator,\n execute,\n lookupFilterValues,\n renderResults,\n className,\n}: QueryBrowserProps) {\n const editorHost = useRef<HTMLDivElement | null>(null);\n const editor = useRef<EditorView | null>(null);\n const languageConfig = useRef(new Compartment());\n const executeRef = useRef<() => void>(() => undefined);\n const onQueryChangeRef = useRef(onQueryChange);\n const [options, setOptions] = useState<Record<string, unknown>>(\n initialOptions ?? {},\n );\n const [result, setResult] = useState<QueryBrowserResult | null>(null);\n const [error, setError] = useState<{\n message: string;\n query: string;\n diagnostics?: QueryBrowserDiagnostics;\n } | null>(null);\n const [pending, setPending] = useState(false);\n const [debug, setDebug] = useState(false);\n const [entries, setEntries] = useState<QueryBrowserHistoryEntry[]>(() =>\n readQueryBrowserHistory(id),\n );\n const [filters, setFilters] = useState<DataTableFilterSelection>({});\n // What the displayed result came from. A filter re-runs *this*, never the\n // editor's current text — otherwise changing a pill would execute a\n // half-typed edit nobody asked to run.\n const lastRun = useRef<{\n query: string;\n options: Record<string, unknown>;\n filters?: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n } | null>(null);\n const executedFilters = useRef<DataTableFilterSelection>({});\n\n // Every run goes through here so the record a filter re-runs from is refreshed\n // in one place: the query, its options, and the columns the source described,\n // which are what a subsequent selection binds to.\n const runRequest = useCallback(\n async (request: QueryBrowserRequest) => {\n setPending(true);\n setError(null);\n const started = performance.now();\n try {\n const next = await execute(request);\n setResult({\n ...next,\n durationMs: next.durationMs ?? performance.now() - started,\n });\n lastRun.current = {\n query: request.query,\n options: request.options,\n ...(request.filters ? { filters: request.filters } : {}),\n ...(next.columns ? { columns: next.columns } : {}),\n };\n } catch (err) {\n setError({\n message: err instanceof Error ? err.message : String(err),\n query: request.query,\n ...(err instanceof QueryBrowserExecutionError && err.diagnostics\n ? { diagnostics: err.diagnostics }\n : {}),\n });\n } finally {\n setPending(false);\n }\n },\n [execute],\n );\n\n const currentQuery = useCallback(() => {\n const view = editor.current;\n if (!view) return initialQuery;\n const selection = view.state.selection.main;\n if (!selection.empty)\n return view.state.sliceDoc(selection.from, selection.to);\n return view.state.doc.toString();\n }, [initialQuery]);\n\n const run = useCallback(async () => {\n const query = currentQuery().trim();\n if (!query || pending) return;\n setEntries(rememberQueryBrowserQuery(id, query));\n // A different statement is a different result set, so neither its filters\n // nor the columns they bind to survive: both name columns the new query may\n // not return.\n const repeat = lastRun.current?.query === query ? lastRun.current : null;\n const carried = repeat ? filters : {};\n if (carried !== filters) setFilters(carried);\n lastRun.current = { query, options };\n executedFilters.current = carried;\n await runRequest({\n query,\n options,\n ...(Object.keys(carried).length > 0 ? { filters: carried } : {}),\n ...(repeat?.columns ? { columns: repeat.columns } : {}),\n ...(debug ? { debug: true } : {}),\n });\n }, [currentQuery, debug, filters, id, options, pending, runRequest]);\n\n // A filter pill is not a draft the way query text is: it commits a discrete\n // value on selection, and the bar already debounces its free-text fields. So\n // a change re-runs the last executed query immediately rather than waiting\n // for Run, which is also how the profile catalog behaves.\n const rerunWithFilters = useCallback(\n async (selection: DataTableFilterSelection) => {\n const previous = lastRun.current;\n if (!previous) {\n throw new Error(\n \"QueryBrowser: a filter changed before any query had run\",\n );\n }\n await runRequest({\n ...previous,\n filters: selection,\n ...(result?.pagination\n ? { pagination: { limit: result.pagination.limit } }\n : {}),\n ...(debug ? { debug: true } : {}),\n });\n },\n [debug, result?.pagination, runRequest],\n );\n\n const rerunAt = useCallback(\n async (pagination: NonNullable<QueryBrowserRequest[\"pagination\"]>) => {\n const previous = lastRun.current;\n if (!previous) {\n throw new Error(\n \"QueryBrowser: pagination changed before any query had run\",\n );\n }\n await runRequest({\n ...previous,\n pagination,\n ...(debug ? { debug: true } : {}),\n });\n },\n [debug, runRequest],\n );\n\n useEffect(() => {\n if (!lastRun.current) return;\n if (filters === executedFilters.current) return;\n executedFilters.current = filters;\n void rerunWithFilters(filters);\n }, [filters, rerunWithFilters]);\n\n executeRef.current = () => void run();\n onQueryChangeRef.current = onQueryChange;\n\n useEffect(() => {\n if (!editorHost.current) return;\n const view = new EditorView({\n parent: editorHost.current,\n state: EditorState.create({\n doc: initialQuery,\n extensions: queryBrowserEditorExtensions(\n () => executeRef.current(),\n (query) => onQueryChangeRef.current?.(query),\n languageConfig.current.of(\n queryBrowserLanguageExtension(language, completion),\n ),\n ),\n }),\n });\n editor.current = view;\n return () => {\n editor.current = null;\n view.destroy();\n };\n }, [id, language]);\n\n useEffect(() => {\n const view = editor.current;\n if (!view) return;\n view.dispatch({\n effects: languageConfig.current.reconfigure(\n queryBrowserLanguageExtension(language, completion),\n ),\n });\n }, [completion, language]);\n\n useEffect(() => {\n const view = editor.current;\n if (!view || view.state.doc.toString() === initialQuery) return;\n view.dispatch({\n changes: { from: 0, to: view.state.doc.length, insert: initialQuery },\n });\n }, [initialQuery]);\n\n useEffect(() => {\n setOptions(initialOptions ?? {});\n }, [initialOptions]);\n\n const updateOptions = useCallback(\n (next: Record<string, unknown>) => {\n setOptions(next);\n onOptionsChange?.(next);\n },\n [onOptionsChange],\n );\n\n useEffect(() => {\n setEntries(readQueryBrowserHistory(id));\n setResult(null);\n setError(null);\n setFilters({});\n setDebug(false);\n lastRun.current = null;\n executedFilters.current = {};\n }, [id]);\n\n const rows = result?.rows ?? [];\n const described = result?.columns ?? [];\n const columns = useMemo(\n () =>\n described.length > 0\n ? serverColumnsToDataTableColumns<Record<string, unknown>>(described)\n : inferColumns(rows, { literalKeys: true }),\n [described, rows],\n );\n const lookupValues = useMemo<DataTableFilterLookup | undefined>(() => {\n if (!lookupFilterValues) return undefined;\n return (request) => {\n const previous = lastRun.current;\n if (!previous) {\n throw new Error(\n \"QueryBrowser: a filter lookup ran before any query had\",\n );\n }\n return lookupFilterValues({ ...request, ...previous, filters });\n };\n }, [filters, lookupFilterValues]);\n const filterConfig = useMemo(\n () =>\n serverFiltersToFilterBar(\n described,\n filters,\n setFilters,\n lookupValues ? { lookupValues } : {},\n ),\n [described, filters, lookupValues],\n );\n const serverFiltered =\n filterConfig.filters.length > 0 || filterConfig.timeRange !== undefined;\n const tablePagination = useMemo<DataTablePagination | undefined>(() => {\n const pagination = result?.pagination;\n if (!pagination) return undefined;\n const shared = {\n pageSize: pagination.limit,\n ...(pagination.total !== undefined ? { total: pagination.total } : {}),\n ...(pagination.totalRelation === \"eq\" ||\n pagination.totalRelation === \"gte\"\n ? { totalRelation: pagination.totalRelation }\n : {}),\n hasMore: pagination.hasMore,\n onPageSizeChange: (limit: number) => void rerunAt({ limit }),\n };\n if (pagination.mode === \"cursor\") {\n return {\n ...shared,\n page: 0,\n cursor: {\n ...(pagination.cursor ? { current: pagination.cursor } : {}),\n ...(pagination.nextCursor ? { next: pagination.nextCursor } : {}),\n onCursorChange: (cursor: string | undefined) =>\n void rerunAt({\n limit: pagination.limit,\n ...(cursor ? { cursor } : {}),\n }),\n },\n };\n }\n const page = Math.floor((pagination.offset ?? 0) / pagination.limit);\n return {\n ...shared,\n page,\n onPageChange: (nextPage: number) =>\n void rerunAt({\n limit: pagination.limit,\n offset: nextPage * pagination.limit,\n }),\n };\n }, [rerunAt, result?.pagination]);\n const defaultResults = (\n <QueryBrowserResults\n result={result}\n pending={pending}\n {...(title ? { title } : {})}\n queryLabel={queryLabel}\n columns={columns}\n filterConfig={filterConfig}\n serverFiltered={serverFiltered}\n {...(tablePagination ? { pagination: tablePagination } : {})}\n />\n );\n\n const workspace = (\n <div className=\"flex h-full min-h-0 flex-col overflow-hidden rounded-xl border bg-card\">\n <div className=\"flex flex-wrap items-center gap-2 border-b px-3 py-2\">\n <div className=\"min-w-0 flex-1\">\n {title && <h2 className=\"truncate text-sm font-semibold\">{title}</h2>}\n <p className=\"text-xs text-muted-foreground\">{queryLabel}</p>\n </div>\n {entries.length > 0 && (\n <select\n aria-label=\"Query history\"\n defaultValue=\"\"\n onChange={(event) => {\n const query = event.target.value;\n const view = editor.current;\n if (!view || !query) return;\n view.dispatch({\n changes: { from: 0, to: view.state.doc.length, insert: query },\n });\n event.target.value = \"\";\n }}\n className=\"h-8 max-w-52 rounded-md border bg-background px-2 text-xs\"\n >\n <option value=\"\">History</option>\n {entries.map((entry) => (\n <option key={`${entry.at}:${entry.query}`} value={entry.query}>\n {entry.query.replace(/\\s+/g, \" \").slice(0, 80)}\n </option>\n ))}\n </select>\n )}\n <Button\n size=\"sm\"\n variant={debug ? \"secondary\" : \"outline\"}\n aria-pressed={debug}\n onClick={() => setDebug((enabled) => !enabled)}\n >\n <Icon icon={UiDebug} className=\"size-4\" />\n Debug\n </Button>\n <Button\n size=\"sm\"\n onClick={() => void run()}\n loading={pending}\n loadingLabel={pending ? \"Running\" : undefined}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n </div>\n {optionsSchema &&\n Object.keys(optionsSchema.properties ?? {}).length > 0 && (\n <div className=\"border-b px-3 py-2\">\n <JsonSchemaForm\n schema={optionsSchema}\n value={options}\n onChange={updateOptions}\n size=\"sm\"\n inline\n showPreferencesMenu={false}\n persistPreferences={false}\n />\n </div>\n )}\n <div ref={editorHost} className=\"h-[34%] min-h-44 border-b\" />\n <div className=\"flex min-h-0 flex-1 flex-col overflow-auto p-3\">\n {error ? (\n <div className=\"space-y-3\">\n <ErrorDetails\n diagnostics={{\n message: error.message,\n context: [\n [\"Query\", error.query],\n [\"Language\", language],\n ],\n }}\n />\n {error.diagnostics && (\n <QueryBrowserDiagnosticsPanel diagnostics={error.diagnostics} />\n )}\n </div>\n ) : result && renderResults ? (\n renderResults({ result, defaultView: defaultResults })\n ) : (\n defaultResults\n )}\n </div>\n </div>\n );\n\n return (\n <div className={cn(\"h-[calc(100vh-15rem)] min-h-[32rem]\", className)}>\n {navigator ? (\n <SplitPane defaultSplit={28} left={navigator} right={workspace} />\n ) : (\n workspace\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAoCO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAsB;AACpB,QAAM,aAAa,OAA8B,IAAI;AACrD,QAAM,SAAS,OAA0B,IAAI;AAC7C,QAAM,iBAAiB,OAAO,IAAI,aAAa;AAC/C,QAAM,aAAa,OAAmB,MAAM,MAAS;AACrD,QAAM,mBAAmB,OAAO,aAAa;AAC7C,QAAM,CAAC,SAAS,UAAU,IAAI;AAAA,IAC5B,kBAAkB,CAAA;AAAA,EAAC;AAErB,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAoC,IAAI;AACpE,QAAM,CAAC,OAAO,QAAQ,IAAI,SAIhB,IAAI;AACd,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,KAAK;AACxC,QAAM,CAAC,SAAS,UAAU,IAAI;AAAA,IAAqC,MACjE,wBAAwB,EAAE;AAAA,EAAA;AAE5B,QAAM,CAAC,SAAS,UAAU,IAAI,SAAmC,CAAA,CAAE;AAInE,QAAM,UAAU,OAKN,IAAI;AACd,QAAM,kBAAkB,OAAiC,EAAE;AAK3D,QAAM,aAAa;AAAA,IACjB,OAAO,YAAiC;AACtC,iBAAW,IAAI;AACf,eAAS,IAAI;AACb,YAAM,UAAU,YAAY,IAAA;AAC5B,UAAI;AACF,cAAM,OAAO,MAAM,QAAQ,OAAO;AA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A,oBAAC,MAAA,EAAK,MAAM,QAAQ,WAAU,UAAS;AAAA,YAAE;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAE3C,GACF;AAAA,IACC,iBACC,OAAO,KAAK,cAAc,cAAc,CAAA,CAAE,EAAE,SAAS,KACnD,oBAAC,OAAA,EAAI,WAAU,sBACb,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,UAAU;AAAA,QACV,MAAK;AAAA,QACL,QAAM;AAAA,QACN,qBAAqB;AAAA,QACrB,oBAAoB;AAAA,MAAA;AAAA,IAAA,GAExB;AAAA,IAEJ,oBAAC,OAAA,EAAI,KAAK,YAAY,WAAU,6BAA4B;AAAA,IAC5D,oBAAC,SAAI,WAAU,kDACZ,kBACC,qBAAC,OAAA,EAAI,WAAU,aACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAa;AAAA,YACX,SAAS,MAAM;AAAA,YACf,SAAS;AAAA,cACP,CAAC,SAAS,MAAM,KAAK;AAAA,cACrB,CAAC,YAAY,QAAQ;AAAA,YAAA;AAAA,UACvB;AAAA,QACF;AAAA,MAAA;AAAA,MAED,MAAM,eACL,oBAAC,8BAAA,EAA6B,aAAa,MAAM,YAAA,CAAa;AAAA,IAAA,GAElE,IACE,UAAU,gBACZ,cAAc,EAAE,QAAQ,aAAa,gBAAgB,IAErD,eAAA,CAEJ;AAAA,EAAA,GACF;AAGF,6BACG,OAAA,EAAI,WAAW,GAAG,uCAAuC,SAAS,GAChE,UAAA,YACC,oBAAC,WAAA,EAAU,cAAc,IAAI,MAAM,WAAW,OAAO,UAAA,CAAW,IAEhE,WAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"QueryBrowser.js","sources":["../../../src/data/query-browser/QueryBrowser.tsx"],"sourcesContent":["import { Compartment, EditorState } from \"@codemirror/state\";\nimport { EditorView } from \"@codemirror/view\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { JsonSchemaForm } from \"../../components/JsonSchemaForm\";\nimport { cn } from \"../../lib/utils\";\nimport { SplitPane } from \"../../layout/SplitPane\";\nimport { Icon } from \"../Icon\";\nimport { UiDebug, UiPlay } from \"../../icons\";\nimport type { DataTablePagination } from \"../DataTable\";\nimport { inferColumns } from \"../data-table-utils\";\nimport type { DataTableFilterSelection } from \"../data-table-filter-values\";\nimport {\n serverColumnsToDataTableColumns,\n serverFiltersToFilterBar,\n type DataTableFilterLookup,\n type DataTableServerColumn,\n} from \"../data-table-server-filters\";\nimport { ErrorDetails } from \"../diagnostics/ErrorDetails\";\nimport type { ErrorDiagnostics } from \"../diagnostics/error-diagnostics\";\nimport {\n queryBrowserEditorExtensions,\n queryBrowserLanguageExtension,\n readQueryBrowserHistory,\n rememberQueryBrowserQuery,\n type QueryBrowserHistoryEntry,\n} from \"./QueryBrowser.editor\";\nimport { QueryBrowserDiagnosticsPanel } from \"./QueryBrowserDiagnosticsPanel\";\nimport { QueryBrowserResults } from \"./QueryBrowserResults\";\nimport {\n QueryBrowserExecutionError,\n type QueryBrowserDiagnostics,\n type QueryBrowserProps,\n type QueryBrowserRequest,\n type QueryBrowserResult,\n} from \"./QueryBrowser.types\";\n\nexport function QueryBrowser({\n id,\n title,\n language = \"text\",\n initialQuery = \"\",\n queryLabel = \"Query\",\n optionsSchema,\n initialOptions,\n completion,\n onQueryChange,\n onOptionsChange,\n navigator,\n execute,\n lookupFilterValues,\n renderResults,\n className,\n}: QueryBrowserProps) {\n const editorHost = useRef<HTMLDivElement | null>(null);\n const editor = useRef<EditorView | null>(null);\n const languageConfig = useRef(new Compartment());\n const executeRef = useRef<() => void>(() => undefined);\n const onQueryChangeRef = useRef(onQueryChange);\n const [options, setOptions] = useState<Record<string, unknown>>(\n initialOptions ?? {},\n );\n const [result, setResult] = useState<QueryBrowserResult | null>(null);\n const [error, setError] = useState<{\n message: string;\n query: string;\n diagnostics?: QueryBrowserDiagnostics;\n errorDetails?: ErrorDiagnostics;\n } | null>(null);\n const [pending, setPending] = useState(false);\n const [debug, setDebug] = useState(false);\n const [entries, setEntries] = useState<QueryBrowserHistoryEntry[]>(() =>\n readQueryBrowserHistory(id),\n );\n const [filters, setFilters] = useState<DataTableFilterSelection>({});\n // What the displayed result came from. A filter re-runs *this*, never the\n // editor's current text — otherwise changing a pill would execute a\n // half-typed edit nobody asked to run.\n const lastRun = useRef<{\n query: string;\n options: Record<string, unknown>;\n filters?: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n } | null>(null);\n const executedFilters = useRef<DataTableFilterSelection>({});\n\n // Every run goes through here so the record a filter re-runs from is refreshed\n // in one place: the query, its options, and the columns the source described,\n // which are what a subsequent selection binds to.\n const runRequest = useCallback(\n async (request: QueryBrowserRequest) => {\n setPending(true);\n setError(null);\n const started = performance.now();\n try {\n const next = await execute(request);\n setResult({\n ...next,\n durationMs: next.durationMs ?? performance.now() - started,\n });\n lastRun.current = {\n query: request.query,\n options: request.options,\n ...(request.filters ? { filters: request.filters } : {}),\n ...(next.columns ? { columns: next.columns } : {}),\n };\n } catch (err) {\n setError({\n message: err instanceof Error ? err.message : String(err),\n query: request.query,\n ...(err instanceof QueryBrowserExecutionError && err.diagnostics\n ? { diagnostics: err.diagnostics }\n : {}),\n ...(err instanceof QueryBrowserExecutionError && err.errorDetails\n ? { errorDetails: err.errorDetails }\n : {}),\n });\n } finally {\n setPending(false);\n }\n },\n [execute],\n );\n\n const currentQuery = useCallback(() => {\n const view = editor.current;\n if (!view) return initialQuery;\n const selection = view.state.selection.main;\n if (!selection.empty)\n return view.state.sliceDoc(selection.from, selection.to);\n return view.state.doc.toString();\n }, [initialQuery]);\n\n const run = useCallback(async () => {\n const query = currentQuery().trim();\n if (!query || pending) return;\n setEntries(rememberQueryBrowserQuery(id, query));\n // A different statement is a different result set, so neither its filters\n // nor the columns they bind to survive: both name columns the new query may\n // not return.\n const repeat = lastRun.current?.query === query ? lastRun.current : null;\n const carried = repeat ? filters : {};\n if (carried !== filters) setFilters(carried);\n lastRun.current = { query, options };\n executedFilters.current = carried;\n await runRequest({\n query,\n options,\n ...(Object.keys(carried).length > 0 ? { filters: carried } : {}),\n ...(repeat?.columns ? { columns: repeat.columns } : {}),\n ...(debug ? { debug: true } : {}),\n });\n }, [currentQuery, debug, filters, id, options, pending, runRequest]);\n\n // A filter pill is not a draft the way query text is: it commits a discrete\n // value on selection, and the bar already debounces its free-text fields. So\n // a change re-runs the last executed query immediately rather than waiting\n // for Run, which is also how the profile catalog behaves.\n const rerunWithFilters = useCallback(\n async (selection: DataTableFilterSelection) => {\n const previous = lastRun.current;\n if (!previous) {\n throw new Error(\n \"QueryBrowser: a filter changed before any query had run\",\n );\n }\n await runRequest({\n ...previous,\n filters: selection,\n ...(result?.pagination\n ? { pagination: { limit: result.pagination.limit } }\n : {}),\n ...(debug ? { debug: true } : {}),\n });\n },\n [debug, result?.pagination, runRequest],\n );\n\n const rerunAt = useCallback(\n async (pagination: NonNullable<QueryBrowserRequest[\"pagination\"]>) => {\n const previous = lastRun.current;\n if (!previous) {\n throw new Error(\n \"QueryBrowser: pagination changed before any query had run\",\n );\n }\n await runRequest({\n ...previous,\n pagination,\n ...(debug ? { debug: true } : {}),\n });\n },\n [debug, runRequest],\n );\n\n useEffect(() => {\n if (!lastRun.current) return;\n if (filters === executedFilters.current) return;\n executedFilters.current = filters;\n void rerunWithFilters(filters);\n }, [filters, rerunWithFilters]);\n\n executeRef.current = () => void run();\n onQueryChangeRef.current = onQueryChange;\n\n useEffect(() => {\n if (!editorHost.current) return;\n const view = new EditorView({\n parent: editorHost.current,\n state: EditorState.create({\n doc: initialQuery,\n extensions: queryBrowserEditorExtensions(\n () => executeRef.current(),\n (query) => onQueryChangeRef.current?.(query),\n languageConfig.current.of(\n queryBrowserLanguageExtension(language, completion),\n ),\n ),\n }),\n });\n editor.current = view;\n return () => {\n editor.current = null;\n view.destroy();\n };\n }, [id, language]);\n\n useEffect(() => {\n const view = editor.current;\n if (!view) return;\n view.dispatch({\n effects: languageConfig.current.reconfigure(\n queryBrowserLanguageExtension(language, completion),\n ),\n });\n }, [completion, language]);\n\n useEffect(() => {\n const view = editor.current;\n if (!view || view.state.doc.toString() === initialQuery) return;\n view.dispatch({\n changes: { from: 0, to: view.state.doc.length, insert: initialQuery },\n });\n }, [initialQuery]);\n\n useEffect(() => {\n setOptions(initialOptions ?? {});\n }, [initialOptions]);\n\n const updateOptions = useCallback(\n (next: Record<string, unknown>) => {\n setOptions(next);\n onOptionsChange?.(next);\n },\n [onOptionsChange],\n );\n\n useEffect(() => {\n setEntries(readQueryBrowserHistory(id));\n setResult(null);\n setError(null);\n setFilters({});\n setDebug(false);\n lastRun.current = null;\n executedFilters.current = {};\n }, [id]);\n\n const rows = result?.rows ?? [];\n const described = result?.columns ?? [];\n const columns = useMemo(\n () =>\n described.length > 0\n ? serverColumnsToDataTableColumns<Record<string, unknown>>(described)\n : inferColumns(rows, { literalKeys: true }),\n [described, rows],\n );\n const lookupValues = useMemo<DataTableFilterLookup | undefined>(() => {\n if (!lookupFilterValues) return undefined;\n return (request) => {\n const previous = lastRun.current;\n if (!previous) {\n throw new Error(\n \"QueryBrowser: a filter lookup ran before any query had\",\n );\n }\n return lookupFilterValues({ ...request, ...previous, filters });\n };\n }, [filters, lookupFilterValues]);\n const filterConfig = useMemo(\n () =>\n serverFiltersToFilterBar(\n described,\n filters,\n setFilters,\n lookupValues ? { lookupValues } : {},\n ),\n [described, filters, lookupValues],\n );\n const serverFiltered =\n filterConfig.filters.length > 0 || filterConfig.timeRange !== undefined;\n const tablePagination = useMemo<DataTablePagination | undefined>(() => {\n const pagination = result?.pagination;\n if (!pagination) return undefined;\n const shared = {\n pageSize: pagination.limit,\n ...(pagination.total !== undefined ? { total: pagination.total } : {}),\n ...(pagination.totalRelation === \"eq\" ||\n pagination.totalRelation === \"gte\"\n ? { totalRelation: pagination.totalRelation }\n : {}),\n hasMore: pagination.hasMore,\n onPageSizeChange: (limit: number) => void rerunAt({ limit }),\n };\n if (pagination.mode === \"cursor\") {\n return {\n ...shared,\n page: 0,\n cursor: {\n ...(pagination.cursor ? { current: pagination.cursor } : {}),\n ...(pagination.nextCursor ? { next: pagination.nextCursor } : {}),\n onCursorChange: (cursor: string | undefined) =>\n void rerunAt({\n limit: pagination.limit,\n ...(cursor ? { cursor } : {}),\n }),\n },\n };\n }\n const page = Math.floor((pagination.offset ?? 0) / pagination.limit);\n return {\n ...shared,\n page,\n onPageChange: (nextPage: number) =>\n void rerunAt({\n limit: pagination.limit,\n offset: nextPage * pagination.limit,\n }),\n };\n }, [rerunAt, result?.pagination]);\n const defaultResults = (\n <QueryBrowserResults\n result={result}\n pending={pending}\n {...(title ? { title } : {})}\n queryLabel={queryLabel}\n columns={columns}\n filterConfig={filterConfig}\n serverFiltered={serverFiltered}\n {...(tablePagination ? { pagination: tablePagination } : {})}\n />\n );\n\n const workspace = (\n <div className=\"flex h-full min-h-0 flex-col overflow-hidden rounded-xl border bg-card\">\n <div className=\"flex flex-wrap items-center gap-2 border-b px-3 py-2\">\n <div className=\"min-w-0 flex-1\">\n {title && <h2 className=\"truncate text-sm font-semibold\">{title}</h2>}\n <p className=\"text-xs text-muted-foreground\">{queryLabel}</p>\n </div>\n {entries.length > 0 && (\n <select\n aria-label=\"Query history\"\n defaultValue=\"\"\n onChange={(event) => {\n const query = event.target.value;\n const view = editor.current;\n if (!view || !query) return;\n view.dispatch({\n changes: { from: 0, to: view.state.doc.length, insert: query },\n });\n event.target.value = \"\";\n }}\n className=\"h-8 max-w-52 rounded-md border bg-background px-2 text-xs\"\n >\n <option value=\"\">History</option>\n {entries.map((entry) => (\n <option key={`${entry.at}:${entry.query}`} value={entry.query}>\n {entry.query.replace(/\\s+/g, \" \").slice(0, 80)}\n </option>\n ))}\n </select>\n )}\n <Button\n size=\"sm\"\n variant={debug ? \"secondary\" : \"outline\"}\n aria-pressed={debug}\n onClick={() => setDebug((enabled) => !enabled)}\n >\n <Icon icon={UiDebug} className=\"size-4\" />\n Debug\n </Button>\n <Button\n size=\"sm\"\n onClick={() => void run()}\n loading={pending}\n loadingLabel={pending ? \"Running\" : undefined}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n </div>\n {optionsSchema &&\n Object.keys(optionsSchema.properties ?? {}).length > 0 && (\n <div className=\"border-b px-3 py-2\">\n <JsonSchemaForm\n schema={optionsSchema}\n value={options}\n onChange={updateOptions}\n size=\"sm\"\n inline\n showPreferencesMenu={false}\n persistPreferences={false}\n />\n </div>\n )}\n <div ref={editorHost} className=\"h-[34%] min-h-44 border-b\" />\n <div className=\"flex min-h-0 flex-1 flex-col overflow-auto p-3\">\n {error ? (\n <div className=\"space-y-3\">\n <ErrorDetails\n diagnostics={{\n ...(error.errorDetails ?? {\n message: error.message,\n context: [],\n }),\n context: [\n ...(error.errorDetails?.context ?? []),\n [\"Query\", error.query],\n [\"Language\", language],\n ],\n }}\n />\n {error.diagnostics && (\n <QueryBrowserDiagnosticsPanel diagnostics={error.diagnostics} />\n )}\n </div>\n ) : result && renderResults ? (\n renderResults({ result, defaultView: defaultResults })\n ) : (\n defaultResults\n )}\n </div>\n </div>\n );\n\n return (\n <div className={cn(\"h-[calc(100vh-15rem)] min-h-[32rem]\", className)}>\n {navigator ? (\n <SplitPane defaultSplit={28} left={navigator} right={workspace} />\n ) : (\n workspace\n )}\n </div>\n );\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;AAqCO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAsB;;AACpB,QAAM,aAAa,OAA8B,IAAI;AACrD,QAAM,SAAS,OAA0B,IAAI;AAC7C,QAAM,iBAAiB,OAAO,IAAI,aAAa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;AAAA,IAEJ,oBAAC,OAAA,EAAI,KAAK,YAAY,WAAU,6BAA4B;AAAA,IAC5D,oBAAC,SAAI,WAAU,kDACZ,kBACC,qBAAC,OAAA,EAAI,WAAU,aACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAa;AAAA,YACX,GAAI,MAAM,gBAAgB;AAAA,cACxB,SAAS,MAAM;AAAA,cACf,SAAS,CAAA;AAAA,YAAC;AAAA,YAEZ,SAAS;AAAA,cACP,KAAI,WAAM,iBAAN,mBAAoB,YAAW,CAAA;AAAA,cACnC,CAAC,SAAS,MAAM,KAAK;AAAA,cACrB,CAAC,YAAY,QAAQ;AAAA,YAAA;AAAA,UACvB;AAAA,QACF;AAAA,MAAA;AAAA,MAED,MAAM,eACL,oBAAC,8BAAA,EAA6B,aAAa,MAAM,YAAA,CAAa;AAAA,IAAA,GAElE,IACE,UAAU,gBACZ,cAAc,EAAE,QAAQ,aAAa,gBAAgB,IAErD,eAAA,CAEJ;AAAA,EAAA,GACF;AAGF,6BACG,OAAA,EAAI,WAAW,GAAG,uCAAuC,SAAS,GAChE,UAAA,YACC,oBAAC,WAAA,EAAU,cAAc,IAAI,MAAM,WAAW,OAAO,UAAA,CAAW,IAEhE,WAEJ;AAEJ;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
class QueryBrowserExecutionError extends Error {
|
|
4
|
-
constructor(message, diagnostics) {
|
|
4
|
+
constructor(message, diagnostics, errorDetails) {
|
|
5
5
|
super(message);
|
|
6
6
|
this.diagnostics = diagnostics;
|
|
7
|
+
this.errorDetails = errorDetails;
|
|
7
8
|
this.name = "QueryBrowserExecutionError";
|
|
8
9
|
}
|
|
9
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBrowser.types.cjs","sources":["../../../src/data/query-browser/QueryBrowser.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport type { DataTableFilterSelection } from \"../data-table-filter-values\";\nimport type {\n DataTableFilterLookupRequest,\n DataTableFilterLookupResult,\n DataTableServerColumn,\n} from \"../data-table-server-filters\";\nimport type { QueryBrowserCompletion } from \"./QueryBrowser.completion\";\nimport type { QueryBrowserLanguage } from \"./QueryBrowser.editor\";\n\nexport type QueryBrowserPagination = {\n mode: \"offset\" | \"cursor\";\n limit: number;\n offset?: number;\n cursor?: string;\n nextCursor?: string;\n hasMore: boolean;\n total?: number;\n totalRelation: \"eq\" | \"gte\" | \"unknown\";\n consistency: \"live\" | \"snapshot\";\n};\n\nexport type QueryBrowserDiagnostics = {\n provider: string;\n request: {\n query?: string;\n arguments?: unknown[];\n options?: Record<string, unknown>;\n details?: Record<string, unknown>;\n };\n response?: {\n durationMs?: number;\n returnedRows?: number;\n details?: Record<string, unknown>;\n preview?: string;\n contentType?: string;\n truncated?: boolean;\n };\n error?: string;\n};\n\nexport class QueryBrowserExecutionError extends Error {\n constructor(\n message: string,\n readonly diagnostics?: QueryBrowserDiagnostics,\n ) {\n super(message);\n this.name = \"QueryBrowserExecutionError\";\n }\n}\n\nexport type QueryBrowserResult = {\n rows?: Record<string, unknown>[];\n columns?: DataTableServerColumn[];\n affectedRows?: number;\n durationMs?: number;\n message?: string;\n truncated?: boolean;\n limit?: number;\n metadata?: Record<string, unknown>;\n pagination?: QueryBrowserPagination;\n diagnostics?: QueryBrowserDiagnostics;\n};\n\nexport type QueryBrowserRequest = {\n query: string;\n options: Record<string, unknown>;\n filters?: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n pagination?: { limit: number; offset?: number; cursor?: string };\n debug?: boolean;\n};\n\nexport type QueryBrowserFilterLookupRequest = DataTableFilterLookupRequest & {\n query: string;\n options: Record<string, unknown>;\n filters: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n};\n\nexport type QueryBrowserFilterLookup = (\n request: QueryBrowserFilterLookupRequest,\n) => Promise<DataTableFilterLookupResult>;\n\nexport type QueryBrowserResultContext = {\n result: QueryBrowserResult;\n defaultView: ReactNode;\n};\n\nexport type QueryBrowserProps = {\n id: string;\n title?: string;\n language?: QueryBrowserLanguage;\n initialQuery?: string;\n queryLabel?: string;\n optionsSchema?: JsonSchemaObject;\n initialOptions?: Record<string, unknown
|
|
1
|
+
{"version":3,"file":"QueryBrowser.types.cjs","sources":["../../../src/data/query-browser/QueryBrowser.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport type { ErrorDiagnostics } from \"../diagnostics/error-diagnostics\";\nimport type { DataTableFilterSelection } from \"../data-table-filter-values\";\nimport type {\n DataTableFilterLookupRequest,\n DataTableFilterLookupResult,\n DataTableServerColumn,\n} from \"../data-table-server-filters\";\nimport type { QueryBrowserCompletion } from \"./QueryBrowser.completion\";\nimport type { QueryBrowserLanguage } from \"./QueryBrowser.editor\";\n\nexport type QueryBrowserPagination = {\n mode: \"offset\" | \"cursor\";\n limit: number;\n offset?: number;\n cursor?: string;\n nextCursor?: string;\n hasMore: boolean;\n total?: number;\n totalRelation: \"eq\" | \"gte\" | \"unknown\";\n consistency: \"live\" | \"snapshot\";\n};\n\nexport type QueryBrowserDiagnostics = {\n provider: string;\n request: {\n query?: string;\n arguments?: unknown[];\n options?: Record<string, unknown>;\n details?: Record<string, unknown>;\n };\n response?: {\n durationMs?: number;\n returnedRows?: number;\n details?: Record<string, unknown>;\n preview?: string;\n contentType?: string;\n truncated?: boolean;\n };\n error?: string;\n};\n\nexport class QueryBrowserExecutionError extends Error {\n constructor(\n message: string,\n readonly diagnostics?: QueryBrowserDiagnostics,\n readonly errorDetails?: ErrorDiagnostics,\n ) {\n super(message);\n this.name = \"QueryBrowserExecutionError\";\n }\n}\n\nexport type QueryBrowserResult = {\n rows?: Record<string, unknown>[];\n columns?: DataTableServerColumn[];\n affectedRows?: number;\n durationMs?: number;\n message?: string;\n truncated?: boolean;\n limit?: number;\n metadata?: Record<string, unknown>;\n pagination?: QueryBrowserPagination;\n diagnostics?: QueryBrowserDiagnostics;\n};\n\nexport type QueryBrowserRequest = {\n query: string;\n options: Record<string, unknown>;\n filters?: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n pagination?: { limit: number; offset?: number; cursor?: string };\n debug?: boolean;\n};\n\nexport type QueryBrowserFilterLookupRequest = DataTableFilterLookupRequest & {\n query: string;\n options: Record<string, unknown>;\n filters: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n};\n\nexport type QueryBrowserFilterLookup = (\n request: QueryBrowserFilterLookupRequest,\n) => Promise<DataTableFilterLookupResult>;\n\nexport type QueryBrowserResultContext = {\n result: QueryBrowserResult;\n defaultView: ReactNode;\n};\n\n// The optional props admit an explicit `undefined` — the same convention the\n// rest of the package follows (see data/CodeBlock.tsx). Passing a\n// possibly-absent value straight through, `className={maybe}`, is ordinary\n// React, and under exactOptionalPropertyTypes a bare `?:` rejects it.\nexport type QueryBrowserProps = {\n id: string;\n title?: string | undefined;\n language?: QueryBrowserLanguage | undefined;\n initialQuery?: string | undefined;\n queryLabel?: string | undefined;\n optionsSchema?: JsonSchemaObject | undefined;\n initialOptions?: Record<string, unknown> | undefined;\n completion?: QueryBrowserCompletion | undefined;\n onQueryChange?: ((query: string) => void) | undefined;\n onOptionsChange?: ((options: Record<string, unknown>) => void) | undefined;\n navigator?: ReactNode | undefined;\n execute: (request: QueryBrowserRequest) => Promise<QueryBrowserResult>;\n lookupFilterValues?: QueryBrowserFilterLookup | undefined;\n renderResults?: ((context: QueryBrowserResultContext) => ReactNode) | undefined;\n className?: string | undefined;\n};\n"],"names":[],"mappings":";;AA2CO,MAAM,mCAAmC,MAAM;AAAA,EACpD,YACE,SACS,aACA,cACT;AACA,UAAM,OAAO;AAHJ,SAAA,cAAA;AACA,SAAA,eAAA;AAGT,SAAK,OAAO;AAAA,EACd;AACF;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { JsonSchemaObject } from '../../components/json-schema-form-types';
|
|
3
|
+
import { ErrorDiagnostics } from '../diagnostics/error-diagnostics';
|
|
3
4
|
import { DataTableFilterSelection } from '../data-table-filter-values';
|
|
4
5
|
import { DataTableFilterLookupRequest, DataTableFilterLookupResult, DataTableServerColumn } from '../data-table-server-filters';
|
|
5
6
|
import { QueryBrowserCompletion } from './QueryBrowser.completion';
|
|
@@ -35,7 +36,8 @@ export type QueryBrowserDiagnostics = {
|
|
|
35
36
|
};
|
|
36
37
|
export declare class QueryBrowserExecutionError extends Error {
|
|
37
38
|
readonly diagnostics?: QueryBrowserDiagnostics | undefined;
|
|
38
|
-
|
|
39
|
+
readonly errorDetails?: ErrorDiagnostics | undefined;
|
|
40
|
+
constructor(message: string, diagnostics?: QueryBrowserDiagnostics | undefined, errorDetails?: ErrorDiagnostics | undefined);
|
|
39
41
|
}
|
|
40
42
|
export type QueryBrowserResult = {
|
|
41
43
|
rows?: Record<string, unknown>[];
|
|
@@ -74,19 +76,19 @@ export type QueryBrowserResultContext = {
|
|
|
74
76
|
};
|
|
75
77
|
export type QueryBrowserProps = {
|
|
76
78
|
id: string;
|
|
77
|
-
title?: string;
|
|
78
|
-
language?: QueryBrowserLanguage;
|
|
79
|
-
initialQuery?: string;
|
|
80
|
-
queryLabel?: string;
|
|
81
|
-
optionsSchema?: JsonSchemaObject;
|
|
82
|
-
initialOptions?: Record<string, unknown
|
|
83
|
-
completion?: QueryBrowserCompletion;
|
|
84
|
-
onQueryChange?: (query: string) => void;
|
|
85
|
-
onOptionsChange?: (options: Record<string, unknown>) => void;
|
|
86
|
-
navigator?: ReactNode;
|
|
79
|
+
title?: string | undefined;
|
|
80
|
+
language?: QueryBrowserLanguage | undefined;
|
|
81
|
+
initialQuery?: string | undefined;
|
|
82
|
+
queryLabel?: string | undefined;
|
|
83
|
+
optionsSchema?: JsonSchemaObject | undefined;
|
|
84
|
+
initialOptions?: Record<string, unknown> | undefined;
|
|
85
|
+
completion?: QueryBrowserCompletion | undefined;
|
|
86
|
+
onQueryChange?: ((query: string) => void) | undefined;
|
|
87
|
+
onOptionsChange?: ((options: Record<string, unknown>) => void) | undefined;
|
|
88
|
+
navigator?: ReactNode | undefined;
|
|
87
89
|
execute: (request: QueryBrowserRequest) => Promise<QueryBrowserResult>;
|
|
88
|
-
lookupFilterValues?: QueryBrowserFilterLookup;
|
|
89
|
-
renderResults?: (context: QueryBrowserResultContext) => ReactNode;
|
|
90
|
-
className?: string;
|
|
90
|
+
lookupFilterValues?: QueryBrowserFilterLookup | undefined;
|
|
91
|
+
renderResults?: ((context: QueryBrowserResultContext) => ReactNode) | undefined;
|
|
92
|
+
className?: string | undefined;
|
|
91
93
|
};
|
|
92
94
|
//# sourceMappingURL=QueryBrowser.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBrowser.types.d.ts","sourceRoot":"","sources":["../../../src/data/query-browser/QueryBrowser.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU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AAC,GAAG,SAAS,CAAC;IAChF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
class QueryBrowserExecutionError extends Error {
|
|
2
|
-
constructor(message, diagnostics) {
|
|
2
|
+
constructor(message, diagnostics, errorDetails) {
|
|
3
3
|
super(message);
|
|
4
4
|
this.diagnostics = diagnostics;
|
|
5
|
+
this.errorDetails = errorDetails;
|
|
5
6
|
this.name = "QueryBrowserExecutionError";
|
|
6
7
|
}
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBrowser.types.js","sources":["../../../src/data/query-browser/QueryBrowser.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport type { DataTableFilterSelection } from \"../data-table-filter-values\";\nimport type {\n DataTableFilterLookupRequest,\n DataTableFilterLookupResult,\n DataTableServerColumn,\n} from \"../data-table-server-filters\";\nimport type { QueryBrowserCompletion } from \"./QueryBrowser.completion\";\nimport type { QueryBrowserLanguage } from \"./QueryBrowser.editor\";\n\nexport type QueryBrowserPagination = {\n mode: \"offset\" | \"cursor\";\n limit: number;\n offset?: number;\n cursor?: string;\n nextCursor?: string;\n hasMore: boolean;\n total?: number;\n totalRelation: \"eq\" | \"gte\" | \"unknown\";\n consistency: \"live\" | \"snapshot\";\n};\n\nexport type QueryBrowserDiagnostics = {\n provider: string;\n request: {\n query?: string;\n arguments?: unknown[];\n options?: Record<string, unknown>;\n details?: Record<string, unknown>;\n };\n response?: {\n durationMs?: number;\n returnedRows?: number;\n details?: Record<string, unknown>;\n preview?: string;\n contentType?: string;\n truncated?: boolean;\n };\n error?: string;\n};\n\nexport class QueryBrowserExecutionError extends Error {\n constructor(\n message: string,\n readonly diagnostics?: QueryBrowserDiagnostics,\n ) {\n super(message);\n this.name = \"QueryBrowserExecutionError\";\n }\n}\n\nexport type QueryBrowserResult = {\n rows?: Record<string, unknown>[];\n columns?: DataTableServerColumn[];\n affectedRows?: number;\n durationMs?: number;\n message?: string;\n truncated?: boolean;\n limit?: number;\n metadata?: Record<string, unknown>;\n pagination?: QueryBrowserPagination;\n diagnostics?: QueryBrowserDiagnostics;\n};\n\nexport type QueryBrowserRequest = {\n query: string;\n options: Record<string, unknown>;\n filters?: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n pagination?: { limit: number; offset?: number; cursor?: string };\n debug?: boolean;\n};\n\nexport type QueryBrowserFilterLookupRequest = DataTableFilterLookupRequest & {\n query: string;\n options: Record<string, unknown>;\n filters: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n};\n\nexport type QueryBrowserFilterLookup = (\n request: QueryBrowserFilterLookupRequest,\n) => Promise<DataTableFilterLookupResult>;\n\nexport type QueryBrowserResultContext = {\n result: QueryBrowserResult;\n defaultView: ReactNode;\n};\n\nexport type QueryBrowserProps = {\n id: string;\n title?: string;\n language?: QueryBrowserLanguage;\n initialQuery?: string;\n queryLabel?: string;\n optionsSchema?: JsonSchemaObject;\n initialOptions?: Record<string, unknown
|
|
1
|
+
{"version":3,"file":"QueryBrowser.types.js","sources":["../../../src/data/query-browser/QueryBrowser.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport type { ErrorDiagnostics } from \"../diagnostics/error-diagnostics\";\nimport type { DataTableFilterSelection } from \"../data-table-filter-values\";\nimport type {\n DataTableFilterLookupRequest,\n DataTableFilterLookupResult,\n DataTableServerColumn,\n} from \"../data-table-server-filters\";\nimport type { QueryBrowserCompletion } from \"./QueryBrowser.completion\";\nimport type { QueryBrowserLanguage } from \"./QueryBrowser.editor\";\n\nexport type QueryBrowserPagination = {\n mode: \"offset\" | \"cursor\";\n limit: number;\n offset?: number;\n cursor?: string;\n nextCursor?: string;\n hasMore: boolean;\n total?: number;\n totalRelation: \"eq\" | \"gte\" | \"unknown\";\n consistency: \"live\" | \"snapshot\";\n};\n\nexport type QueryBrowserDiagnostics = {\n provider: string;\n request: {\n query?: string;\n arguments?: unknown[];\n options?: Record<string, unknown>;\n details?: Record<string, unknown>;\n };\n response?: {\n durationMs?: number;\n returnedRows?: number;\n details?: Record<string, unknown>;\n preview?: string;\n contentType?: string;\n truncated?: boolean;\n };\n error?: string;\n};\n\nexport class QueryBrowserExecutionError extends Error {\n constructor(\n message: string,\n readonly diagnostics?: QueryBrowserDiagnostics,\n readonly errorDetails?: ErrorDiagnostics,\n ) {\n super(message);\n this.name = \"QueryBrowserExecutionError\";\n }\n}\n\nexport type QueryBrowserResult = {\n rows?: Record<string, unknown>[];\n columns?: DataTableServerColumn[];\n affectedRows?: number;\n durationMs?: number;\n message?: string;\n truncated?: boolean;\n limit?: number;\n metadata?: Record<string, unknown>;\n pagination?: QueryBrowserPagination;\n diagnostics?: QueryBrowserDiagnostics;\n};\n\nexport type QueryBrowserRequest = {\n query: string;\n options: Record<string, unknown>;\n filters?: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n pagination?: { limit: number; offset?: number; cursor?: string };\n debug?: boolean;\n};\n\nexport type QueryBrowserFilterLookupRequest = DataTableFilterLookupRequest & {\n query: string;\n options: Record<string, unknown>;\n filters: DataTableFilterSelection;\n columns?: DataTableServerColumn[];\n};\n\nexport type QueryBrowserFilterLookup = (\n request: QueryBrowserFilterLookupRequest,\n) => Promise<DataTableFilterLookupResult>;\n\nexport type QueryBrowserResultContext = {\n result: QueryBrowserResult;\n defaultView: ReactNode;\n};\n\n// The optional props admit an explicit `undefined` — the same convention the\n// rest of the package follows (see data/CodeBlock.tsx). Passing a\n// possibly-absent value straight through, `className={maybe}`, is ordinary\n// React, and under exactOptionalPropertyTypes a bare `?:` rejects it.\nexport type QueryBrowserProps = {\n id: string;\n title?: string | undefined;\n language?: QueryBrowserLanguage | undefined;\n initialQuery?: string | undefined;\n queryLabel?: string | undefined;\n optionsSchema?: JsonSchemaObject | undefined;\n initialOptions?: Record<string, unknown> | undefined;\n completion?: QueryBrowserCompletion | undefined;\n onQueryChange?: ((query: string) => void) | undefined;\n onOptionsChange?: ((options: Record<string, unknown>) => void) | undefined;\n navigator?: ReactNode | undefined;\n execute: (request: QueryBrowserRequest) => Promise<QueryBrowserResult>;\n lookupFilterValues?: QueryBrowserFilterLookup | undefined;\n renderResults?: ((context: QueryBrowserResultContext) => ReactNode) | undefined;\n className?: string | undefined;\n};\n"],"names":[],"mappings":"AA2CO,MAAM,mCAAmC,MAAM;AAAA,EACpD,YACE,SACS,aACA,cACT;AACA,UAAM,OAAO;AAHJ,SAAA,cAAA;AACA,SAAA,eAAA;AAGT,SAAK,OAAO;AAAA,EACd;AACF;"}
|
|
@@ -15,9 +15,9 @@ function detectMode() {
|
|
|
15
15
|
}
|
|
16
16
|
function getVersionInfo() {
|
|
17
17
|
return {
|
|
18
|
-
commit: read(() => "
|
|
19
|
-
tag: read(() => "clicky-ui@0.3.
|
|
20
|
-
date: read(() => "2026-08-
|
|
18
|
+
commit: read(() => "3d52e20c", ""),
|
|
19
|
+
tag: read(() => "clicky-ui@0.3.19", ""),
|
|
20
|
+
date: read(() => "2026-08-12T05:39:11.065Z", ""),
|
|
21
21
|
dirty: read(() => true, false),
|
|
22
22
|
mode: detectMode()
|
|
23
23
|
};
|
|
@@ -13,9 +13,9 @@ function detectMode() {
|
|
|
13
13
|
}
|
|
14
14
|
function getVersionInfo() {
|
|
15
15
|
return {
|
|
16
|
-
commit: read(() => "
|
|
17
|
-
tag: read(() => "clicky-ui@0.3.
|
|
18
|
-
date: read(() => "2026-08-
|
|
16
|
+
commit: read(() => "3d52e20c", ""),
|
|
17
|
+
tag: read(() => "clicky-ui@0.3.19", ""),
|
|
18
|
+
date: read(() => "2026-08-12T05:38:48.796Z", ""),
|
|
19
19
|
dirty: read(() => true, false),
|
|
20
20
|
mode: detectMode()
|
|
21
21
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -61,6 +61,7 @@ const iconMenuPicker = require("./components/icon-menu-picker.cjs");
|
|
|
61
61
|
const ListMenu = require("./components/ListMenu.cjs");
|
|
62
62
|
const useListMenuSelection = require("./components/use-list-menu-selection.cjs");
|
|
63
63
|
const JsonSchemaForm = require("./components/JsonSchemaForm.cjs");
|
|
64
|
+
const unitFormExtension = require("./components/unit-form-extension.cjs");
|
|
64
65
|
const FormLookupProvider = require("./components/FormLookupProvider.cjs");
|
|
65
66
|
const formLookupContext = require("./components/form-lookup-context.cjs");
|
|
66
67
|
const jsonSchemaFormSize = require("./components/json-schema-form-size.cjs");
|
|
@@ -666,6 +667,9 @@ exports.ListMenuItem = ListMenu.ListMenuItem;
|
|
|
666
667
|
exports.ListMenuSection = ListMenu.ListMenuSection;
|
|
667
668
|
exports.useListMenuSelection = useListMenuSelection.useListMenuSelection;
|
|
668
669
|
exports.JsonSchemaForm = JsonSchemaForm.JsonSchemaForm;
|
|
670
|
+
exports.createUnitFormExtensions = unitFormExtension.createUnitFormExtensions;
|
|
671
|
+
exports.formatUnitAwareValue = unitFormExtension.formatUnitAwareValue;
|
|
672
|
+
exports.parseUnitAwareValue = unitFormExtension.parseUnitAwareValue;
|
|
669
673
|
exports.FormLookupProvider = FormLookupProvider.FormLookupProvider;
|
|
670
674
|
exports.resolveLookupScope = formLookupContext.resolveLookupScope;
|
|
671
675
|
exports.useLookupFetcher = formLookupContext.useLookupFetcher;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ import { IconMenuPicker } from "./components/icon-menu-picker.js";
|
|
|
59
59
|
import { ListMenu, ListMenuActionBar, ListMenuHeader, ListMenuItem, ListMenuSection } from "./components/ListMenu.js";
|
|
60
60
|
import { useListMenuSelection } from "./components/use-list-menu-selection.js";
|
|
61
61
|
import { JsonSchemaForm } from "./components/JsonSchemaForm.js";
|
|
62
|
+
import { createUnitFormExtensions, formatUnitAwareValue, parseUnitAwareValue } from "./components/unit-form-extension.js";
|
|
62
63
|
import { FormLookupProvider } from "./components/FormLookupProvider.js";
|
|
63
64
|
import { resolveLookupScope, useLookupFetcher } from "./components/form-lookup-context.js";
|
|
64
65
|
import { DEFAULT_FORM_SIZE } from "./components/json-schema-form-size.js";
|
|
@@ -1412,6 +1413,7 @@ export {
|
|
|
1412
1413
|
createOperationsApiClient,
|
|
1413
1414
|
createSecretFormExtensions,
|
|
1414
1415
|
createTestRunnerRegistry,
|
|
1416
|
+
createUnitFormExtensions,
|
|
1415
1417
|
cycleFilterState,
|
|
1416
1418
|
decodeFilterState,
|
|
1417
1419
|
defaultStatusValue,
|
|
@@ -1455,6 +1457,7 @@ export {
|
|
|
1455
1457
|
formatTestDuration,
|
|
1456
1458
|
formatTimestamp,
|
|
1457
1459
|
formatUnit,
|
|
1460
|
+
formatUnitAwareValue,
|
|
1458
1461
|
frameHasSource,
|
|
1459
1462
|
frameworkIcon,
|
|
1460
1463
|
getChangeIcon,
|
|
@@ -1520,6 +1523,7 @@ export {
|
|
|
1520
1523
|
parseStackDump,
|
|
1521
1524
|
parseTimestamp,
|
|
1522
1525
|
parseUnifiedDiff,
|
|
1526
|
+
parseUnitAwareValue,
|
|
1523
1527
|
parseWorkloadKey,
|
|
1524
1528
|
pathParamNames,
|
|
1525
1529
|
preferredEndpointPort,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/lib/string.cjs
CHANGED
|
@@ -10,6 +10,14 @@ function stripTrailingSlashes(value) {
|
|
|
10
10
|
while (end > 0 && value[end - 1] === "/") end--;
|
|
11
11
|
return value.slice(0, end);
|
|
12
12
|
}
|
|
13
|
+
function stripSurroundingDashes(value) {
|
|
14
|
+
let start = 0;
|
|
15
|
+
let end = value.length;
|
|
16
|
+
while (start < end && value[start] === "-") start++;
|
|
17
|
+
while (end > start && value[end - 1] === "-") end--;
|
|
18
|
+
return value.slice(start, end);
|
|
19
|
+
}
|
|
13
20
|
exports.stripLeadingSlashes = stripLeadingSlashes;
|
|
21
|
+
exports.stripSurroundingDashes = stripSurroundingDashes;
|
|
14
22
|
exports.stripTrailingSlashes = stripTrailingSlashes;
|
|
15
23
|
//# sourceMappingURL=string.cjs.map
|
package/dist/lib/string.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.cjs","sources":["../../src/lib/string.ts"],"sourcesContent":["export function stripLeadingSlashes(value: string): string {\n let start = 0;\n while (start < value.length && value[start] === \"/\") start++;\n return value.slice(start);\n}\n\nexport function stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value[end - 1] === \"/\") end--;\n return value.slice(0, end);\n}\n"],"names":[],"mappings":";;AAAO,SAAS,oBAAoB,OAAuB;AACzD,MAAI,QAAQ;AACZ,SAAO,QAAQ,MAAM,UAAU,MAAM,KAAK,MAAM,IAAK;AACrD,SAAO,MAAM,MAAM,KAAK;AAC1B;AAEO,SAAS,qBAAqB,OAAuB;AAC1D,MAAI,MAAM,MAAM;AAChB,SAAO,MAAM,KAAK,MAAM,MAAM,CAAC,MAAM,IAAK;AAC1C,SAAO,MAAM,MAAM,GAAG,GAAG;AAC3B
|
|
1
|
+
{"version":3,"file":"string.cjs","sources":["../../src/lib/string.ts"],"sourcesContent":["export function stripLeadingSlashes(value: string): string {\n let start = 0;\n while (start < value.length && value[start] === \"/\") start++;\n return value.slice(start);\n}\n\nexport function stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value[end - 1] === \"/\") end--;\n return value.slice(0, end);\n}\n\n// Linear scan instead of `.replace(/^-+|-+$/g, \"\")`: the anchored `-+`\n// alternatives backtrack polynomially on slugs made of many dashes.\nexport function stripSurroundingDashes(value: string): string {\n let start = 0;\n let end = value.length;\n while (start < end && value[start] === \"-\") start++;\n while (end > start && value[end - 1] === \"-\") end--;\n return value.slice(start, end);\n}\n"],"names":[],"mappings":";;AAAO,SAAS,oBAAoB,OAAuB;AACzD,MAAI,QAAQ;AACZ,SAAO,QAAQ,MAAM,UAAU,MAAM,KAAK,MAAM,IAAK;AACrD,SAAO,MAAM,MAAM,KAAK;AAC1B;AAEO,SAAS,qBAAqB,OAAuB;AAC1D,MAAI,MAAM,MAAM;AAChB,SAAO,MAAM,KAAK,MAAM,MAAM,CAAC,MAAM,IAAK;AAC1C,SAAO,MAAM,MAAM,GAAG,GAAG;AAC3B;AAIO,SAAS,uBAAuB,OAAuB;AAC5D,MAAI,QAAQ;AACZ,MAAI,MAAM,MAAM;AAChB,SAAO,QAAQ,OAAO,MAAM,KAAK,MAAM,IAAK;AAC5C,SAAO,MAAM,SAAS,MAAM,MAAM,CAAC,MAAM,IAAK;AAC9C,SAAO,MAAM,MAAM,OAAO,GAAG;AAC/B;;;;"}
|
package/dist/lib/string.d.ts
CHANGED
package/dist/lib/string.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/lib/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI1D"}
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/lib/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI1D;AAID,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM5D"}
|
package/dist/lib/string.js
CHANGED
|
@@ -8,8 +8,16 @@ function stripTrailingSlashes(value) {
|
|
|
8
8
|
while (end > 0 && value[end - 1] === "/") end--;
|
|
9
9
|
return value.slice(0, end);
|
|
10
10
|
}
|
|
11
|
+
function stripSurroundingDashes(value) {
|
|
12
|
+
let start = 0;
|
|
13
|
+
let end = value.length;
|
|
14
|
+
while (start < end && value[start] === "-") start++;
|
|
15
|
+
while (end > start && value[end - 1] === "-") end--;
|
|
16
|
+
return value.slice(start, end);
|
|
17
|
+
}
|
|
11
18
|
export {
|
|
12
19
|
stripLeadingSlashes,
|
|
20
|
+
stripSurroundingDashes,
|
|
13
21
|
stripTrailingSlashes
|
|
14
22
|
};
|
|
15
23
|
//# sourceMappingURL=string.js.map
|
package/dist/lib/string.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sources":["../../src/lib/string.ts"],"sourcesContent":["export function stripLeadingSlashes(value: string): string {\n let start = 0;\n while (start < value.length && value[start] === \"/\") start++;\n return value.slice(start);\n}\n\nexport function stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value[end - 1] === \"/\") end--;\n return value.slice(0, end);\n}\n"],"names":[],"mappings":"AAAO,SAAS,oBAAoB,OAAuB;AACzD,MAAI,QAAQ;AACZ,SAAO,QAAQ,MAAM,UAAU,MAAM,KAAK,MAAM,IAAK;AACrD,SAAO,MAAM,MAAM,KAAK;AAC1B;AAEO,SAAS,qBAAqB,OAAuB;AAC1D,MAAI,MAAM,MAAM;AAChB,SAAO,MAAM,KAAK,MAAM,MAAM,CAAC,MAAM,IAAK;AAC1C,SAAO,MAAM,MAAM,GAAG,GAAG;AAC3B;"}
|
|
1
|
+
{"version":3,"file":"string.js","sources":["../../src/lib/string.ts"],"sourcesContent":["export function stripLeadingSlashes(value: string): string {\n let start = 0;\n while (start < value.length && value[start] === \"/\") start++;\n return value.slice(start);\n}\n\nexport function stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value[end - 1] === \"/\") end--;\n return value.slice(0, end);\n}\n\n// Linear scan instead of `.replace(/^-+|-+$/g, \"\")`: the anchored `-+`\n// alternatives backtrack polynomially on slugs made of many dashes.\nexport function stripSurroundingDashes(value: string): string {\n let start = 0;\n let end = value.length;\n while (start < end && value[start] === \"-\") start++;\n while (end > start && value[end - 1] === \"-\") end--;\n return value.slice(start, end);\n}\n"],"names":[],"mappings":"AAAO,SAAS,oBAAoB,OAAuB;AACzD,MAAI,QAAQ;AACZ,SAAO,QAAQ,MAAM,UAAU,MAAM,KAAK,MAAM,IAAK;AACrD,SAAO,MAAM,MAAM,KAAK;AAC1B;AAEO,SAAS,qBAAqB,OAAuB;AAC1D,MAAI,MAAM,MAAM;AAChB,SAAO,MAAM,KAAK,MAAM,MAAM,CAAC,MAAM,IAAK;AAC1C,SAAO,MAAM,MAAM,GAAG,GAAG;AAC3B;AAIO,SAAS,uBAAuB,OAAuB;AAC5D,MAAI,QAAQ;AACZ,MAAI,MAAM,MAAM;AAChB,SAAO,QAAQ,OAAO,MAAM,KAAK,MAAM,IAAK;AAC5C,SAAO,MAAM,SAAS,MAAM,MAAM,CAAC,MAAM,IAAK;AAC9C,SAAO,MAAM,MAAM,OAAO,GAAG;AAC/B;"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const Icon = require("../data/Icon.cjs");
|
|
5
|
+
const TreeNode = require("../data/TreeNode.cjs");
|
|
6
|
+
const UiSqlDatabase = require("../icons/components/UiSqlDatabase.cjs");
|
|
7
|
+
const UiDatabase = require("../icons/components/UiDatabase.cjs");
|
|
8
|
+
const UiActivity = require("../icons/components/UiActivity.cjs");
|
|
9
|
+
const UiLink = require("../icons/components/UiLink.cjs");
|
|
10
|
+
const UiSqlIndex = require("../icons/components/UiSqlIndex.cjs");
|
|
11
|
+
const UiSqlColumn = require("../icons/components/UiSqlColumn.cjs");
|
|
12
|
+
const UiSqlView = require("../icons/components/UiSqlView.cjs");
|
|
13
|
+
const UiTable = require("../icons/components/UiTable.cjs");
|
|
14
|
+
const UiNamespace = require("../icons/components/UiNamespace.cjs");
|
|
15
|
+
function CatalogTree({
|
|
16
|
+
nodes,
|
|
17
|
+
loading,
|
|
18
|
+
error,
|
|
19
|
+
databases,
|
|
20
|
+
database,
|
|
21
|
+
onDatabaseChange,
|
|
22
|
+
onSelect
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col overflow-auto border-r bg-card p-2", children: [
|
|
25
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "flex items-center gap-1.5 px-2 py-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: [
|
|
26
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { icon: UiSqlDatabase.UiSqlDatabase, className: "size-3.5" }),
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Catalog" })
|
|
28
|
+
] }),
|
|
29
|
+
databases.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "mb-2 block px-2 text-xs text-muted-foreground", children: [
|
|
30
|
+
"Database",
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
"select",
|
|
33
|
+
{
|
|
34
|
+
"aria-label": "Database",
|
|
35
|
+
value: database,
|
|
36
|
+
onChange: (event) => onDatabaseChange(event.target.value),
|
|
37
|
+
className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-xs text-foreground",
|
|
38
|
+
children: databases.map((name) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: name, children: name }, name))
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }) : null,
|
|
42
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-xs text-muted-foreground", children: "Loading catalog…" }),
|
|
43
|
+
error ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
role: "alert",
|
|
47
|
+
className: "m-2 rounded-md border border-destructive/30 bg-destructive/5 p-2 text-xs text-destructive",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: "Unable to load catalog" }),
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 break-words", children: catalogErrorMessage(error) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
) : null,
|
|
54
|
+
!loading && !error && nodes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-xs text-muted-foreground", children: "No catalog objects found." }) : null,
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
CatalogNodes,
|
|
57
|
+
{
|
|
58
|
+
nodes,
|
|
59
|
+
onSelect
|
|
60
|
+
},
|
|
61
|
+
database || "catalog"
|
|
62
|
+
)
|
|
63
|
+
] });
|
|
64
|
+
}
|
|
65
|
+
function catalogErrorMessage(error) {
|
|
66
|
+
if (error instanceof Error && error.message.trim()) {
|
|
67
|
+
return error.message.trim();
|
|
68
|
+
}
|
|
69
|
+
if (typeof error === "string" && error.trim()) {
|
|
70
|
+
return error.trim();
|
|
71
|
+
}
|
|
72
|
+
return "The catalog request failed. Check the connection settings and try again.";
|
|
73
|
+
}
|
|
74
|
+
function CatalogNodes({
|
|
75
|
+
nodes,
|
|
76
|
+
onSelect
|
|
77
|
+
}) {
|
|
78
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tree", className: "min-w-0", children: nodes.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
TreeNode.TreeNode,
|
|
80
|
+
{
|
|
81
|
+
node,
|
|
82
|
+
getKey: (item) => item.id,
|
|
83
|
+
getChildren: (item) => item.children,
|
|
84
|
+
defaultOpen: (item) => item.kind === "schema",
|
|
85
|
+
isSecondary: (item) => item.kind === "column",
|
|
86
|
+
onSelect: (item) => {
|
|
87
|
+
if (item.query) onSelect(item);
|
|
88
|
+
},
|
|
89
|
+
indentPx: 14,
|
|
90
|
+
basePaddingPx: 8,
|
|
91
|
+
renderRow: ({ node: item }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
className: "flex min-w-0 flex-1 items-center gap-1.5 text-xs",
|
|
95
|
+
title: item.query ? `Load ${item.kind}` : item.kind,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
+
Icon.Icon,
|
|
99
|
+
{
|
|
100
|
+
icon: catalogIcon(item.kind),
|
|
101
|
+
className: "size-3.5 shrink-0 text-muted-foreground"
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: item.label })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
},
|
|
109
|
+
node.id
|
|
110
|
+
)) });
|
|
111
|
+
}
|
|
112
|
+
function catalogIcon(kind) {
|
|
113
|
+
switch (kind) {
|
|
114
|
+
case "schema":
|
|
115
|
+
return UiNamespace.UiNamespace;
|
|
116
|
+
case "table":
|
|
117
|
+
return UiTable.UiTable;
|
|
118
|
+
case "view":
|
|
119
|
+
return UiSqlView.UiSqlView;
|
|
120
|
+
case "column":
|
|
121
|
+
return UiSqlColumn.UiSqlColumn;
|
|
122
|
+
case "index":
|
|
123
|
+
return UiSqlIndex.UiSqlIndex;
|
|
124
|
+
case "alias":
|
|
125
|
+
return UiLink.UiLink;
|
|
126
|
+
case "data_stream":
|
|
127
|
+
return UiActivity.UiActivity;
|
|
128
|
+
default:
|
|
129
|
+
return UiDatabase.UiDatabase;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.CatalogTree = CatalogTree;
|
|
133
|
+
//# sourceMappingURL=catalogTree.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogTree.cjs","sources":["../../src/profiles/catalogTree.tsx"],"sourcesContent":["import { Icon } from \"../data/Icon\";\nimport { TreeNode } from \"../data/TreeNode\";\nimport {\n UiActivity,\n UiDatabase,\n UiLink,\n UiNamespace,\n UiSqlColumn,\n UiSqlDatabase,\n UiSqlIndex,\n UiSqlView,\n UiTable,\n} from \"../icons\";\nimport type { CatalogNode } from \"./connectionBrowserModel\";\n\nexport function CatalogTree({\n nodes,\n loading,\n error,\n databases,\n database,\n onDatabaseChange,\n onSelect,\n}: {\n nodes: CatalogNode[];\n loading: boolean;\n error: unknown;\n databases: string[];\n database: string;\n onDatabaseChange: (database: string) => void;\n onSelect: (node: CatalogNode) => void;\n}) {\n return (\n <div className=\"flex h-full min-h-0 flex-col overflow-auto border-r bg-card p-2\">\n <h3 className=\"flex items-center gap-1.5 px-2 py-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <Icon icon={UiSqlDatabase} className=\"size-3.5\" />\n <span>Catalog</span>\n </h3>\n {databases.length > 0 ? (\n <label className=\"mb-2 block px-2 text-xs text-muted-foreground\">\n Database\n <select\n aria-label=\"Database\"\n value={database}\n onChange={(event) => onDatabaseChange(event.target.value)}\n className=\"mt-1 h-8 w-full rounded-md border bg-background px-2 text-xs text-foreground\"\n >\n {databases.map((name) => (\n <option key={name} value={name}>\n {name}\n </option>\n ))}\n </select>\n </label>\n ) : null}\n {loading && (\n <div className=\"p-2 text-xs text-muted-foreground\">\n Loading catalog…\n </div>\n )}\n {error ? (\n <div\n role=\"alert\"\n className=\"m-2 rounded-md border border-destructive/30 bg-destructive/5 p-2 text-xs text-destructive\"\n >\n <p className=\"font-medium\">Unable to load catalog</p>\n <p className=\"mt-1 break-words\">{catalogErrorMessage(error)}</p>\n </div>\n ) : null}\n {!loading && !error && nodes.length === 0 ? (\n <div className=\"p-2 text-xs text-muted-foreground\">\n No catalog objects found.\n </div>\n ) : null}\n <CatalogNodes\n key={database || \"catalog\"}\n nodes={nodes}\n onSelect={onSelect}\n />\n </div>\n );\n}\n\nfunction catalogErrorMessage(error: unknown): string {\n if (error instanceof Error && error.message.trim()) {\n return error.message.trim();\n }\n if (typeof error === \"string\" && error.trim()) {\n return error.trim();\n }\n return \"The catalog request failed. Check the connection settings and try again.\";\n}\n\nfunction CatalogNodes({\n nodes,\n onSelect,\n}: {\n nodes: CatalogNode[];\n onSelect: (node: CatalogNode) => void;\n}) {\n return (\n <div role=\"tree\" className=\"min-w-0\">\n {nodes.map((node) => (\n <TreeNode\n key={node.id}\n node={node}\n getKey={(item) => item.id}\n getChildren={(item) => item.children}\n defaultOpen={(item) => item.kind === \"schema\"}\n isSecondary={(item) => item.kind === \"column\"}\n onSelect={(item) => {\n if (item.query) onSelect(item);\n }}\n indentPx={14}\n basePaddingPx={8}\n renderRow={({ node: item }) => (\n <div\n className=\"flex min-w-0 flex-1 items-center gap-1.5 text-xs\"\n title={item.query ? `Load ${item.kind}` : item.kind}\n >\n <Icon\n icon={catalogIcon(item.kind)}\n className=\"size-3.5 shrink-0 text-muted-foreground\"\n />\n <span className=\"truncate\">{item.label}</span>\n </div>\n )}\n />\n ))}\n </div>\n );\n}\n\nfunction catalogIcon(kind: string) {\n switch (kind) {\n case \"schema\":\n return UiNamespace;\n case \"table\":\n return UiTable;\n case \"view\":\n return UiSqlView;\n case \"column\":\n return UiSqlColumn;\n case \"index\":\n return UiSqlIndex;\n case \"alias\":\n return UiLink;\n case \"data_stream\":\n return UiActivity;\n default:\n return UiDatabase;\n }\n}\n"],"names":["jsxs","jsx","Icon","UiSqlDatabase","TreeNode","UiNamesp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AC,QAAA,EAAK,WAAU,YAAY,eAAK,MAAA,CAAM;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACzC;AAAA,IArBG,KAAK;AAAA,EAAA,CAwBb,GACH;AAEJ;AAEA,SAAS,YAAY,MAAc;AACjC,UAAQ,MAAA;AAAA,IACN,KAAK;AACH,aAAOI,YAAAA;AAAAA,IACT,KAAK;AACH,aAAOC,QAAAA;AAAAA,IACT,KAAK;AACH,aAAOC,UAAAA;AAAAA,IACT,KAAK;AACH,aAAOC,YAAAA;AAAAA,IACT,KAAK;AACH,aAAOC,WAAAA;AAAAA,IACT,KAAK;AACH,aAAOC,OAAAA;AAAAA,IACT,KAAK;AACH,aAAOC,WAAAA;AAAAA,IACT;AACE,aAAOC,WAAAA;AAAAA,EAAA;AAEb;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CatalogNode } from './connectionBrowserModel';
|
|
2
|
+
export declare function CatalogTree({ nodes, loading, error, databases, database, onDatabaseChange, onSelect, }: {
|
|
3
|
+
nodes: CatalogNode[];
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: unknown;
|
|
6
|
+
databases: string[];
|
|
7
|
+
database: string;
|
|
8
|
+
onDatabaseChange: (database: string) => void;
|
|
9
|
+
onSelect: (node: CatalogNode) => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=catalogTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogTree.d.ts","sourceRoot":"","sources":["../../src/profiles/catalogTree.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CACvC,2CAkDA"}
|