@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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const utils = require("../lib/utils.cjs");
|
|
5
|
+
const UnitStepControls = require("./UnitStepControls.cjs");
|
|
6
|
+
const COUNT_SCALES = [
|
|
7
|
+
{ label: "", multiplier: 1n },
|
|
8
|
+
{ label: "K", multiplier: 1000n },
|
|
9
|
+
{ label: "M", multiplier: 1000000n },
|
|
10
|
+
{ label: "B", multiplier: 1000000000n },
|
|
11
|
+
{ label: "T", multiplier: 1000000000000n }
|
|
12
|
+
];
|
|
13
|
+
const BYTE_SCALES = [
|
|
14
|
+
{ label: "B", multiplier: 1n },
|
|
15
|
+
{ label: "KiB", multiplier: 1024n },
|
|
16
|
+
{ label: "MiB", multiplier: 1048576n },
|
|
17
|
+
{ label: "GiB", multiplier: 1073741824n },
|
|
18
|
+
{ label: "TiB", multiplier: 1099511627776n }
|
|
19
|
+
];
|
|
20
|
+
const scales = (kind) => kind === "bytes" ? BYTE_SCALES : COUNT_SCALES;
|
|
21
|
+
function canonicalInteger(value) {
|
|
22
|
+
if (typeof value === "number") {
|
|
23
|
+
return Number.isSafeInteger(value) && value > 0 ? String(value) : null;
|
|
24
|
+
}
|
|
25
|
+
if (typeof value !== "string" || !/^[1-9][0-9]*$/.test(value)) return null;
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
function scaledDecimal(value, multiplier) {
|
|
29
|
+
const integer = value / multiplier;
|
|
30
|
+
let remainder = value % multiplier;
|
|
31
|
+
if (remainder === 0n) return String(integer);
|
|
32
|
+
let fraction = "";
|
|
33
|
+
while (remainder !== 0n && fraction.length < 3) {
|
|
34
|
+
remainder *= 10n;
|
|
35
|
+
fraction += String(remainder / multiplier);
|
|
36
|
+
remainder %= multiplier;
|
|
37
|
+
}
|
|
38
|
+
return remainder === 0n ? `${integer}.${fraction}` : null;
|
|
39
|
+
}
|
|
40
|
+
function formatUnitAwareValue(value, kind) {
|
|
41
|
+
const canonical = canonicalInteger(value);
|
|
42
|
+
if (canonical === null) return value;
|
|
43
|
+
const integer = BigInt(canonical);
|
|
44
|
+
for (const scale of scales(kind).toReversed()) {
|
|
45
|
+
if (integer < scale.multiplier) continue;
|
|
46
|
+
const amount = scaledDecimal(integer, scale.multiplier);
|
|
47
|
+
if (amount !== null) return `${amount}${scale.label}`;
|
|
48
|
+
}
|
|
49
|
+
return canonical;
|
|
50
|
+
}
|
|
51
|
+
function scaleForLabel(kind, label) {
|
|
52
|
+
if (kind === "count") {
|
|
53
|
+
return COUNT_SCALES.find((scale) => scale.label.toLowerCase() === label.toLowerCase());
|
|
54
|
+
}
|
|
55
|
+
const normalized = label.toLowerCase();
|
|
56
|
+
const aliases = {
|
|
57
|
+
"": "B",
|
|
58
|
+
k: "KiB",
|
|
59
|
+
kb: "KiB",
|
|
60
|
+
m: "MiB",
|
|
61
|
+
mb: "MiB",
|
|
62
|
+
g: "GiB",
|
|
63
|
+
gb: "GiB",
|
|
64
|
+
t: "TiB",
|
|
65
|
+
tb: "TiB"
|
|
66
|
+
};
|
|
67
|
+
const canonical = aliases[normalized] ?? label;
|
|
68
|
+
return BYTE_SCALES.find((scale) => scale.label.toLowerCase() === canonical.toLowerCase());
|
|
69
|
+
}
|
|
70
|
+
function parseUnitAwareValue(value, kind) {
|
|
71
|
+
const match = value.trim().replaceAll(",", "").replaceAll("_", "").match(
|
|
72
|
+
/^(\d+(?:\.\d+)?|\.\d+)\s*([a-zA-Z]*)$/
|
|
73
|
+
);
|
|
74
|
+
if (!match) return null;
|
|
75
|
+
const amount = match[1];
|
|
76
|
+
const scale = scaleForLabel(kind, match[2] ?? "");
|
|
77
|
+
if (!amount || !scale) return null;
|
|
78
|
+
const [whole, fraction = ""] = amount.split(".");
|
|
79
|
+
const denominator = 10n ** BigInt(fraction.length);
|
|
80
|
+
const numerator = BigInt(`${whole || "0"}${fraction}`) * scale.multiplier;
|
|
81
|
+
if (numerator % denominator !== 0n) return null;
|
|
82
|
+
const canonical = numerator / denominator;
|
|
83
|
+
return canonical > 0n ? String(canonical) : null;
|
|
84
|
+
}
|
|
85
|
+
function unitKind(field) {
|
|
86
|
+
const unit = field.schema["x-clicky-unit"];
|
|
87
|
+
return unit === "count" || unit === "bytes" ? unit : null;
|
|
88
|
+
}
|
|
89
|
+
function steppedValue(value, direction) {
|
|
90
|
+
const canonical = canonicalInteger(value);
|
|
91
|
+
if (canonical === null) return null;
|
|
92
|
+
const integer = BigInt(canonical);
|
|
93
|
+
const next = direction === "increase" ? integer * 2n : integer / 2n;
|
|
94
|
+
return next > 0n ? String(next) : null;
|
|
95
|
+
}
|
|
96
|
+
function createUnitFormExtensions() {
|
|
97
|
+
const pre = (field) => {
|
|
98
|
+
const kind = unitKind(field);
|
|
99
|
+
if (!kind) return field;
|
|
100
|
+
return {
|
|
101
|
+
...field,
|
|
102
|
+
value: formatUnitAwareValue(field.value, kind),
|
|
103
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
+
UnitStepControls.UnitStepControls,
|
|
105
|
+
{
|
|
106
|
+
label: field.label,
|
|
107
|
+
suffix: field.suffix,
|
|
108
|
+
decrease: steppedValue(field.value, "decrease"),
|
|
109
|
+
increase: steppedValue(field.value, "increase"),
|
|
110
|
+
schemaReadOnly: field.readOnly === true,
|
|
111
|
+
onChange: field.onChange
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
inputClassName: utils.cn(field.inputClassName, field.suffix ? "pr-28" : "pr-20"),
|
|
115
|
+
onChange: (next) => {
|
|
116
|
+
const text = typeof next === "string" ? next : String(next ?? "");
|
|
117
|
+
field.onChange(parseUnitAwareValue(text, kind) ?? text);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
return { pre: [pre] };
|
|
122
|
+
}
|
|
123
|
+
exports.createUnitFormExtensions = createUnitFormExtensions;
|
|
124
|
+
exports.formatUnitAwareValue = formatUnitAwareValue;
|
|
125
|
+
exports.parseUnitAwareValue = parseUnitAwareValue;
|
|
126
|
+
//# sourceMappingURL=unit-form-extension.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-form-extension.cjs","sources":["../../src/components/unit-form-extension.tsx"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { UnitStepControls } from \"./UnitStepControls\";\nimport type { FieldControl, PreExtension } from \"./json-schema-form-types\";\n\nexport type UnitInputKind = \"count\" | \"bytes\";\n\ntype UnitScale = {\n label: string;\n multiplier: bigint;\n};\n\nconst COUNT_SCALES: UnitScale[] = [\n { label: \"\", multiplier: 1n },\n { label: \"K\", multiplier: 1_000n },\n { label: \"M\", multiplier: 1_000_000n },\n { label: \"B\", multiplier: 1_000_000_000n },\n { label: \"T\", multiplier: 1_000_000_000_000n },\n];\n\nconst BYTE_SCALES: UnitScale[] = [\n { label: \"B\", multiplier: 1n },\n { label: \"KiB\", multiplier: 1_024n },\n { label: \"MiB\", multiplier: 1_048_576n },\n { label: \"GiB\", multiplier: 1_073_741_824n },\n { label: \"TiB\", multiplier: 1_099_511_627_776n },\n];\n\nconst scales = (kind: UnitInputKind) => kind === \"bytes\" ? BYTE_SCALES : COUNT_SCALES;\n\nfunction canonicalInteger(value: unknown): string | null {\n if (typeof value === \"number\") {\n return Number.isSafeInteger(value) && value > 0 ? String(value) : null;\n }\n if (typeof value !== \"string\" || !/^[1-9][0-9]*$/.test(value)) return null;\n return value;\n}\n\nfunction scaledDecimal(value: bigint, multiplier: bigint): string | null {\n const integer = value / multiplier;\n let remainder = value % multiplier;\n if (remainder === 0n) return String(integer);\n\n let fraction = \"\";\n while (remainder !== 0n && fraction.length < 3) {\n remainder *= 10n;\n fraction += String(remainder / multiplier);\n remainder %= multiplier;\n }\n return remainder === 0n ? `${integer}.${fraction}` : null;\n}\n\nexport function formatUnitAwareValue(value: unknown, kind: UnitInputKind): unknown {\n const canonical = canonicalInteger(value);\n if (canonical === null) return value;\n\n const integer = BigInt(canonical);\n for (const scale of scales(kind).toReversed()) {\n if (integer < scale.multiplier) continue;\n const amount = scaledDecimal(integer, scale.multiplier);\n if (amount !== null) return `${amount}${scale.label}`;\n }\n return canonical;\n}\n\nfunction scaleForLabel(kind: UnitInputKind, label: string): UnitScale | undefined {\n if (kind === \"count\") {\n return COUNT_SCALES.find((scale) => scale.label.toLowerCase() === label.toLowerCase());\n }\n const normalized = label.toLowerCase();\n const aliases: Record<string, string> = {\n \"\": \"B\",\n k: \"KiB\",\n kb: \"KiB\",\n m: \"MiB\",\n mb: \"MiB\",\n g: \"GiB\",\n gb: \"GiB\",\n t: \"TiB\",\n tb: \"TiB\",\n };\n const canonical = aliases[normalized] ?? label;\n return BYTE_SCALES.find((scale) => scale.label.toLowerCase() === canonical.toLowerCase());\n}\n\nexport function parseUnitAwareValue(value: string, kind: UnitInputKind): string | null {\n const match = value.trim().replaceAll(\",\", \"\").replaceAll(\"_\", \"\").match(\n /^(\\d+(?:\\.\\d+)?|\\.\\d+)\\s*([a-zA-Z]*)$/,\n );\n if (!match) return null;\n\n const amount = match[1];\n const scale = scaleForLabel(kind, match[2] ?? \"\");\n if (!amount || !scale) return null;\n const [whole, fraction = \"\"] = amount.split(\".\");\n const denominator = 10n ** BigInt(fraction.length);\n const numerator = BigInt(`${whole || \"0\"}${fraction}`) * scale.multiplier;\n if (numerator % denominator !== 0n) return null;\n\n const canonical = numerator / denominator;\n return canonical > 0n ? String(canonical) : null;\n}\n\nfunction unitKind(field: FieldControl): UnitInputKind | null {\n const unit = field.schema[\"x-clicky-unit\"];\n return unit === \"count\" || unit === \"bytes\" ? unit : null;\n}\n\nfunction steppedValue(value: unknown, direction: \"decrease\" | \"increase\"): string | null {\n const canonical = canonicalInteger(value);\n if (canonical === null) return null;\n const integer = BigInt(canonical);\n const next = direction === \"increase\" ? integer * 2n : integer / 2n;\n return next > 0n ? String(next) : null;\n}\n\nexport function createUnitFormExtensions(): { pre: PreExtension[] } {\n const pre: PreExtension = (field) => {\n const kind = unitKind(field);\n if (!kind) return field;\n return {\n ...field,\n value: formatUnitAwareValue(field.value, kind),\n suffix: (\n <UnitStepControls\n label={field.label}\n suffix={field.suffix}\n decrease={steppedValue(field.value, \"decrease\")}\n increase={steppedValue(field.value, \"increase\")}\n schemaReadOnly={field.readOnly === true}\n onChange={field.onChange}\n />\n ),\n inputClassName: cn(field.inputClassName, field.suffix ? \"pr-28\" : \"pr-20\"),\n onChange: (next) => {\n const text = typeof next === \"string\" ? next : String(next ?? \"\");\n field.onChange(parseUnitAwareValue(text, kind) ?? text);\n },\n };\n };\n return { pre: [pre] };\n}\n"],"names":["jsx","UnitStepControls","cn"],"mappings":";;;;;AAWA,MAAM,eAA4B;AAAA,EAChC,EAAE,OAAO,IAAI,YAAY,GAAA;AAAA,EACzB,EAAE,OAAO,KAAK,YAAY,MAAA;AAAA,EAC1B,EAAE,OAAO,KAAK,YAAY,SAAA;AAAA,EAC1B,EAAE,OAAO,KAAK,YAAY,YAAA;AAAA,EAC1B,EAAE,OAAO,KAAK,YAAY,eAAA;AAC5B;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,SAAS;AAChC,QAAM,OAAO,cAAc,aAAa,UAAU,KAAK,UAAU;AACjE,SAAO,OAAO,KAAK,OAAO,IAAI,IAAI;AACpC;AAEO,SAAS,2BAAoD;AAClE,QAAM,MAAoB,CAAC,UAAU;AACnC,UAAM,OAAO,SAAS,KAAK;AAC3B,QAAI,CAAC,KAAM,QAAO;AAClB,WAAO;AAAA,MACL,GAAG;AAAA,MACH,OAAO,qBAAqB,MAAM,OAAO,IAAI;AAAA,MAC7C,QACEA,2BAAAA;AAAAA,QAACC,iBAAAA;AAAAA,QAAA;AAAA,UACC,OAAO,MAAM;AAAA,UACb,QAAQ,MAAM;AAAA,UACd,UAAU,aAAa,MAAM,OAAO,UAAU;AAAA,UAC9C,UAAU,aAAa,MAAM,OAAO,UAAU;AAAA,UAC9C,gBAAgB,MAAM,aAAa;AAAA,UACnC,UAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,MAGpB,gBAAgBC,MAAAA,GAAG,MAAM,gBAAgB,MAAM,SAAS,UAAU,OAAO;AAAA,MACzE,UAAU,CAAC,SAAS;AAClB,cAAM,OAAO,OAAO,SAAS,WAAW,OAAO,OAAO,QAAQ,EAAE;AAChE,cAAM,SAAS,oBAAoB,MAAM,IAAI,KAAK,IAAI;AAAA,MACxD;AAAA,IAAA;AAAA,EAEJ;AACA,SAAO,EAAE,KAAK,CAAC,GAAG,EAAA;AACpB;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PreExtension } from './json-schema-form-types';
|
|
2
|
+
export type UnitInputKind = "count" | "bytes";
|
|
3
|
+
export declare function formatUnitAwareValue(value: unknown, kind: UnitInputKind): unknown;
|
|
4
|
+
export declare function parseUnitAwareValue(value: string, kind: UnitInputKind): string | null;
|
|
5
|
+
export declare function createUnitFormExtensions(): {
|
|
6
|
+
pre: PreExtension[];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=unit-form-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-form-extension.d.ts","sourceRoot":"","sources":["../../src/components/unit-form-extension.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,CAAC;AA+C9C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAWjF;AAsBD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAgBrF;AAeD,wBAAgB,wBAAwB,IAAI;IAAE,GAAG,EAAE,YAAY,EAAE,CAAA;CAAE,CAyBlE"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { UnitStepControls } from "./UnitStepControls.js";
|
|
4
|
+
const COUNT_SCALES = [
|
|
5
|
+
{ label: "", multiplier: 1n },
|
|
6
|
+
{ label: "K", multiplier: 1000n },
|
|
7
|
+
{ label: "M", multiplier: 1000000n },
|
|
8
|
+
{ label: "B", multiplier: 1000000000n },
|
|
9
|
+
{ label: "T", multiplier: 1000000000000n }
|
|
10
|
+
];
|
|
11
|
+
const BYTE_SCALES = [
|
|
12
|
+
{ label: "B", multiplier: 1n },
|
|
13
|
+
{ label: "KiB", multiplier: 1024n },
|
|
14
|
+
{ label: "MiB", multiplier: 1048576n },
|
|
15
|
+
{ label: "GiB", multiplier: 1073741824n },
|
|
16
|
+
{ label: "TiB", multiplier: 1099511627776n }
|
|
17
|
+
];
|
|
18
|
+
const scales = (kind) => kind === "bytes" ? BYTE_SCALES : COUNT_SCALES;
|
|
19
|
+
function canonicalInteger(value) {
|
|
20
|
+
if (typeof value === "number") {
|
|
21
|
+
return Number.isSafeInteger(value) && value > 0 ? String(value) : null;
|
|
22
|
+
}
|
|
23
|
+
if (typeof value !== "string" || !/^[1-9][0-9]*$/.test(value)) return null;
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
function scaledDecimal(value, multiplier) {
|
|
27
|
+
const integer = value / multiplier;
|
|
28
|
+
let remainder = value % multiplier;
|
|
29
|
+
if (remainder === 0n) return String(integer);
|
|
30
|
+
let fraction = "";
|
|
31
|
+
while (remainder !== 0n && fraction.length < 3) {
|
|
32
|
+
remainder *= 10n;
|
|
33
|
+
fraction += String(remainder / multiplier);
|
|
34
|
+
remainder %= multiplier;
|
|
35
|
+
}
|
|
36
|
+
return remainder === 0n ? `${integer}.${fraction}` : null;
|
|
37
|
+
}
|
|
38
|
+
function formatUnitAwareValue(value, kind) {
|
|
39
|
+
const canonical = canonicalInteger(value);
|
|
40
|
+
if (canonical === null) return value;
|
|
41
|
+
const integer = BigInt(canonical);
|
|
42
|
+
for (const scale of scales(kind).toReversed()) {
|
|
43
|
+
if (integer < scale.multiplier) continue;
|
|
44
|
+
const amount = scaledDecimal(integer, scale.multiplier);
|
|
45
|
+
if (amount !== null) return `${amount}${scale.label}`;
|
|
46
|
+
}
|
|
47
|
+
return canonical;
|
|
48
|
+
}
|
|
49
|
+
function scaleForLabel(kind, label) {
|
|
50
|
+
if (kind === "count") {
|
|
51
|
+
return COUNT_SCALES.find((scale) => scale.label.toLowerCase() === label.toLowerCase());
|
|
52
|
+
}
|
|
53
|
+
const normalized = label.toLowerCase();
|
|
54
|
+
const aliases = {
|
|
55
|
+
"": "B",
|
|
56
|
+
k: "KiB",
|
|
57
|
+
kb: "KiB",
|
|
58
|
+
m: "MiB",
|
|
59
|
+
mb: "MiB",
|
|
60
|
+
g: "GiB",
|
|
61
|
+
gb: "GiB",
|
|
62
|
+
t: "TiB",
|
|
63
|
+
tb: "TiB"
|
|
64
|
+
};
|
|
65
|
+
const canonical = aliases[normalized] ?? label;
|
|
66
|
+
return BYTE_SCALES.find((scale) => scale.label.toLowerCase() === canonical.toLowerCase());
|
|
67
|
+
}
|
|
68
|
+
function parseUnitAwareValue(value, kind) {
|
|
69
|
+
const match = value.trim().replaceAll(",", "").replaceAll("_", "").match(
|
|
70
|
+
/^(\d+(?:\.\d+)?|\.\d+)\s*([a-zA-Z]*)$/
|
|
71
|
+
);
|
|
72
|
+
if (!match) return null;
|
|
73
|
+
const amount = match[1];
|
|
74
|
+
const scale = scaleForLabel(kind, match[2] ?? "");
|
|
75
|
+
if (!amount || !scale) return null;
|
|
76
|
+
const [whole, fraction = ""] = amount.split(".");
|
|
77
|
+
const denominator = 10n ** BigInt(fraction.length);
|
|
78
|
+
const numerator = BigInt(`${whole || "0"}${fraction}`) * scale.multiplier;
|
|
79
|
+
if (numerator % denominator !== 0n) return null;
|
|
80
|
+
const canonical = numerator / denominator;
|
|
81
|
+
return canonical > 0n ? String(canonical) : null;
|
|
82
|
+
}
|
|
83
|
+
function unitKind(field) {
|
|
84
|
+
const unit = field.schema["x-clicky-unit"];
|
|
85
|
+
return unit === "count" || unit === "bytes" ? unit : null;
|
|
86
|
+
}
|
|
87
|
+
function steppedValue(value, direction) {
|
|
88
|
+
const canonical = canonicalInteger(value);
|
|
89
|
+
if (canonical === null) return null;
|
|
90
|
+
const integer = BigInt(canonical);
|
|
91
|
+
const next = direction === "increase" ? integer * 2n : integer / 2n;
|
|
92
|
+
return next > 0n ? String(next) : null;
|
|
93
|
+
}
|
|
94
|
+
function createUnitFormExtensions() {
|
|
95
|
+
const pre = (field) => {
|
|
96
|
+
const kind = unitKind(field);
|
|
97
|
+
if (!kind) return field;
|
|
98
|
+
return {
|
|
99
|
+
...field,
|
|
100
|
+
value: formatUnitAwareValue(field.value, kind),
|
|
101
|
+
suffix: /* @__PURE__ */ jsx(
|
|
102
|
+
UnitStepControls,
|
|
103
|
+
{
|
|
104
|
+
label: field.label,
|
|
105
|
+
suffix: field.suffix,
|
|
106
|
+
decrease: steppedValue(field.value, "decrease"),
|
|
107
|
+
increase: steppedValue(field.value, "increase"),
|
|
108
|
+
schemaReadOnly: field.readOnly === true,
|
|
109
|
+
onChange: field.onChange
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
inputClassName: cn(field.inputClassName, field.suffix ? "pr-28" : "pr-20"),
|
|
113
|
+
onChange: (next) => {
|
|
114
|
+
const text = typeof next === "string" ? next : String(next ?? "");
|
|
115
|
+
field.onChange(parseUnitAwareValue(text, kind) ?? text);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
return { pre: [pre] };
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
createUnitFormExtensions,
|
|
123
|
+
formatUnitAwareValue,
|
|
124
|
+
parseUnitAwareValue
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=unit-form-extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-form-extension.js","sources":["../../src/components/unit-form-extension.tsx"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { UnitStepControls } from \"./UnitStepControls\";\nimport type { FieldControl, PreExtension } from \"./json-schema-form-types\";\n\nexport type UnitInputKind = \"count\" | \"bytes\";\n\ntype UnitScale = {\n label: string;\n multiplier: bigint;\n};\n\nconst COUNT_SCALES: UnitScale[] = [\n { label: \"\", multiplier: 1n },\n { label: \"K\", multiplier: 1_000n },\n { label: \"M\", multiplier: 1_000_000n },\n { label: \"B\", multiplier: 1_000_000_000n },\n { label: \"T\", multiplier: 1_000_000_000_000n },\n];\n\nconst BYTE_SCALES: UnitScale[] = [\n { label: \"B\", multiplier: 1n },\n { label: \"KiB\", multiplier: 1_024n },\n { label: \"MiB\", multiplier: 1_048_576n },\n { label: \"GiB\", multiplier: 1_073_741_824n },\n { label: \"TiB\", multiplier: 1_099_511_627_776n },\n];\n\nconst scales = (kind: UnitInputKind) => kind === \"bytes\" ? BYTE_SCALES : COUNT_SCALES;\n\nfunction canonicalInteger(value: unknown): string | null {\n if (typeof value === \"number\") {\n return Number.isSafeInteger(value) && value > 0 ? String(value) : null;\n }\n if (typeof value !== \"string\" || !/^[1-9][0-9]*$/.test(value)) return null;\n return value;\n}\n\nfunction scaledDecimal(value: bigint, multiplier: bigint): string | null {\n const integer = value / multiplier;\n let remainder = value % multiplier;\n if (remainder === 0n) return String(integer);\n\n let fraction = \"\";\n while (remainder !== 0n && fraction.length < 3) {\n remainder *= 10n;\n fraction += String(remainder / multiplier);\n remainder %= multiplier;\n }\n return remainder === 0n ? `${integer}.${fraction}` : null;\n}\n\nexport function formatUnitAwareValue(value: unknown, kind: UnitInputKind): unknown {\n const canonical = canonicalInteger(value);\n if (canonical === null) return value;\n\n const integer = BigInt(canonical);\n for (const scale of scales(kind).toReversed()) {\n if (integer < scale.multiplier) continue;\n const amount = scaledDecimal(integer, scale.multiplier);\n if (amount !== null) return `${amount}${scale.label}`;\n }\n return canonical;\n}\n\nfunction scaleForLabel(kind: UnitInputKind, label: string): UnitScale | undefined {\n if (kind === \"count\") {\n return COUNT_SCALES.find((scale) => scale.label.toLowerCase() === label.toLowerCase());\n }\n const normalized = label.toLowerCase();\n const aliases: Record<string, string> = {\n \"\": \"B\",\n k: \"KiB\",\n kb: \"KiB\",\n m: \"MiB\",\n mb: \"MiB\",\n g: \"GiB\",\n gb: \"GiB\",\n t: \"TiB\",\n tb: \"TiB\",\n };\n const canonical = aliases[normalized] ?? label;\n return BYTE_SCALES.find((scale) => scale.label.toLowerCase() === canonical.toLowerCase());\n}\n\nexport function parseUnitAwareValue(value: string, kind: UnitInputKind): string | null {\n const match = value.trim().replaceAll(\",\", \"\").replaceAll(\"_\", \"\").match(\n /^(\\d+(?:\\.\\d+)?|\\.\\d+)\\s*([a-zA-Z]*)$/,\n );\n if (!match) return null;\n\n const amount = match[1];\n const scale = scaleForLabel(kind, match[2] ?? \"\");\n if (!amount || !scale) return null;\n const [whole, fraction = \"\"] = amount.split(\".\");\n const denominator = 10n ** BigInt(fraction.length);\n const numerator = BigInt(`${whole || \"0\"}${fraction}`) * scale.multiplier;\n if (numerator % denominator !== 0n) return null;\n\n const canonical = numerator / denominator;\n return canonical > 0n ? String(canonical) : null;\n}\n\nfunction unitKind(field: FieldControl): UnitInputKind | null {\n const unit = field.schema[\"x-clicky-unit\"];\n return unit === \"count\" || unit === \"bytes\" ? unit : null;\n}\n\nfunction steppedValue(value: unknown, direction: \"decrease\" | \"increase\"): string | null {\n const canonical = canonicalInteger(value);\n if (canonical === null) return null;\n const integer = BigInt(canonical);\n const next = direction === \"increase\" ? integer * 2n : integer / 2n;\n return next > 0n ? String(next) : null;\n}\n\nexport function createUnitFormExtensions(): { pre: PreExtension[] } {\n const pre: PreExtension = (field) => {\n const kind = unitKind(field);\n if (!kind) return field;\n return {\n ...field,\n value: formatUnitAwareValue(field.value, kind),\n suffix: (\n <UnitStepControls\n label={field.label}\n suffix={field.suffix}\n decrease={steppedValue(field.value, \"decrease\")}\n increase={steppedValue(field.value, \"increase\")}\n schemaReadOnly={field.readOnly === true}\n onChange={field.onChange}\n />\n ),\n inputClassName: cn(field.inputClassName, field.suffix ? \"pr-28\" : \"pr-20\"),\n onChange: (next) => {\n const text = typeof next === \"string\" ? next : String(next ?? \"\");\n field.onChange(parseUnitAwareValue(text, kind) ?? text);\n },\n };\n };\n return { pre: [pre] };\n}\n"],"names":[],"mappings":";;;AAWA,MAAM,eAA4B;AAAA,EAChC,EAAE,OAAO,IAAI,YAAY,GAAA;AAAA,EACzB,EAAE,OAAO,KAAK,YAAY,MAAA;AAAA,EAC1B,EAAE,OAAO,KAAK,YAAY,SAAA;AAAA,EAC1B,EAAE,OAAO,KAAK,YAAY,YAAA;AAAA,EAC1B,EAAE,OAAO,KAAK,YAAY,eAAA;AAC5B;AAEA,MAAM,cAA2B;AAAA,EAC/B,EAAE,OAAO,KAAK,YAAY,GAAA;AAAA,EAC1B,EAAE,OAAO,OAAO,YAAY,MAAA;AAAA,EAC5B,EAAE,OAAO,OAAO,YAAY,SAAA;AAAA,EAC5B,EAAE,OAAO,OAAO,YAAY,YAAA;AAAA,EAC5B,EA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M,QAAO;AAClB,WAAO;AAAA,MACL,GAAG;AAAA,MACH,OAAO,qBAAqB,MAAM,OAAO,IAAI;AAAA,MAC7C,QACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAO,MAAM;AAAA,UACb,QAAQ,MAAM;AAAA,UACd,UAAU,aAAa,MAAM,OAAO,UAAU;AAAA,UAC9C,UAAU,aAAa,MAAM,OAAO,UAAU;AAAA,UAC9C,gBAAgB,MAAM,aAAa;AAAA,UACnC,UAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,MAGpB,gBAAgB,GAAG,MAAM,gBAAgB,MAAM,SAAS,UAAU,OAAO;AAAA,MACzE,UAAU,CAAC,SAAS;AAClB,cAAM,OAAO,OAAO,SAAS,WAAW,OAAO,OAAO,QAAQ,EAAE;AAChE,cAAM,SAAS,oBAAoB,MAAM,IAAI,KAAK,IAAI;AAAA,MACxD;AAAA,IAAA;AAAA,EAEJ;AACA,SAAO,EAAE,KAAK,CAAC,GAAG,EAAA;AACpB;"}
|
package/dist/components.cjs
CHANGED
|
@@ -47,6 +47,7 @@ const iconMenuPicker = require("./components/icon-menu-picker.cjs");
|
|
|
47
47
|
const ListMenu = require("./components/ListMenu.cjs");
|
|
48
48
|
const useListMenuSelection = require("./components/use-list-menu-selection.cjs");
|
|
49
49
|
const JsonSchemaForm = require("./components/JsonSchemaForm.cjs");
|
|
50
|
+
const unitFormExtension = require("./components/unit-form-extension.cjs");
|
|
50
51
|
const FormLookupProvider = require("./components/FormLookupProvider.cjs");
|
|
51
52
|
const formLookupContext = require("./components/form-lookup-context.cjs");
|
|
52
53
|
const jsonSchemaFormSize = require("./components/json-schema-form-size.cjs");
|
|
@@ -139,6 +140,9 @@ exports.ListMenuItem = ListMenu.ListMenuItem;
|
|
|
139
140
|
exports.ListMenuSection = ListMenu.ListMenuSection;
|
|
140
141
|
exports.useListMenuSelection = useListMenuSelection.useListMenuSelection;
|
|
141
142
|
exports.JsonSchemaForm = JsonSchemaForm.JsonSchemaForm;
|
|
143
|
+
exports.createUnitFormExtensions = unitFormExtension.createUnitFormExtensions;
|
|
144
|
+
exports.formatUnitAwareValue = unitFormExtension.formatUnitAwareValue;
|
|
145
|
+
exports.parseUnitAwareValue = unitFormExtension.parseUnitAwareValue;
|
|
142
146
|
exports.FormLookupProvider = FormLookupProvider.FormLookupProvider;
|
|
143
147
|
exports.resolveLookupScope = formLookupContext.resolveLookupScope;
|
|
144
148
|
exports.useLookupFetcher = formLookupContext.useLookupFetcher;
|
package/dist/components.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/components.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export { IconMenuPicker, type IconMenuPickerProps, type IconMenuOption, } from '
|
|
|
46
46
|
export { ListMenu, ListMenuActionBar, ListMenuHeader, ListMenuItem, ListMenuSection, type ListMenuAction, type ListMenuActionBarProps, type ListMenuHeaderProps, type ListMenuItemProps, type ListMenuProps, type ListMenuSectionProps, } from './components/ListMenu';
|
|
47
47
|
export { useListMenuSelection, type ListMenuSelection, type UseListMenuSelectionOptions, } from './components/use-list-menu-selection';
|
|
48
48
|
export { JsonSchemaForm } from './components/JsonSchemaForm';
|
|
49
|
+
export { createUnitFormExtensions, formatUnitAwareValue, parseUnitAwareValue, type UnitInputKind, } from './components/unit-form-extension';
|
|
49
50
|
export { FormLookupProvider } from './components/FormLookupProvider';
|
|
50
51
|
export { useLookupFetcher, resolveLookupScope, } from './components/form-lookup-context';
|
|
51
52
|
export { DEFAULT_FORM_SIZE } from './components/json-schema-form-size';
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,YAAY,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,6BAA6B,C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M,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,OAAO,EACP,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,QAAQ,EACR,cAAc,EACd,UAAU,EACV,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,WAAW,EA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EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,QAAQ,EACR,cAAc,EACd,UAAU,EACV,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,yBAAyB,CAAC"}
|
package/dist/components.js
CHANGED
|
@@ -45,6 +45,7 @@ import { IconMenuPicker } from "./components/icon-menu-picker.js";
|
|
|
45
45
|
import { ListMenu, ListMenuActionBar, ListMenuHeader, ListMenuItem, ListMenuSection } from "./components/ListMenu.js";
|
|
46
46
|
import { useListMenuSelection } from "./components/use-list-menu-selection.js";
|
|
47
47
|
import { JsonSchemaForm } from "./components/JsonSchemaForm.js";
|
|
48
|
+
import { createUnitFormExtensions, formatUnitAwareValue, parseUnitAwareValue } from "./components/unit-form-extension.js";
|
|
48
49
|
import { FormLookupProvider } from "./components/FormLookupProvider.js";
|
|
49
50
|
import { resolveLookupScope, useLookupFetcher } from "./components/form-lookup-context.js";
|
|
50
51
|
import { DEFAULT_FORM_SIZE } from "./components/json-schema-form-size.js";
|
|
@@ -148,7 +149,9 @@ export {
|
|
|
148
149
|
buttonVariants,
|
|
149
150
|
createLazyJSONPathTree,
|
|
150
151
|
createSecretFormExtensions,
|
|
152
|
+
createUnitFormExtensions,
|
|
151
153
|
effectiveProperties,
|
|
154
|
+
formatUnitAwareValue,
|
|
152
155
|
isOpenStringMap,
|
|
153
156
|
isTourFinished,
|
|
154
157
|
kindForValue,
|
|
@@ -161,6 +164,7 @@ export {
|
|
|
161
164
|
parseEndpointValue,
|
|
162
165
|
parseOnePasswordReference,
|
|
163
166
|
parseSecretRef,
|
|
167
|
+
parseUnitAwareValue,
|
|
164
168
|
parseWorkloadKey,
|
|
165
169
|
preferredEndpointPort,
|
|
166
170
|
readPreferences,
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
require("react");
|
|
4
|
+
const react = require("react");
|
|
5
5
|
const Icon = require("../Icon.cjs");
|
|
6
6
|
const errorDiagnostics = require("./error-diagnostics.cjs");
|
|
7
7
|
const UiCopy = require("../../icons/components/UiCopy.cjs");
|
|
8
8
|
const UiWarningTriangle = require("../../icons/components/UiWarningTriangle.cjs");
|
|
9
|
+
const UiCheck = require("../../icons/components/UiCheck.cjs");
|
|
9
10
|
const UiChevronRight = require("../../icons/components/UiChevronRight.cjs");
|
|
10
11
|
const UiMethod = require("../../icons/components/UiMethod.cjs");
|
|
11
12
|
const UiDebugStepOver = require("../../icons/components/UiDebugStepOver.cjs");
|
|
12
13
|
function ErrorDetails({ diagnostics, renderJsonContext }) {
|
|
14
|
+
const [copyState, setCopyState] = react.useState("idle");
|
|
13
15
|
const scalarContext = diagnostics.context.filter(
|
|
14
16
|
([, value]) => !errorDiagnostics.parseInlineJsonContextValue(value)
|
|
15
17
|
);
|
|
@@ -20,6 +22,21 @@ function ErrorDetails({ diagnostics, renderJsonContext }) {
|
|
|
20
22
|
})).filter(
|
|
21
23
|
(entry) => entry.data !== null
|
|
22
24
|
);
|
|
25
|
+
const copyDiagnostics = async (event) => {
|
|
26
|
+
var _a;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
if (!((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
|
|
30
|
+
setCopyState("failed");
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
await navigator.clipboard.writeText(diagnosticReport(diagnostics));
|
|
35
|
+
setCopyState("copied");
|
|
36
|
+
} catch {
|
|
37
|
+
setCopyState("failed");
|
|
38
|
+
}
|
|
39
|
+
};
|
|
23
40
|
return /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "group rounded-md border border-destructive/30 bg-destructive/5", children: [
|
|
24
41
|
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "flex cursor-pointer list-none items-start gap-2 p-3", children: [
|
|
25
42
|
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { icon: UiWarningTriangle.UiWarningTriangle, className: "mt-0.5 shrink-0 text-destructive" }),
|
|
@@ -27,13 +44,33 @@ function ErrorDetails({ diagnostics, renderJsonContext }) {
|
|
|
27
44
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-semibold text-destructive", children: "Error" }),
|
|
28
45
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 whitespace-pre-wrap text-sm text-destructive", children: diagnostics.message })
|
|
29
46
|
] }),
|
|
30
|
-
/* @__PURE__ */ jsxRuntime.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 flex-col items-end gap-2 text-xs font-medium text-muted-foreground sm:flex-row sm:items-center sm:gap-3", children: [
|
|
48
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
type: "button",
|
|
52
|
+
"aria-label": copyState === "copied" ? "Copied" : copyState === "failed" ? "Copy failed" : "Copy error details",
|
|
53
|
+
title: "Copy message, trace, time, context, and stack trace",
|
|
54
|
+
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
55
|
+
onClick: (event) => void copyDiagnostics(event),
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { icon: copyState === "copied" ? UiCheck.UiCheck : UiCopy.UiCopy }),
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-live": "polite", children: copyState === "copied" ? "Copied" : copyState === "failed" ? "Copy failed" : "Copy" })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 hover:text-foreground", children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "group-open:hidden", children: "More details" }),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden group-open:inline", children: "Less details" }),
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
66
|
+
Icon.Icon,
|
|
67
|
+
{
|
|
68
|
+
icon: UiChevronRight.UiChevronRight,
|
|
69
|
+
className: "shrink-0 transition-transform group-open:rotate-90"
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] })
|
|
73
|
+
] })
|
|
37
74
|
] }),
|
|
38
75
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3 border-t border-destructive/20 p-3 pt-2", children: [
|
|
39
76
|
(diagnostics.trace || diagnostics.time) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-wrap gap-2", children: [
|
|
@@ -78,6 +115,22 @@ function ErrorDetails({ diagnostics, renderJsonContext }) {
|
|
|
78
115
|
] })
|
|
79
116
|
] });
|
|
80
117
|
}
|
|
118
|
+
function diagnosticReport(diagnostics) {
|
|
119
|
+
const lines = [`Error: ${diagnostics.message}`];
|
|
120
|
+
if (diagnostics.trace) lines.push(`Trace: ${diagnostics.trace}`);
|
|
121
|
+
if (diagnostics.time) lines.push(`Time: ${diagnostics.time}`);
|
|
122
|
+
if (diagnostics.context.length > 0) {
|
|
123
|
+
lines.push(
|
|
124
|
+
"",
|
|
125
|
+
"Context:",
|
|
126
|
+
...diagnostics.context.map(([label, value]) => `${label}: ${value}`)
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
if (diagnostics.stacktrace) {
|
|
130
|
+
lines.push("", "Stack trace:", diagnostics.stacktrace);
|
|
131
|
+
}
|
|
132
|
+
return lines.join("\n");
|
|
133
|
+
}
|
|
81
134
|
function PrettyStackTrace({ stacktrace }) {
|
|
82
135
|
const parsed = errorDiagnostics.parseDiagnosticsStackTrace(stacktrace);
|
|
83
136
|
if (parsed.frames.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDetails.cjs","sources":["../../../src/data/diagnostics/ErrorDetails.tsx"],"sourcesContent":["import { type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { UiDebugStepOver, UiMethod, UiChevronRight, UiCopy, UiWarningTriangle } from \"../../icons\";\nimport {\n compactStackPath,\n isApplicationStackFrame,\n parseDiagnosticsStackTrace,\n parseInlineJsonContextValue,\n type ErrorDiagnostics,\n type ErrorStackFrame,\n} from \"./error-diagnostics\";\n\nexport type ErrorDetailsProps = {\n diagnostics: ErrorDiagnostics;\n // Optional renderer for context values that parse as JSON. Defaults to a\n // CopyBadge with the raw string. MC's playbook view passes a richer JsonView\n // here; smaller consumers (plugin iframes) can leave it unset.\n renderJsonContext?: (entry: { label: string; value: string; data: unknown }) => ReactNode;\n};\n\nexport function ErrorDetails({ diagnostics, renderJsonContext }: ErrorDetailsProps) {\n const scalarContext = diagnostics.context.filter(\n ([, value]) => !parseInlineJsonContextValue(value),\n );\n const jsonContext = diagnostics.context\n .map(([label, value]) => ({\n label,\n value,\n data: parseInlineJsonContextValue(value),\n }))\n .filter(\n (entry): entry is { label: string; value: string; data: unknown } => entry.data !== null,\n );\n return (\n <details className=\"group rounded-md border border-destructive/30 bg-destructive/5\">\n <summary className=\"flex cursor-pointer list-none items-start gap-2 p-3\">\n <Icon icon={UiWarningTriangle} className=\"mt-0.5 shrink-0 text-destructive\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-sm font-semibold text-destructive\">Error</div>\n <div className=\"mt-1 whitespace-pre-wrap text-sm text-destructive\">\n {diagnostics.message}\n </div>\n </div>\n <Icon\n icon={UiChevronRight}\n className=\"mt-0.5 shrink-0 text-muted-foreground transition-transform group-open:rotate-90\"\n />\n </summary>\n <div className=\"grid gap-3 border-t border-destructive/20 p-3 pt-2\">\n {(diagnostics.trace || diagnostics.time) && (\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n {diagnostics.trace && (\n <CopyBadge label=\"Trace\" value={diagnostics.trace} className=\"max-w-full\" />\n )}\n {diagnostics.time && (\n <span className=\"inline-flex max-w-full items-center overflow-hidden rounded-md border border-border bg-background/80 text-xs\">\n <span className=\"shrink-0 bg-muted px-2 py-1 font-medium text-muted-foreground\">\n Time\n </span>\n <span className=\"min-w-0 truncate px-2 py-1 font-mono text-foreground\">\n {diagnostics.time}\n </span>\n </span>\n )}\n </div>\n )}\n {diagnostics.context.length > 0 && (\n <div className=\"min-w-0\">\n <div className=\"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Context\n </div>\n {scalarContext.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {scalarContext.map(([label, value]) => (\n <CopyBadge key={`${label}:${value}`} label={label} value={value} />\n ))}\n </div>\n )}\n {jsonContext.length > 0 && (\n <div className=\"mt-2 grid gap-2\">\n {jsonContext.map((entry) =>\n renderJsonContext ? (\n <span key={`${entry.label}:${entry.value}`}>{renderJsonContext(entry)}</span>\n ) : (\n <CopyBadge\n key={`${entry.label}:${entry.value}`}\n label={entry.label}\n value={entry.value}\n />\n ),\n )}\n </div>\n )}\n </div>\n )}\n {diagnostics.stacktrace && (\n <div className=\"min-w-0\">\n <div className=\"mb-1.5 flex min-w-0 items-center justify-between gap-3\">\n <div className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Stack trace\n </div>\n <button\n type=\"button\"\n onClick={() => copyText(diagnostics.stacktrace ?? \"\")}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground\"\n >\n <Icon icon={UiCopy} />\n copy\n </button>\n </div>\n <PrettyStackTrace stacktrace={diagnostics.stacktrace} />\n </div>\n )}\n </div>\n </details>\n );\n}\n\nexport function PrettyStackTrace({ stacktrace }: { stacktrace: string }) {\n const parsed = parseDiagnosticsStackTrace(stacktrace);\n if (parsed.frames.length === 0) {\n return (\n <pre className=\"max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-slate-950 p-3 font-mono text-xs leading-5 text-slate-200\">\n {stacktrace}\n </pre>\n );\n }\n\n return (\n <div className=\"max-h-96 min-h-40 overflow-auto rounded-md border border-border bg-background p-2\">\n <div className=\"mb-2 flex items-center justify-between gap-2 text-[11px] text-muted-foreground\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"rounded-full bg-red-100 px-2 py-0.5 text-red-700\">error</span>\n <span>{parsed.frames.length} frames</span>\n </div>\n </div>\n {parsed.headline && (\n <div className=\"mb-2 rounded-md bg-red-50 px-2 py-1.5 font-mono text-[11px] leading-4 text-red-700\">\n {parsed.headline}\n </div>\n )}\n <div className=\"space-y-0.5\">\n {parsed.frames.map((frame, index) => (\n <StackFrameRow key={`${frame.file}:${frame.line}:${index}`} frame={frame} index={index} />\n ))}\n </div>\n {parsed.unparsed.length > 0 && (\n <pre className=\"mt-2 whitespace-pre-wrap rounded bg-muted p-2 font-mono text-[11px] leading-4 text-muted-foreground\">\n {parsed.unparsed.join(\"\\n\")}\n </pre>\n )}\n </div>\n );\n}\n\nfunction StackFrameRow({ frame, index }: { frame: ErrorStackFrame; index: number }) {\n const appFrame = isApplicationStackFrame(frame.file);\n return (\n <button\n type=\"button\"\n onClick={() => copyText(frame.raw)}\n title=\"Copy stack frame\"\n className={[\n \"block w-full rounded px-1.5 py-1 text-left hover:bg-accent/50\",\n appFrame ? \"text-foreground\" : \"text-muted-foreground\",\n ].join(\" \")}\n >\n <div className=\"flex min-w-0 items-start gap-1.5\">\n <Icon\n icon={appFrame ? UiMethod : UiDebugStepOver}\n className=\"mt-0.5 shrink-0 text-[11px]\"\n />\n <div className=\"min-w-0\">\n <div className=\"break-all font-mono text-[11px] font-semibold leading-4\">\n <span className=\"mr-2 text-[10px] font-normal opacity-60\">#{index + 1}</span>\n {frame.functionName || \"unknown function\"}\n <span className=\"ml-2 text-[10px] font-normal opacity-80\">\n {compactStackPath(frame.file)}:{frame.line}\n </span>\n </div>\n </div>\n </div>\n </button>\n );\n}\n\nexport function CopyBadge({\n label,\n value,\n className = \"\",\n}: {\n label: string;\n value: string;\n className?: string;\n}) {\n return (\n <button\n type=\"button\"\n onClick={() => copyText(value)}\n title={`Copy ${label}`}\n className={[\n \"inline-flex max-w-full items-center overflow-hidden rounded-md border border-border bg-background/80 text-left text-xs hover:border-primary/40 hover:bg-background\",\n className,\n ]\n .filter(Boolean)\n .join(\" \")}\n >\n <span className=\"shrink-0 bg-muted px-2 py-1 font-medium text-muted-foreground\">{label}</span>\n <span className=\"min-w-0 truncate px-2 py-1 font-mono text-foreground\">{value}</span>\n <Icon icon={UiCopy} className=\"mr-1.5 h-3 w-3 shrink-0 text-muted-foreground\" />\n </button>\n );\n}\n\nfunction copyText(value: string) {\n if (typeof navigator !== \"undefined\" && navigator.clipboard) {\n void navigator.clipboard.writeText(value);\n }\n}\n"],"names":["parseInlineJsonContextValue","jsxs","jsx","Icon","UiWarningTriangle","UiChevronRight","UiCopy","parseDiagnosticsStackTrace","isApplicationStackFrame","UiMethod","UiDebugStepOver","compactStackPath"],"mappings":";;;;;;;;;;;AAoBO,SAAS,aAAa,EAAE,aAAa,qBAAwC;AAClF,QAAM,gBAAgB,YAAY,QAAQ;AAAA,IACxC,CAAC,GAAG,KAAK,MAAM,CAACA,iBAAAA,4BAA4B,KAAK;AAAA,EAAA;AAEnD,QAAM,cAAc,YAAY,QAC7B,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO;AAAA,IACxB;AAAA,IACA;AAAA,IACA,MAAMA,iBAAAA,4BAA4B,KAAK;AAAA,EAAA,EACvC,EACD;AAAA,IACC,CAAC,UAAoE,MAAM,SAAS;AAAA,EAAA;AAExF,SACEC,2BAAAA,KAAC,WAAA,EAAQ,WAAU,kEACjB,UAAA;AAAA,IAAAA,2BAAAA,KAAC,WAAA,EAAQ,WAAU,uDACjB,UAAA;AAAA,MAAAC,2BAAAA,IAACC,KAAAA,MAAA,EAAK,MAAMC,kBAAAA,mBAAmB,WAAU,oCAAmC;AAAA,MAC5EH,2BAAAA,KAAC,OAAA,EAAI,WAAU,kBACb,UAAA;AAAA,QAAAC,2BAAAA,IAAC,OAAA,EAAI,WAAU,0CAAyC,UAAA,SAAK;AAAA,QAC7DA,2BAAAA,IAAC,OAAA,EAAI,WAAU,qDACZ,sBAAY,QAAA,CACf;AAAA,MAAA,GACF;AAAA,MACAA,2BAAAA;AAAAA,QAACC,KAAAA;AAAAA,QAAA;AAAA,UACC,MAAME,eAAAA;AAAAA,UACN,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,GACF;AAAA,IACAJ,2BAAAA,KAAC,OAAA,EAAI,WAAU,sDACX,UAAA;AAAA,OAAA,YAAY,SAAS,YAAY,SACjCA,gCAAC,OAAA,EAAI,WAAU,gCACZ,UAAA;AAAA,QAAA,YAAY,wCACV,WAAA,EAAU,OAAM,SA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A,MACC,MAAK;AAAA,MACL,SAAS,MAAM,SAAS,KAAK;AAAA,MAC7B,OAAO,QAAQ,KAAK;AAAA,MACpB,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MAEX,UAAA;AAAA,QAAAC,2BAAAA,IAAC,QAAA,EAAK,WAAU,iEAAiE,UAAA,OAAM;AAAA,QACvFA,2BAAAA,IAAC,QAAA,EAAK,WAAU,wDAAwD,UAAA,OAAM;AAAA,QAC9EA,2BAAAA,IAACC,KAAAA,MAAA,EAAK,MAAMG,OAAAA,QAAQ,WAAU,gDAAA,CAAgD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpF;AAEA,SAAS,SAAS,OAAe;AAC/B,MAAI,OAAO,cAAc,eAAe,UAAU,WAAW;AAC3D,SAAK,UAAU,UAAU,UAAU,KAAK;AAAA,EAC1C;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"ErrorDetails.cjs","sources":["../../../src/data/diagnostics/ErrorDetails.tsx"],"sourcesContent":["import { useState, type MouseEvent, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport {\n UiCheck,\n UiChevronRight,\n UiCopy,\n UiDebugStepOver,\n UiMethod,\n UiWarningTriangle,\n} from \"../../icons\";\nimport {\n compactStackPath,\n isApplicationStackFrame,\n parseDiagnosticsStackTrace,\n parseInlineJsonContextValue,\n type ErrorDiagnostics,\n type ErrorStackFrame,\n} from \"./error-diagnostics\";\n\nexport type ErrorDetailsProps = {\n diagnostics: ErrorDiagnostics;\n // Optional renderer for context values that parse as JSON. Defaults to a\n // CopyBadge with the raw string. MC's playbook view passes a richer JsonView\n // here; smaller consumers (plugin iframes) can leave it unset.\n renderJsonContext?: (entry: { label: string; value: string; data: unknown }) => ReactNode;\n};\n\nexport function ErrorDetails({ diagnostics, renderJsonContext }: ErrorDetailsProps) {\n const [copyState, setCopyState] = useState<\"idle\" | \"copied\" | \"failed\">(\"idle\");\n const scalarContext = diagnostics.context.filter(\n ([, value]) => !parseInlineJsonContextValue(value),\n );\n const jsonContext = diagnostics.context\n .map(([label, value]) => ({\n label,\n value,\n data: parseInlineJsonContextValue(value),\n }))\n .filter(\n (entry): entry is { label: string; value: string; data: unknown } => entry.data !== null,\n );\n const copyDiagnostics = async (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n if (!navigator.clipboard?.writeText) {\n setCopyState(\"failed\");\n return;\n }\n try {\n await navigator.clipboard.writeText(diagnosticReport(diagnostics));\n setCopyState(\"copied\");\n } catch {\n setCopyState(\"failed\");\n }\n };\n return (\n <details className=\"group rounded-md border border-destructive/30 bg-destructive/5\">\n <summary className=\"flex cursor-pointer list-none items-start gap-2 p-3\">\n <Icon icon={UiWarningTriangle} className=\"mt-0.5 shrink-0 text-destructive\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-sm font-semibold text-destructive\">Error</div>\n <div className=\"mt-1 whitespace-pre-wrap text-sm text-destructive\">\n {diagnostics.message}\n </div>\n </div>\n <div className=\"flex shrink-0 flex-col items-end gap-2 text-xs font-medium text-muted-foreground sm:flex-row sm:items-center sm:gap-3\">\n <button\n type=\"button\"\n aria-label={\n copyState === \"copied\"\n ? \"Copied\"\n : copyState === \"failed\"\n ? \"Copy failed\"\n : \"Copy error details\"\n }\n title=\"Copy message, trace, time, context, and stack trace\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n onClick={(event) => void copyDiagnostics(event)}\n >\n <Icon icon={copyState === \"copied\" ? UiCheck : UiCopy} />\n <span aria-live=\"polite\">\n {copyState === \"copied\"\n ? \"Copied\"\n : copyState === \"failed\"\n ? \"Copy failed\"\n : \"Copy\"}\n </span>\n </button>\n <span className=\"inline-flex items-center gap-1 hover:text-foreground\">\n <span className=\"group-open:hidden\">More details</span>\n <span className=\"hidden group-open:inline\">Less details</span>\n <Icon\n icon={UiChevronRight}\n className=\"shrink-0 transition-transform group-open:rotate-90\"\n />\n </span>\n </div>\n </summary>\n <div className=\"grid gap-3 border-t border-destructive/20 p-3 pt-2\">\n {(diagnostics.trace || diagnostics.time) && (\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n {diagnostics.trace && (\n <CopyBadge label=\"Trace\" value={diagnostics.trace} className=\"max-w-full\" />\n )}\n {diagnostics.time && (\n <span className=\"inline-flex max-w-full items-center overflow-hidden rounded-md border border-border bg-background/80 text-xs\">\n <span className=\"shrink-0 bg-muted px-2 py-1 font-medium text-muted-foreground\">\n Time\n </span>\n <span className=\"min-w-0 truncate px-2 py-1 font-mono text-foreground\">\n {diagnostics.time}\n </span>\n </span>\n )}\n </div>\n )}\n {diagnostics.context.length > 0 && (\n <div className=\"min-w-0\">\n <div className=\"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Context\n </div>\n {scalarContext.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {scalarContext.map(([label, value]) => (\n <CopyBadge key={`${label}:${value}`} label={label} value={value} />\n ))}\n </div>\n )}\n {jsonContext.length > 0 && (\n <div className=\"mt-2 grid gap-2\">\n {jsonContext.map((entry) =>\n renderJsonContext ? (\n <span key={`${entry.label}:${entry.value}`}>{renderJsonContext(entry)}</span>\n ) : (\n <CopyBadge\n key={`${entry.label}:${entry.value}`}\n label={entry.label}\n value={entry.value}\n />\n ),\n )}\n </div>\n )}\n </div>\n )}\n {diagnostics.stacktrace && (\n <div className=\"min-w-0\">\n <div className=\"mb-1.5 flex min-w-0 items-center justify-between gap-3\">\n <div className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Stack trace\n </div>\n <button\n type=\"button\"\n onClick={() => copyText(diagnostics.stacktrace ?? \"\")}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground\"\n >\n <Icon icon={UiCopy} />\n copy\n </button>\n </div>\n <PrettyStackTrace stacktrace={diagnostics.stacktrace} />\n </div>\n )}\n </div>\n </details>\n );\n}\n\nfunction diagnosticReport(diagnostics: ErrorDiagnostics): string {\n const lines = [`Error: ${diagnostics.message}`];\n if (diagnostics.trace) lines.push(`Trace: ${diagnostics.trace}`);\n if (diagnostics.time) lines.push(`Time: ${diagnostics.time}`);\n if (diagnostics.context.length > 0) {\n lines.push(\n \"\",\n \"Context:\",\n ...diagnostics.context.map(([label, value]) => `${label}: ${value}`),\n );\n }\n if (diagnostics.stacktrace) {\n lines.push(\"\", \"Stack trace:\", diagnostics.stacktrace);\n }\n return lines.join(\"\\n\");\n}\n\nexport function PrettyStackTrace({ stacktrace }: { stacktrace: string }) {\n const parsed = parseDiagnosticsStackTrace(stacktrace);\n if (parsed.frames.length === 0) {\n return (\n <pre className=\"max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-slate-950 p-3 font-mono text-xs leading-5 text-slate-200\">\n {stacktrace}\n </pre>\n );\n }\n\n return (\n <div className=\"max-h-96 min-h-40 overflow-auto rounded-md border border-border bg-background p-2\">\n <div className=\"mb-2 flex items-center justify-between gap-2 text-[11px] text-muted-foreground\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"rounded-full bg-red-100 px-2 py-0.5 text-red-700\">error</span>\n <span>{parsed.frames.length} frames</span>\n </div>\n </div>\n {parsed.headline && (\n <div className=\"mb-2 rounded-md bg-red-50 px-2 py-1.5 font-mono text-[11px] leading-4 text-red-700\">\n {parsed.headline}\n </div>\n )}\n <div className=\"space-y-0.5\">\n {parsed.frames.map((frame, index) => (\n <StackFrameRow key={`${frame.file}:${frame.line}:${index}`} frame={frame} index={index} />\n ))}\n </div>\n {parsed.unparsed.length > 0 && (\n <pre className=\"mt-2 whitespace-pre-wrap rounded bg-muted p-2 font-mono text-[11px] leading-4 text-muted-foreground\">\n {parsed.unparsed.join(\"\\n\")}\n </pre>\n )}\n </div>\n );\n}\n\nfunction StackFrameRow({ frame, index }: { frame: ErrorStackFrame; index: number }) {\n const appFrame = isApplicationStackFrame(frame.file);\n return (\n <button\n type=\"button\"\n onClick={() => copyText(frame.raw)}\n title=\"Copy stack frame\"\n className={[\n \"block w-full rounded px-1.5 py-1 text-left hover:bg-accent/50\",\n appFrame ? \"text-foreground\" : \"text-muted-foreground\",\n ].join(\" \")}\n >\n <div className=\"flex min-w-0 items-start gap-1.5\">\n <Icon\n icon={appFrame ? UiMethod : UiDebugStepOver}\n className=\"mt-0.5 shrink-0 text-[11px]\"\n />\n <div className=\"min-w-0\">\n <div className=\"break-all font-mono text-[11px] font-semibold leading-4\">\n <span className=\"mr-2 text-[10px] font-normal opacity-60\">#{index + 1}</span>\n {frame.functionName || \"unknown function\"}\n <span className=\"ml-2 text-[10px] font-normal opacity-80\">\n {compactStackPath(frame.file)}:{frame.line}\n </span>\n </div>\n </div>\n </div>\n </button>\n );\n}\n\nexport function CopyBadge({\n label,\n value,\n className = \"\",\n}: {\n label: string;\n value: string;\n className?: string;\n}) {\n return (\n <button\n type=\"button\"\n onClick={() => copyText(value)}\n title={`Copy ${label}`}\n className={[\n \"inline-flex max-w-full items-center overflow-hidden rounded-md border border-border bg-background/80 text-left text-xs hover:border-primary/40 hover:bg-background\",\n className,\n ]\n .filter(Boolean)\n .join(\" \")}\n >\n <span className=\"shrink-0 bg-muted px-2 py-1 font-medium text-muted-foreground\">{label}</span>\n <span className=\"min-w-0 truncate px-2 py-1 font-mono text-foreground\">{value}</span>\n <Icon icon={UiCopy} className=\"mr-1.5 h-3 w-3 shrink-0 text-muted-foreground\" />\n </button>\n );\n}\n\nfunction copyText(value: string) {\n if (typeof navigator !== \"undefined\" && navigator.clipboard) {\n void navigator.clipboard.writeText(value);\n }\n}\n"],"names":["useState","parseInlineJsonContextValue","jsxs","jsx","Icon","UiWarningTriangle","UiCheck","UiCopy","UiChevronRight","parseDiagnosticsStackTrace","isApplicationStackFrame","UiMethod","UiDebugStepOver","compactStackPath"],"mappings":";;;;;;;;;;;;AA2BO,SAAS,aAAa,EAAE,aAAa,qBAAwC;AAClF,QAAM,CAAC,WAAW,YAAY,IAAIA,MAAAA,SAAuC,MAAM;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AAA,EAAA;AAGN;AAEO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,YAAY;AACd,GAIG;AACD,SACEX,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,MAAM,SAAS,KAAK;AAAA,MAC7B,OAAO,QAAQ,KAAK;AAAA,MACpB,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MAEX,UAAA;AAAA,QAAAC,2BAAAA,IAAC,QAAA,EAAK,WAAU,iEAAiE,UAAA,OAAM;AAAA,QACvFA,2BAAAA,IAAC,QAAA,EAAK,WAAU,wDAAwD,UAAA,OAAM;AAAA,QAC9EA,2BAAAA,IAACC,KAAAA,MAAA,EAAK,MAAMG,OAAAA,QAAQ,WAAU,gDAAA,CAAgD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpF;AAEA,SAAS,SAAS,OAAe;AAC/B,MAAI,OAAO,cAAc,eAAe,UAAU,WAAW;AAC3D,SAAK,UAAU,UAAU,UAAU,KAAK;AAAA,EAC1C;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDetails.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/ErrorDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ErrorDetails.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/ErrorDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlE,OAAO,EAKL,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,gBAAgB,CAAC;IAI9B,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,CAAC;CAC3F,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,2CA2IjF;AAmBD,wBAAgB,gBAAgB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,2CAmCtE;AAiCD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,SAAc,GACf,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAkBA"}
|