@morscherlab/mint-sdk 1.0.0-rc.4 → 1.0.0-rc.6
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/__tests__/components/AppTopBar.navigation.test.d.ts +1 -0
- package/dist/__tests__/components/DoseCalculatorVolumeField.test.d.ts +1 -0
- package/dist/__tests__/components/PlateMapEditorToolbarInternal.test.d.ts +1 -0
- package/dist/__tests__/components/PluginWorkspaceView.controls.test.d.ts +1 -0
- package/dist/__tests__/components/PluginWorkspaceView.navigation.test.d.ts +1 -0
- package/dist/__tests__/components/PluginWorkspaceView.shell.test.d.ts +1 -0
- package/dist/__tests__/components/ProtocolStep.presentation.test.d.ts +1 -0
- package/dist/__tests__/components/ProtocolStepEditor.state.test.d.ts +1 -0
- package/dist/__tests__/components/ProtocolStepParameterField.test.d.ts +1 -0
- package/dist/__tests__/components/ReagentList.presentation.test.d.ts +1 -0
- package/dist/__tests__/components/SampleSelector.colors.test.d.ts +1 -0
- package/dist/__tests__/components/SampleSelector.drag.test.d.ts +1 -0
- package/dist/__tests__/components/SampleSelector.groups.test.d.ts +1 -0
- package/dist/__tests__/components/SampleSelector.selection.test.d.ts +1 -0
- package/dist/__tests__/components/SampleSelectorSampleRow.test.d.ts +1 -0
- package/dist/__tests__/components/ScheduleCalendar.test.d.ts +1 -0
- package/dist/__tests__/components/SettingsModal.schema.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.colors.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.conditions.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.geometry.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.interaction.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.legend.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.rendering.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.sampleDrop.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/classify.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/columns.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/compose.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/cooccurrence.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/fingerprint.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/integration.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/template.test.d.ts +1 -0
- package/dist/__tests__/composables/autoGroup/tokenize.test.d.ts +1 -0
- package/dist/__tests__/composables/useAutoGroupInputSources.test.d.ts +1 -0
- package/dist/__tests__/composables/useScheduleCalendarLayout.test.d.ts +1 -0
- package/dist/__tests__/docs/extractDocsComponents.test.d.ts +1 -0
- package/dist/__tests__/docs/extractDocsExports.test.d.ts +1 -0
- package/dist/__tests__/docs/extractDocsParsing.test.d.ts +1 -0
- package/dist/__tests__/docs/extractDocsTemplates.test.d.ts +1 -0
- package/dist/__tests__/docs/extractDocsTheme.test.d.ts +1 -0
- package/dist/components/AppSidebar.vue.d.ts +9 -6
- package/dist/components/AppTopBar.navigation.d.ts +11 -0
- package/dist/components/BaseButton.vue.d.ts +1 -1
- package/dist/components/BaseCheckbox.vue.d.ts +7 -2
- package/dist/components/BaseInput.vue.d.ts +2 -2
- package/dist/components/BasePill.vue.d.ts +2 -2
- package/dist/components/BaseRadioGroup.vue.d.ts +2 -2
- package/dist/components/BaseSelect.vue.d.ts +1 -1
- package/dist/components/BaseSlider.vue.d.ts +2 -2
- package/dist/components/BaseTextarea.vue.d.ts +2 -2
- package/dist/components/BaseToggle.vue.d.ts +7 -2
- package/dist/components/BioTemplateExperimentWorkspaceView.vue.d.ts +2 -2
- package/dist/components/BioTemplatePackWorkspaceView.vue.d.ts +1 -1
- package/dist/components/CollapsibleCard.vue.d.ts +9 -0
- package/dist/components/ColorSlider.vue.d.ts +2 -2
- package/dist/components/ConcentrationInput.vue.d.ts +2 -2
- package/dist/components/ControlWorkspaceView.vue.d.ts +4 -4
- package/dist/components/DatePicker.vue.d.ts +1 -1
- package/dist/components/DateTimePicker.vue.d.ts +2 -2
- package/dist/components/DoseCalculatorVolumeField.vue.d.ts +15 -0
- package/dist/components/DoseDesignWorkspaceView.vue.d.ts +2 -2
- package/dist/components/DropdownButton.vue.d.ts +1 -1
- package/dist/components/FileUploader.vue.d.ts +2 -2
- package/dist/components/FormulaInput.vue.d.ts +2 -2
- package/dist/components/IconButton.vue.d.ts +1 -1
- package/dist/components/LoadingSpinner.vue.d.ts +1 -1
- package/dist/components/MoleculeInput.vue.d.ts +2 -2
- package/dist/components/MultiSelect.vue.d.ts +1 -1
- package/dist/components/NumberInput.vue.d.ts +1 -1
- package/dist/components/PlateMapEditor.vue.d.ts +6 -6
- package/dist/components/PluginWorkspaceView.controls.d.ts +28 -0
- package/dist/components/PluginWorkspaceView.navigation.d.ts +29 -0
- package/dist/components/PluginWorkspaceView.props.d.ts +151 -0
- package/dist/components/PluginWorkspaceView.shell.d.ts +19 -0
- package/dist/components/PluginWorkspaceView.vue.d.ts +51 -196
- package/dist/components/ProgressBar.vue.d.ts +1 -1
- package/dist/components/ProtocolStep.presentation.d.ts +4 -0
- package/dist/components/ProtocolStepEditor.state.d.ts +18 -0
- package/dist/components/ProtocolStepParameterField.vue.d.ts +12 -0
- package/dist/components/ReagentList.presentation.d.ts +16 -0
- package/dist/components/ResourceCard.vue.d.ts +1 -1
- package/dist/components/SampleSelector.colors.d.ts +13 -0
- package/dist/components/SampleSelector.drag.d.ts +24 -0
- package/dist/components/SampleSelector.groups.d.ts +15 -0
- package/dist/components/SampleSelector.selection.d.ts +26 -0
- package/dist/components/SampleSelector.vue.d.ts +4 -1
- package/dist/components/SampleSelectorSampleRow.vue.d.ts +21 -0
- package/dist/components/SegmentedControl.vue.d.ts +1 -1
- package/dist/components/SequenceInput.vue.d.ts +2 -2
- package/dist/components/SequenceProgressBar.vue.d.ts +1 -1
- package/dist/components/SettingsModal.schema.d.ts +9 -0
- package/dist/components/StatusIndicator.vue.d.ts +1 -1
- package/dist/components/TagsInput.vue.d.ts +2 -2
- package/dist/components/TimePicker.vue.d.ts +2 -2
- package/dist/components/TimeRangeInput.vue.d.ts +1 -1
- package/dist/components/UnitInput.vue.d.ts +2 -2
- package/dist/components/WellPlate.colors.d.ts +9 -0
- package/dist/components/WellPlate.conditions.d.ts +26 -0
- package/dist/components/WellPlate.geometry.d.ts +23 -0
- package/dist/components/WellPlate.interaction.d.ts +71 -0
- package/dist/components/WellPlate.legend.d.ts +2 -0
- package/dist/components/WellPlate.rendering.d.ts +24 -0
- package/dist/components/WellPlate.sampleDrop.d.ts +8 -0
- package/dist/components/WellPlate.vue.d.ts +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/internal/ActionItemInternal.vue.d.ts +1 -1
- package/dist/components/internal/PlateMapEditorToolbarInternal.vue.d.ts +28 -0
- package/dist/{components-DafPc4rM.js → components-Blx4MG--.js} +4073 -4222
- package/dist/components-Blx4MG--.js.map +1 -0
- package/dist/composables/autoGroup/classKey.d.ts +4 -0
- package/dist/composables/autoGroup/classify.d.ts +28 -0
- package/dist/composables/autoGroup/colors.d.ts +2 -0
- package/dist/composables/autoGroup/columns.d.ts +10 -0
- package/dist/composables/autoGroup/compose.d.ts +8 -0
- package/dist/composables/autoGroup/cooccurrence.d.ts +2 -0
- package/dist/composables/autoGroup/csv-shim.d.ts +2 -0
- package/dist/composables/autoGroup/fingerprint.d.ts +3 -0
- package/dist/composables/autoGroup/index.d.ts +16 -0
- package/dist/composables/autoGroup/replicatePreGroup.d.ts +38 -0
- package/dist/composables/autoGroup/template.d.ts +15 -0
- package/dist/composables/autoGroup/tokenize.d.ts +8 -0
- package/dist/composables/autoGroupConstants.d.ts +1 -0
- package/dist/composables/autoGroupGrouping.d.ts +3 -0
- package/dist/composables/controlComponentBindings.d.ts +1 -1
- package/dist/composables/controlSchemaAdapters.d.ts +1 -1
- package/dist/composables/controlSchemaDoseDesign.d.ts +11 -0
- package/dist/composables/controlSchemaLayout.d.ts +1 -1
- package/dist/composables/controlSchemaModel.d.ts +5 -0
- package/dist/composables/controlSchemaNormalize.d.ts +1 -1
- package/dist/composables/controlSchemaTypes.d.ts +311 -0
- package/dist/composables/controlWorkspaceOptions.d.ts +1 -1
- package/dist/composables/formBuilderSchema.d.ts +18 -0
- package/dist/composables/index.js +3 -3
- package/dist/composables/pluginEndpointBuilder.d.ts +13 -0
- package/dist/composables/protocolTemplateCatalog.d.ts +26 -0
- package/dist/composables/useAutoGroup.d.ts +61 -74
- package/dist/composables/useAutoGroupInputSources.d.ts +32 -0
- package/dist/composables/useBioTemplateControls.d.ts +1 -1
- package/dist/composables/useBioTemplatePresetWorkspace.d.ts +1 -1
- package/dist/composables/useBioTemplateWorkspace.d.ts +1 -1
- package/dist/composables/useControlSchema.d.ts +4 -316
- package/dist/composables/useControlWorkspace.d.ts +1 -1
- package/dist/composables/useForm.d.ts +2 -33
- package/dist/composables/useFormBuilder.d.ts +2 -9
- package/dist/composables/useFormValidation.d.ts +34 -0
- package/dist/composables/usePluginClient.d.ts +1 -4
- package/dist/composables/useProtocolTemplates.d.ts +2 -24
- package/dist/composables/useScheduleCalendarLayout.d.ts +49 -0
- package/dist/{composables-BMkPQhVK.js → composables-CHDjDIQT.js} +33 -31
- package/dist/composables-CHDjDIQT.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/install.js +2 -2
- package/dist/styles.css +1432 -660
- package/dist/templates/controlSchemaTypes.d.ts +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/templates/templateAdapterTypes.d.ts +48 -0
- package/dist/templates/templateCreateOptions.d.ts +165 -0
- package/dist/templates/templateQpcrTypes.d.ts +42 -0
- package/dist/templates/types.d.ts +5 -250
- package/dist/{templates-bUAWMn5L.js → templates-DSbHJC4v.js} +1536 -297
- package/dist/templates-DSbHJC4v.js.map +1 -0
- package/dist/types/auto-group.d.ts +79 -9
- package/dist/types/componentLabTypes.d.ts +161 -0
- package/dist/types/componentWorkflowTypes.d.ts +150 -0
- package/dist/types/components.d.ts +14 -311
- package/dist/types/form-builder.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/{useProtocolTemplates-QZtHFFH2.js → useProtocolTemplates-BbPOYPzO.js} +1220 -454
- package/dist/useProtocolTemplates-BbPOYPzO.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/components/AppSidebar.test.ts +67 -0
- package/src/__tests__/components/AppTopBar.navigation.test.ts +70 -0
- package/src/__tests__/components/CollapsibleCard.test.ts +47 -0
- package/src/__tests__/components/DoseCalculatorVolumeField.test.ts +53 -0
- package/src/__tests__/components/FormBuilder.test.ts +57 -0
- package/src/__tests__/components/PlateMapEditorToolbarInternal.test.ts +54 -0
- package/src/__tests__/components/PluginWorkspaceView.controls.test.ts +156 -0
- package/src/__tests__/components/PluginWorkspaceView.navigation.test.ts +102 -0
- package/src/__tests__/components/PluginWorkspaceView.shell.test.ts +43 -0
- package/src/__tests__/components/ProtocolStep.presentation.test.ts +31 -0
- package/src/__tests__/components/ProtocolStepEditor.state.test.ts +165 -0
- package/src/__tests__/components/ProtocolStepParameterField.test.ts +44 -0
- package/src/__tests__/components/ReagentList.presentation.test.ts +68 -0
- package/src/__tests__/components/SampleSelector.colors.test.ts +49 -0
- package/src/__tests__/components/SampleSelector.drag.test.ts +100 -0
- package/src/__tests__/components/SampleSelector.groups.test.ts +81 -0
- package/src/__tests__/components/SampleSelector.selection.test.ts +70 -0
- package/src/__tests__/components/SampleSelector.test.ts +32 -0
- package/src/__tests__/components/SampleSelectorSampleRow.test.ts +37 -0
- package/src/__tests__/components/ScheduleCalendar.test.ts +44 -0
- package/src/__tests__/components/SettingsModal.schema.test.ts +97 -0
- package/src/__tests__/components/WellPlate.colors.test.ts +28 -0
- package/src/__tests__/components/WellPlate.conditions.test.ts +68 -0
- package/src/__tests__/components/WellPlate.geometry.test.ts +54 -0
- package/src/__tests__/components/WellPlate.interaction.test.ts +171 -0
- package/src/__tests__/components/WellPlate.legend.test.ts +13 -0
- package/src/__tests__/components/WellPlate.rendering.test.ts +122 -0
- package/src/__tests__/components/WellPlate.sampleDrop.test.ts +70 -0
- package/src/__tests__/composables/autoGroup/classify.test.ts +107 -0
- package/src/__tests__/composables/autoGroup/columns.test.ts +135 -0
- package/src/__tests__/composables/autoGroup/compose.test.ts +227 -0
- package/src/__tests__/composables/autoGroup/cooccurrence.test.ts +91 -0
- package/src/__tests__/composables/autoGroup/fingerprint.test.ts +50 -0
- package/src/__tests__/composables/autoGroup/integration.test.ts +79 -0
- package/src/__tests__/composables/autoGroup/template.test.ts +70 -0
- package/src/__tests__/composables/autoGroup/tokenize.test.ts +33 -0
- package/src/__tests__/composables/useAutoGroup.test.ts +129 -625
- package/src/__tests__/composables/useAutoGroupInputSources.test.ts +107 -0
- package/src/__tests__/composables/useControlSchema.test.ts +23 -0
- package/src/__tests__/composables/useScheduleCalendarLayout.test.ts +89 -0
- package/src/__tests__/docs/extractDocsComponents.test.ts +142 -0
- package/src/__tests__/docs/extractDocsExports.test.ts +77 -0
- package/src/__tests__/docs/extractDocsParsing.test.ts +69 -0
- package/src/__tests__/docs/extractDocsTemplates.test.ts +54 -0
- package/src/__tests__/docs/extractDocsTheme.test.ts +89 -0
- package/src/__tests__/docs/frontendDocsCatalog.test.ts +1 -1
- package/src/__tests__/fixtures/auto-group/mixed-lc-ms-batch.txt +187 -0
- package/src/components/AppSidebar.story.vue +79 -6
- package/src/components/AppSidebar.vue +74 -6
- package/src/components/AppTopBar.navigation.ts +62 -0
- package/src/components/AppTopBar.vue +17 -44
- package/src/components/AutoGroupModal.story.vue +50 -0
- package/src/components/AutoGroupModal.vue +441 -158
- package/src/components/BaseCheckbox.story.vue +27 -0
- package/src/components/BaseCheckbox.vue +63 -1
- package/src/components/BaseToggle.story.vue +27 -0
- package/src/components/BaseToggle.vue +66 -1
- package/src/components/CollapsibleCard.vue +123 -45
- package/src/components/ControlWorkspaceView.vue +2 -6
- package/src/components/DoseCalculator.vue +13 -73
- package/src/components/DoseCalculatorVolumeField.vue +61 -0
- package/src/components/ExperimentTimeline.vue +6 -31
- package/src/components/FormBuilder.story.vue +13 -0
- package/src/components/FormBuilder.vue +2 -7
- package/src/components/PlateMapEditor.vue +32 -106
- package/src/components/PluginWorkspaceView.controls.ts +182 -0
- package/src/components/PluginWorkspaceView.navigation.ts +106 -0
- package/src/components/PluginWorkspaceView.props.ts +174 -0
- package/src/components/PluginWorkspaceView.shell.ts +67 -0
- package/src/components/PluginWorkspaceView.vue +88 -404
- package/src/components/ProtocolStep.presentation.ts +31 -0
- package/src/components/ProtocolStepEditor.state.ts +104 -0
- package/src/components/ProtocolStepEditor.vue +48 -179
- package/src/components/ProtocolStepParameterField.vue +134 -0
- package/src/components/ReagentList.presentation.ts +105 -0
- package/src/components/ReagentList.vue +16 -79
- package/src/components/SampleSelector.colors.ts +43 -0
- package/src/components/SampleSelector.drag.ts +164 -0
- package/src/components/SampleSelector.groups.ts +109 -0
- package/src/components/SampleSelector.selection.ts +103 -0
- package/src/components/SampleSelector.vue +82 -349
- package/src/components/SampleSelectorSampleRow.vue +64 -0
- package/src/components/ScheduleCalendar.vue +44 -199
- package/src/components/SettingsModal.schema.ts +71 -0
- package/src/components/SettingsModal.vue +16 -46
- package/src/components/WellPlate.colors.ts +56 -0
- package/src/components/WellPlate.conditions.ts +100 -0
- package/src/components/WellPlate.geometry.ts +91 -0
- package/src/components/WellPlate.interaction.ts +272 -0
- package/src/components/WellPlate.legend.ts +8 -0
- package/src/components/WellPlate.rendering.ts +105 -0
- package/src/components/WellPlate.sampleDrop.ts +73 -0
- package/src/components/WellPlate.vue +102 -550
- package/src/components/internal/FormFieldRendererInternal.vue +23 -5
- package/src/components/internal/PlateMapEditorToolbarInternal.vue +128 -0
- package/src/composables/autoGroup/classKey.ts +5 -0
- package/src/composables/autoGroup/classify.ts +205 -0
- package/src/composables/autoGroup/colors.ts +6 -0
- package/src/composables/autoGroup/columns.ts +226 -0
- package/src/composables/autoGroup/compose.ts +156 -0
- package/src/composables/autoGroup/cooccurrence.ts +46 -0
- package/src/composables/autoGroup/csv-shim.ts +44 -0
- package/src/composables/autoGroup/fingerprint.ts +49 -0
- package/src/composables/autoGroup/index.ts +20 -0
- package/src/composables/autoGroup/replicatePreGroup.ts +90 -0
- package/src/composables/autoGroup/template.ts +126 -0
- package/src/composables/autoGroup/tokenize.ts +41 -0
- package/src/composables/autoGroup/vocab.json +67 -0
- package/src/composables/autoGroupConstants.ts +4 -0
- package/src/composables/autoGroupGrouping.ts +148 -0
- package/src/composables/controlComponentBindings.ts +1 -1
- package/src/composables/controlSchemaAdapters.ts +4 -1
- package/src/composables/controlSchemaDoseDesign.ts +215 -0
- package/src/composables/controlSchemaFormFields.ts +4 -1
- package/src/composables/controlSchemaLayout.ts +1 -1
- package/src/composables/controlSchemaModel.ts +163 -0
- package/src/composables/controlSchemaNormalize.ts +1 -1
- package/src/composables/controlSchemaTypes.ts +372 -0
- package/src/composables/controlWorkspaceOptions.ts +1 -1
- package/src/composables/formBuilderSchema.ts +153 -0
- package/src/composables/pluginEndpointBuilder.ts +203 -0
- package/src/composables/protocolTemplateCatalog.ts +325 -0
- package/src/composables/useAutoGroup.ts +395 -549
- package/src/composables/useAutoGroupInputSources.ts +147 -0
- package/src/composables/useBioTemplateControls.ts +1 -1
- package/src/composables/useBioTemplatePresetWorkspace.ts +1 -1
- package/src/composables/useBioTemplateWorkspace.ts +1 -1
- package/src/composables/useControlSchema.ts +21 -692
- package/src/composables/useControlWorkspace.ts +7 -13
- package/src/composables/useForm.ts +5 -187
- package/src/composables/useFormBuilder.ts +11 -153
- package/src/composables/useFormValidation.ts +154 -0
- package/src/composables/usePluginClient.ts +10 -193
- package/src/composables/useProtocolTemplates.ts +10 -328
- package/src/composables/useScheduleCalendarLayout.ts +287 -0
- package/src/styles/components/app-sidebar.css +134 -6
- package/src/styles/components/auto-group-modal.css +248 -310
- package/src/styles/components/checkbox.css +87 -0
- package/src/styles/components/collapsible-card.css +154 -14
- package/src/styles/components/toggle.css +80 -0
- package/src/templates/controlSchemaTypes.ts +1 -1
- package/src/templates/templateAdapterTypes.ts +58 -0
- package/src/templates/templateCreateOptions.ts +208 -0
- package/src/templates/templateQpcrTypes.ts +48 -0
- package/src/templates/types.ts +79 -275
- package/src/types/auto-group.ts +107 -9
- package/src/types/componentLabTypes.ts +235 -0
- package/src/types/componentWorkflowTypes.ts +190 -0
- package/src/types/components.ts +95 -424
- package/src/types/form-builder.ts +3 -0
- package/src/types/index.ts +2 -0
- package/dist/components-DafPc4rM.js.map +0 -1
- package/dist/composables-BMkPQhVK.js.map +0 -1
- package/dist/templates-bUAWMn5L.js.map +0 -1
- package/dist/useProtocolTemplates-QZtHFFH2.js.map +0 -1
|
@@ -7,8 +7,18 @@ import {
|
|
|
7
7
|
getInjectedPlatformContext,
|
|
8
8
|
resolveCurrentExperimentId,
|
|
9
9
|
} from './platformContextHelpers'
|
|
10
|
+
import {
|
|
11
|
+
hasKeys,
|
|
12
|
+
pluginEndpointRequestParts,
|
|
13
|
+
requestBodyFromPayload,
|
|
14
|
+
} from './pluginEndpointBuilder'
|
|
10
15
|
import type { ExperimentSummary, PageSelectorItem } from '../types'
|
|
11
16
|
|
|
17
|
+
export {
|
|
18
|
+
buildPluginEndpointUrl,
|
|
19
|
+
resolvePluginBaseUrl,
|
|
20
|
+
} from './pluginEndpointBuilder'
|
|
21
|
+
|
|
12
22
|
export type PluginHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete'
|
|
13
23
|
|
|
14
24
|
export interface PluginEndpointContract {
|
|
@@ -115,19 +125,6 @@ export interface UseCurrentExperimentReturn<TExperiment = ExperimentSummary> {
|
|
|
115
125
|
export type PluginEndpointCaller = (payload?: unknown) => Promise<unknown>
|
|
116
126
|
export type GeneratedPluginClient = Record<string, (...args: any[]) => Promise<any>>
|
|
117
127
|
|
|
118
|
-
function normalizeApiBaseUrl(baseUrl: string | undefined): string | undefined {
|
|
119
|
-
if (!baseUrl) return undefined
|
|
120
|
-
return baseUrl.length > 1 ? baseUrl.replace(/\/+$/, '') : baseUrl
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function normalizeApiPrefix(prefix: string | undefined): string | undefined {
|
|
124
|
-
if (!prefix) return undefined
|
|
125
|
-
if (prefix.startsWith('/api/')) return normalizeApiBaseUrl(prefix)
|
|
126
|
-
if (prefix === '/api') return prefix
|
|
127
|
-
if (prefix.startsWith('/')) return normalizeApiBaseUrl(`/api${prefix}`)
|
|
128
|
-
return normalizeApiBaseUrl(`/api/${prefix}`)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
128
|
function normalizePluginNavPath(path: string): string {
|
|
132
129
|
const raw = path.trim() || '/'
|
|
133
130
|
const prefixed = raw.startsWith('/') ? raw : `/${raw}`
|
|
@@ -163,186 +160,6 @@ export function getPluginPageSelectorItems(contract: PluginContract): PageSelect
|
|
|
163
160
|
}))
|
|
164
161
|
}
|
|
165
162
|
|
|
166
|
-
/** Resolve the runtime plugin API base URL from env, explicit options, platform injection, or contract metadata. */
|
|
167
|
-
export function resolvePluginBaseUrl(contract: PluginContract, explicitBaseUrl?: string): string {
|
|
168
|
-
const envPrefix = (import.meta.env?.VITE_API_PREFIX as string | undefined) || undefined
|
|
169
|
-
if (envPrefix) return normalizeApiBaseUrl(envPrefix) ?? envPrefix
|
|
170
|
-
if (explicitBaseUrl) return normalizeApiBaseUrl(explicitBaseUrl) ?? explicitBaseUrl
|
|
171
|
-
|
|
172
|
-
const injected = getInjectedPlatformContext()
|
|
173
|
-
const platformPrefix =
|
|
174
|
-
normalizeApiBaseUrl(injected?.plugin?.api_prefix) ||
|
|
175
|
-
normalizeApiPrefix(injected?.plugin?.route_prefix)
|
|
176
|
-
if (platformPrefix) return platformPrefix
|
|
177
|
-
|
|
178
|
-
return normalizeApiBaseUrl(contract.plugin.apiPrefix) || '/api'
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function encodePath(path: string, payload: Record<string, unknown>, pathParams: string[]): string {
|
|
182
|
-
let nextPath = path
|
|
183
|
-
for (const param of pathParams) {
|
|
184
|
-
const value = payload[param]
|
|
185
|
-
if (value === undefined || value === null) {
|
|
186
|
-
throw new Error(`[MINT SDK] Missing path parameter '${param}' for plugin endpoint ${path}`)
|
|
187
|
-
}
|
|
188
|
-
nextPath = nextPath.replace(`{${param}}`, encodeURIComponent(String(value)))
|
|
189
|
-
nextPath = nextPath.replace(`:${param}`, encodeURIComponent(String(value)))
|
|
190
|
-
}
|
|
191
|
-
return nextPath
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function withDefaultPathParams(
|
|
195
|
-
payload: Record<string, unknown>,
|
|
196
|
-
pathParams: string[],
|
|
197
|
-
): Record<string, unknown> {
|
|
198
|
-
if (!pathParams.length) return payload
|
|
199
|
-
const nextPayload = { ...payload }
|
|
200
|
-
for (const param of pathParams) {
|
|
201
|
-
if (nextPayload[param] !== undefined && nextPayload[param] !== null) continue
|
|
202
|
-
if (isExperimentPathParam(param)) {
|
|
203
|
-
const experimentId = resolveCurrentExperimentId()
|
|
204
|
-
if (experimentId !== undefined) {
|
|
205
|
-
nextPayload[param] = experimentId
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return nextPayload
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function isExperimentPathParam(param: string): boolean {
|
|
213
|
-
return param === 'experimentId' || param === 'experiment_id'
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function withoutPathParams(payload: Record<string, unknown>, pathParams: string[]) {
|
|
217
|
-
const copy = { ...payload }
|
|
218
|
-
for (const param of pathParams) {
|
|
219
|
-
delete copy[param]
|
|
220
|
-
}
|
|
221
|
-
return copy
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function queryParamsFromPayload(
|
|
225
|
-
payload: Record<string, unknown>,
|
|
226
|
-
pathParams: string[],
|
|
227
|
-
queryParams?: PluginEndpointParamDefinition[],
|
|
228
|
-
endpointPath?: string,
|
|
229
|
-
includeUnspecifiedParams = false,
|
|
230
|
-
) {
|
|
231
|
-
if (!queryParams?.length) {
|
|
232
|
-
return includeUnspecifiedParams ? withoutPathParams(payload, pathParams) : {}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const query: Record<string, unknown> = {}
|
|
236
|
-
for (const param of queryParams) {
|
|
237
|
-
const name = typeof param === 'string' ? param : param.name
|
|
238
|
-
const fieldName = typeof param === 'string' ? param : param.fieldName ?? param.name
|
|
239
|
-
const required = typeof param !== 'string' && param.required === true
|
|
240
|
-
const value = payload[fieldName]
|
|
241
|
-
if (value === undefined || value === null) {
|
|
242
|
-
if (required) {
|
|
243
|
-
throw new Error(
|
|
244
|
-
`[MINT SDK] Missing query parameter '${fieldName}' for plugin endpoint ${endpointPath ?? ''}`,
|
|
245
|
-
)
|
|
246
|
-
}
|
|
247
|
-
continue
|
|
248
|
-
}
|
|
249
|
-
query[name] = value
|
|
250
|
-
}
|
|
251
|
-
return query
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function hasKeys(value: Record<string, unknown>): boolean {
|
|
255
|
-
return Object.keys(value).length > 0
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function requestBodyFromPayload(
|
|
259
|
-
payload: unknown,
|
|
260
|
-
requestPayload: Record<string, unknown>,
|
|
261
|
-
endpoint: PluginEndpointDefinition,
|
|
262
|
-
): unknown {
|
|
263
|
-
if (!endpoint.hasBody) return undefined
|
|
264
|
-
const body = endpoint.pathParams?.length || endpoint.queryParams?.length
|
|
265
|
-
? requestPayload.body
|
|
266
|
-
: payload
|
|
267
|
-
if (body === undefined || body === null) {
|
|
268
|
-
throw new Error(`[MINT SDK] Missing request body for plugin endpoint ${endpoint.path}`)
|
|
269
|
-
}
|
|
270
|
-
return body
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
function pluginEndpointRequestParts(
|
|
274
|
-
contract: PluginContract,
|
|
275
|
-
endpoint: PluginEndpointDefinition,
|
|
276
|
-
payload?: unknown,
|
|
277
|
-
explicitBaseUrl?: string,
|
|
278
|
-
) {
|
|
279
|
-
const payloadObject =
|
|
280
|
-
payload && typeof payload === 'object' && !Array.isArray(payload)
|
|
281
|
-
? payload as Record<string, unknown>
|
|
282
|
-
: {}
|
|
283
|
-
const pathParams = endpoint.pathParams ?? []
|
|
284
|
-
const requestPayload = withDefaultPathParams(payloadObject, pathParams)
|
|
285
|
-
const path = encodePath(endpoint.path, requestPayload, pathParams)
|
|
286
|
-
const query = queryParamsFromPayload(
|
|
287
|
-
requestPayload,
|
|
288
|
-
pathParams,
|
|
289
|
-
endpoint.queryParams,
|
|
290
|
-
endpoint.path,
|
|
291
|
-
endpoint.method === 'get',
|
|
292
|
-
)
|
|
293
|
-
|
|
294
|
-
return {
|
|
295
|
-
baseUrl: resolvePluginBaseUrl(contract, explicitBaseUrl),
|
|
296
|
-
path,
|
|
297
|
-
query,
|
|
298
|
-
requestPayload,
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
function appendQueryValue(params: URLSearchParams, key: string, value: unknown): void {
|
|
303
|
-
if (value === undefined || value === null) return
|
|
304
|
-
if (Array.isArray(value)) {
|
|
305
|
-
for (const item of value) {
|
|
306
|
-
appendQueryValue(params, key, item)
|
|
307
|
-
}
|
|
308
|
-
return
|
|
309
|
-
}
|
|
310
|
-
if (typeof value === 'object') {
|
|
311
|
-
params.append(key, JSON.stringify(value))
|
|
312
|
-
return
|
|
313
|
-
}
|
|
314
|
-
params.append(key, String(value))
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
function queryString(query: Record<string, unknown>): string {
|
|
318
|
-
const params = new URLSearchParams()
|
|
319
|
-
for (const [key, value] of Object.entries(query)) {
|
|
320
|
-
appendQueryValue(params, key, value)
|
|
321
|
-
}
|
|
322
|
-
const serialized = params.toString()
|
|
323
|
-
return serialized ? `?${serialized}` : ''
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function joinBaseUrl(baseUrl: string, path: string): string {
|
|
327
|
-
if (!baseUrl) return path
|
|
328
|
-
const normalizedBase = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl
|
|
329
|
-
const normalizedPath = path.startsWith('/') ? path : `/${path}`
|
|
330
|
-
return `${normalizedBase}${normalizedPath}`
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/** Build the concrete URL for a generated plugin endpoint without making a request. */
|
|
334
|
-
export function buildPluginEndpointUrl(
|
|
335
|
-
contract: PluginContract,
|
|
336
|
-
endpoint: PluginEndpointDefinition,
|
|
337
|
-
payload?: unknown,
|
|
338
|
-
options: BuildPluginEndpointUrlOptions = {},
|
|
339
|
-
): string {
|
|
340
|
-
const parts = pluginEndpointRequestParts(contract, endpoint, payload, options.baseUrl)
|
|
341
|
-
const pathWithQuery = `${parts.path}${queryString(parts.query)}`
|
|
342
|
-
if (options.includeBaseUrl === false) return pathWithQuery
|
|
343
|
-
return joinBaseUrl(parts.baseUrl, pathWithQuery)
|
|
344
|
-
}
|
|
345
|
-
|
|
346
163
|
/** Create a typed plugin API client from a generated MINT plugin contract. */
|
|
347
164
|
export function createPluginClient<TClient extends object = GeneratedPluginClient>(
|
|
348
165
|
contract: PluginContract,
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
import { ref, computed, type Ref, type ComputedRef } from 'vue'
|
|
2
2
|
import type { ProtocolStep, ProtocolStepType, ProtocolStepStatus } from '../types'
|
|
3
|
+
import {
|
|
4
|
+
BUILT_IN_PROTOCOL_TEMPLATES,
|
|
5
|
+
type ParameterDefinition,
|
|
6
|
+
type StepTemplate,
|
|
7
|
+
} from './protocolTemplateCatalog'
|
|
3
8
|
|
|
4
|
-
|
|
5
|
-
export interface ParameterDefinition {
|
|
6
|
-
key: string
|
|
7
|
-
label: string
|
|
8
|
-
type: 'number' | 'text' | 'select' | 'concentration' | 'temperature' | 'duration' | 'reagent'
|
|
9
|
-
unit?: string
|
|
10
|
-
options?: Array<{ value: string; label: string }>
|
|
11
|
-
required?: boolean
|
|
12
|
-
default?: unknown
|
|
13
|
-
min?: number
|
|
14
|
-
max?: number
|
|
15
|
-
placeholder?: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Step template definition
|
|
19
|
-
export interface StepTemplate {
|
|
20
|
-
id: string
|
|
21
|
-
type: ProtocolStepType
|
|
22
|
-
name: string
|
|
23
|
-
description?: string
|
|
24
|
-
defaultDuration?: number
|
|
25
|
-
parameters: ParameterDefinition[]
|
|
26
|
-
isBuiltIn?: boolean
|
|
27
|
-
}
|
|
9
|
+
export type { ParameterDefinition, StepTemplate } from './protocolTemplateCatalog'
|
|
28
10
|
|
|
29
11
|
// Validation result
|
|
30
12
|
export interface ValidationResult {
|
|
@@ -45,306 +27,6 @@ export interface UseProtocolTemplatesReturn {
|
|
|
45
27
|
formatParameterValue: (value: unknown, param: ParameterDefinition) => string
|
|
46
28
|
}
|
|
47
29
|
|
|
48
|
-
// Built-in templates
|
|
49
|
-
const BUILT_IN_TEMPLATES: StepTemplate[] = [
|
|
50
|
-
{
|
|
51
|
-
id: 'builtin-incubation',
|
|
52
|
-
type: 'incubation',
|
|
53
|
-
name: 'Incubation',
|
|
54
|
-
description: 'Incubate samples at specified conditions',
|
|
55
|
-
defaultDuration: 60,
|
|
56
|
-
isBuiltIn: true,
|
|
57
|
-
parameters: [
|
|
58
|
-
{
|
|
59
|
-
key: 'temperature',
|
|
60
|
-
label: 'Temperature',
|
|
61
|
-
type: 'temperature',
|
|
62
|
-
unit: '°C',
|
|
63
|
-
required: true,
|
|
64
|
-
default: 37,
|
|
65
|
-
min: -80,
|
|
66
|
-
max: 100,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
key: 'duration',
|
|
70
|
-
label: 'Duration',
|
|
71
|
-
type: 'duration',
|
|
72
|
-
unit: 'hours',
|
|
73
|
-
required: true,
|
|
74
|
-
default: 24,
|
|
75
|
-
min: 0,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
key: 'co2',
|
|
79
|
-
label: 'CO2',
|
|
80
|
-
type: 'number',
|
|
81
|
-
unit: '%',
|
|
82
|
-
required: false,
|
|
83
|
-
default: 5,
|
|
84
|
-
min: 0,
|
|
85
|
-
max: 100,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
key: 'humidity',
|
|
89
|
-
label: 'Humidity',
|
|
90
|
-
type: 'number',
|
|
91
|
-
unit: '%',
|
|
92
|
-
required: false,
|
|
93
|
-
default: 95,
|
|
94
|
-
min: 0,
|
|
95
|
-
max: 100,
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: 'builtin-wash',
|
|
101
|
-
type: 'wash',
|
|
102
|
-
name: 'Wash',
|
|
103
|
-
description: 'Wash samples with buffer',
|
|
104
|
-
defaultDuration: 5,
|
|
105
|
-
isBuiltIn: true,
|
|
106
|
-
parameters: [
|
|
107
|
-
{
|
|
108
|
-
key: 'buffer',
|
|
109
|
-
label: 'Buffer',
|
|
110
|
-
type: 'select',
|
|
111
|
-
required: true,
|
|
112
|
-
default: 'PBS',
|
|
113
|
-
options: [
|
|
114
|
-
{ value: 'PBS', label: 'PBS' },
|
|
115
|
-
{ value: 'PBST', label: 'PBST' },
|
|
116
|
-
{ value: 'TBS', label: 'TBS' },
|
|
117
|
-
{ value: 'TBST', label: 'TBST' },
|
|
118
|
-
{ value: 'Water', label: 'Water' },
|
|
119
|
-
{ value: 'Other', label: 'Other' },
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
key: 'volume',
|
|
124
|
-
label: 'Volume',
|
|
125
|
-
type: 'number',
|
|
126
|
-
unit: 'µL',
|
|
127
|
-
required: true,
|
|
128
|
-
default: 200,
|
|
129
|
-
min: 0,
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
key: 'cycles',
|
|
133
|
-
label: 'Wash Cycles',
|
|
134
|
-
type: 'number',
|
|
135
|
-
required: true,
|
|
136
|
-
default: 3,
|
|
137
|
-
min: 1,
|
|
138
|
-
max: 10,
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: 'builtin-addition',
|
|
144
|
-
type: 'addition',
|
|
145
|
-
name: 'Addition',
|
|
146
|
-
description: 'Add reagent or compound to samples',
|
|
147
|
-
defaultDuration: 5,
|
|
148
|
-
isBuiltIn: true,
|
|
149
|
-
parameters: [
|
|
150
|
-
{
|
|
151
|
-
key: 'reagent',
|
|
152
|
-
label: 'Reagent',
|
|
153
|
-
type: 'text',
|
|
154
|
-
required: true,
|
|
155
|
-
placeholder: 'Enter reagent name',
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
key: 'volume',
|
|
159
|
-
label: 'Volume',
|
|
160
|
-
type: 'number',
|
|
161
|
-
unit: 'µL',
|
|
162
|
-
required: true,
|
|
163
|
-
default: 100,
|
|
164
|
-
min: 0,
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
key: 'concentration',
|
|
168
|
-
label: 'Concentration',
|
|
169
|
-
type: 'concentration',
|
|
170
|
-
required: false,
|
|
171
|
-
},
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
id: 'builtin-measurement',
|
|
176
|
-
type: 'measurement',
|
|
177
|
-
name: 'Measurement',
|
|
178
|
-
description: 'Take measurements using specified instrument',
|
|
179
|
-
defaultDuration: 15,
|
|
180
|
-
isBuiltIn: true,
|
|
181
|
-
parameters: [
|
|
182
|
-
{
|
|
183
|
-
key: 'instrument',
|
|
184
|
-
label: 'Instrument',
|
|
185
|
-
type: 'select',
|
|
186
|
-
required: true,
|
|
187
|
-
options: [
|
|
188
|
-
{ value: 'plate_reader', label: 'Plate Reader' },
|
|
189
|
-
{ value: 'microscope', label: 'Microscope' },
|
|
190
|
-
{ value: 'flow_cytometer', label: 'Flow Cytometer' },
|
|
191
|
-
{ value: 'spectrophotometer', label: 'Spectrophotometer' },
|
|
192
|
-
{ value: 'other', label: 'Other' },
|
|
193
|
-
],
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
key: 'readout',
|
|
197
|
-
label: 'Readout Type',
|
|
198
|
-
type: 'text',
|
|
199
|
-
required: false,
|
|
200
|
-
placeholder: 'e.g., Absorbance 450nm',
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
key: 'notes',
|
|
204
|
-
label: 'Parameters',
|
|
205
|
-
type: 'text',
|
|
206
|
-
required: false,
|
|
207
|
-
placeholder: 'Additional parameters',
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
id: 'builtin-centrifuge',
|
|
213
|
-
type: 'centrifuge',
|
|
214
|
-
name: 'Centrifuge',
|
|
215
|
-
description: 'Centrifuge samples',
|
|
216
|
-
defaultDuration: 10,
|
|
217
|
-
isBuiltIn: true,
|
|
218
|
-
parameters: [
|
|
219
|
-
{
|
|
220
|
-
key: 'speed',
|
|
221
|
-
label: 'Speed',
|
|
222
|
-
type: 'number',
|
|
223
|
-
unit: 'RPM',
|
|
224
|
-
required: true,
|
|
225
|
-
default: 1000,
|
|
226
|
-
min: 100,
|
|
227
|
-
max: 20000,
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
key: 'duration',
|
|
231
|
-
label: 'Duration',
|
|
232
|
-
type: 'number',
|
|
233
|
-
unit: 'min',
|
|
234
|
-
required: true,
|
|
235
|
-
default: 5,
|
|
236
|
-
min: 1,
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
key: 'temperature',
|
|
240
|
-
label: 'Temperature',
|
|
241
|
-
type: 'temperature',
|
|
242
|
-
unit: '°C',
|
|
243
|
-
required: false,
|
|
244
|
-
default: 4,
|
|
245
|
-
min: -10,
|
|
246
|
-
max: 40,
|
|
247
|
-
},
|
|
248
|
-
],
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
id: 'builtin-transfer',
|
|
252
|
-
type: 'transfer',
|
|
253
|
-
name: 'Transfer',
|
|
254
|
-
description: 'Transfer samples between containers',
|
|
255
|
-
defaultDuration: 10,
|
|
256
|
-
isBuiltIn: true,
|
|
257
|
-
parameters: [
|
|
258
|
-
{
|
|
259
|
-
key: 'source',
|
|
260
|
-
label: 'Source',
|
|
261
|
-
type: 'text',
|
|
262
|
-
required: true,
|
|
263
|
-
placeholder: 'Source container',
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
key: 'destination',
|
|
267
|
-
label: 'Destination',
|
|
268
|
-
type: 'text',
|
|
269
|
-
required: true,
|
|
270
|
-
placeholder: 'Destination container',
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
key: 'volume',
|
|
274
|
-
label: 'Volume',
|
|
275
|
-
type: 'number',
|
|
276
|
-
unit: 'µL',
|
|
277
|
-
required: true,
|
|
278
|
-
default: 100,
|
|
279
|
-
min: 0,
|
|
280
|
-
},
|
|
281
|
-
],
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
id: 'builtin-mix',
|
|
285
|
-
type: 'mix',
|
|
286
|
-
name: 'Mix',
|
|
287
|
-
description: 'Mix samples',
|
|
288
|
-
defaultDuration: 5,
|
|
289
|
-
isBuiltIn: true,
|
|
290
|
-
parameters: [
|
|
291
|
-
{
|
|
292
|
-
key: 'method',
|
|
293
|
-
label: 'Method',
|
|
294
|
-
type: 'select',
|
|
295
|
-
required: true,
|
|
296
|
-
default: 'pipette',
|
|
297
|
-
options: [
|
|
298
|
-
{ value: 'pipette', label: 'Pipette mixing' },
|
|
299
|
-
{ value: 'vortex', label: 'Vortex' },
|
|
300
|
-
{ value: 'shaker', label: 'Orbital shaker' },
|
|
301
|
-
{ value: 'inversion', label: 'Inversion' },
|
|
302
|
-
],
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
key: 'duration',
|
|
306
|
-
label: 'Duration',
|
|
307
|
-
type: 'number',
|
|
308
|
-
unit: 'sec',
|
|
309
|
-
required: false,
|
|
310
|
-
default: 30,
|
|
311
|
-
min: 1,
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
key: 'speed',
|
|
315
|
-
label: 'Speed/Intensity',
|
|
316
|
-
type: 'text',
|
|
317
|
-
required: false,
|
|
318
|
-
placeholder: 'e.g., 300 RPM',
|
|
319
|
-
},
|
|
320
|
-
],
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
id: 'builtin-custom',
|
|
324
|
-
type: 'custom',
|
|
325
|
-
name: 'Custom Step',
|
|
326
|
-
description: 'Custom protocol step',
|
|
327
|
-
defaultDuration: 15,
|
|
328
|
-
isBuiltIn: true,
|
|
329
|
-
parameters: [
|
|
330
|
-
{
|
|
331
|
-
key: 'description',
|
|
332
|
-
label: 'Description',
|
|
333
|
-
type: 'text',
|
|
334
|
-
required: true,
|
|
335
|
-
placeholder: 'Describe the step',
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
key: 'notes',
|
|
339
|
-
label: 'Notes',
|
|
340
|
-
type: 'text',
|
|
341
|
-
required: false,
|
|
342
|
-
placeholder: 'Additional notes',
|
|
343
|
-
},
|
|
344
|
-
],
|
|
345
|
-
},
|
|
346
|
-
]
|
|
347
|
-
|
|
348
30
|
// Storage key for custom templates
|
|
349
31
|
const STORAGE_KEY = 'mint-custom-protocol-templates'
|
|
350
32
|
|
|
@@ -385,21 +67,21 @@ export function useProtocolTemplates(): UseProtocolTemplatesReturn {
|
|
|
385
67
|
const customTemplates = ref<StepTemplate[]>(loadCustomTemplates())
|
|
386
68
|
|
|
387
69
|
const allTemplates = computed(() => {
|
|
388
|
-
return [...
|
|
70
|
+
return [...BUILT_IN_PROTOCOL_TEMPLATES, ...customTemplates.value]
|
|
389
71
|
})
|
|
390
72
|
|
|
391
73
|
function getTemplateByType(type: ProtocolStepType): StepTemplate | undefined {
|
|
392
74
|
// First check custom templates, then built-in
|
|
393
75
|
return (
|
|
394
76
|
customTemplates.value.find((t) => t.type === type) ||
|
|
395
|
-
|
|
77
|
+
BUILT_IN_PROTOCOL_TEMPLATES.find((t) => t.type === type)
|
|
396
78
|
)
|
|
397
79
|
}
|
|
398
80
|
|
|
399
81
|
function getTemplateById(id: string): StepTemplate | undefined {
|
|
400
82
|
return (
|
|
401
83
|
customTemplates.value.find((t) => t.id === id) ||
|
|
402
|
-
|
|
84
|
+
BUILT_IN_PROTOCOL_TEMPLATES.find((t) => t.id === id)
|
|
403
85
|
)
|
|
404
86
|
}
|
|
405
87
|
|
|
@@ -516,7 +198,7 @@ export function useProtocolTemplates(): UseProtocolTemplatesReturn {
|
|
|
516
198
|
}
|
|
517
199
|
|
|
518
200
|
return {
|
|
519
|
-
builtInTemplates:
|
|
201
|
+
builtInTemplates: BUILT_IN_PROTOCOL_TEMPLATES,
|
|
520
202
|
customTemplates,
|
|
521
203
|
allTemplates,
|
|
522
204
|
getTemplateByType,
|