@morscherlab/mint-sdk 1.0.0-rc.1 → 1.0.0-rc.4
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/README.md +9 -1
- package/dist/__tests__/components/LcmsSequenceTable.test.d.ts +1 -0
- package/dist/__tests__/components/ProgressBar.test.d.ts +1 -0
- package/dist/__tests__/components/RackEditor.test.d.ts +1 -0
- package/dist/__tests__/components/SequenceProgressBar.test.d.ts +1 -0
- package/dist/__tests__/composables/useExperimentSamples.test.d.ts +1 -0
- package/dist/__tests__/utils/instrument.test.d.ts +1 -0
- package/dist/__tests__/utils/lcms.test.d.ts +1 -0
- package/dist/__tests__/utils/permissions.test.d.ts +1 -0
- package/dist/__tests__/utils/rack.test.d.ts +1 -0
- package/dist/{auth-CBG3bWEc.js → auth-B7g4J4ZF.js} +99 -5
- package/dist/auth-B7g4J4ZF.js.map +1 -0
- package/dist/components/AppSidebar.vue.d.ts +3 -3
- package/dist/components/AutoGroupModal.vue.d.ts +1 -1
- package/dist/components/BaseCheckbox.vue.d.ts +1 -1
- package/dist/components/BaseToggle.vue.d.ts +2 -2
- package/dist/components/BioTemplateExperimentWorkspaceView.vue.d.ts +1 -1
- package/dist/components/BioTemplatePackWorkspaceView.vue.d.ts +1 -1
- package/dist/components/BioTemplatePresetWorkspaceView.vue.d.ts +1 -1
- package/dist/components/ControlWorkspaceView.vue.d.ts +3 -3
- package/dist/components/DoseDesignWorkspaceView.vue.d.ts +2 -2
- package/dist/components/FormulaInput.vue.d.ts +1 -1
- package/dist/components/InstrumentAlertLog.vue.d.ts +22 -0
- package/dist/components/InstrumentStateBadge.vue.d.ts +11 -0
- package/dist/components/InstrumentStatusCard.vue.d.ts +13 -0
- package/dist/components/LcmsSequenceTable.vue.d.ts +26 -0
- package/dist/components/PluginWorkspaceView.vue.d.ts +3 -3
- package/dist/components/ProgressBar.vue.d.ts +1 -0
- package/dist/components/RackEditor.vue.d.ts +41 -3
- package/dist/components/ReagentList.vue.d.ts +1 -1
- package/dist/components/SampleSelector.vue.d.ts +5 -2
- package/dist/components/SegmentedControl.vue.d.ts +2 -0
- package/dist/components/SequenceInput.vue.d.ts +1 -1
- package/dist/components/SequenceProgressBar.vue.d.ts +15 -0
- package/dist/components/SettingsModal.vue.d.ts +3 -1
- package/dist/components/TagsInput.vue.d.ts +1 -1
- package/dist/components/WellPlate.vue.d.ts +42 -3
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +3 -3
- package/dist/{components-5KSfsVqf.js → components-DafPc4rM.js} +2091 -1051
- package/dist/components-DafPc4rM.js.map +1 -0
- package/dist/composables/controlComponentBindings.d.ts +7 -0
- package/dist/composables/controlSchemaAdapters.d.ts +20 -0
- package/dist/composables/controlSchemaFormFields.d.ts +3 -0
- package/dist/composables/controlSchemaLayout.d.ts +7 -0
- package/dist/composables/controlSchemaNormalize.d.ts +15 -0
- package/dist/composables/controlSchemaUtils.d.ts +9 -0
- package/dist/composables/controlWorkspaceOptions.d.ts +2 -0
- package/dist/composables/experimentDesignData.d.ts +17 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +4 -4
- package/dist/composables/useControlSchema.d.ts +15 -30
- package/dist/composables/useControlWorkspace.d.ts +5 -0
- package/dist/composables/useExperimentData.d.ts +11 -3
- package/dist/composables/useExperimentSamples.d.ts +42 -0
- package/dist/composables/usePlatformContext.d.ts +54 -0
- package/dist/{composables-D4Myb30a.js → composables-BMkPQhVK.js} +5 -3
- package/dist/composables-BMkPQhVK.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +168 -6
- package/dist/index.js.map +1 -0
- package/dist/install.js +2 -2
- package/dist/instrument.d.ts +7 -0
- package/dist/lcms.d.ts +27 -0
- package/dist/permissions.d.ts +46 -0
- package/dist/stores/auth.d.ts +74 -2
- package/dist/stores/index.js +1 -1
- package/dist/styles.css +3316 -1216
- package/dist/templates/adapters.d.ts +14 -47
- package/dist/templates/assayLookups.d.ts +3 -0
- package/dist/templates/assayMatrixAdapters.d.ts +6 -0
- package/dist/templates/assayMatrixBuilder.d.ts +2 -0
- package/dist/templates/assayNormalizers.d.ts +4 -0
- package/dist/templates/builderDefaults.d.ts +1 -0
- package/dist/templates/builderIdUtils.d.ts +4 -0
- package/dist/templates/builderPresetControls.d.ts +10 -0
- package/dist/templates/builderReadUtils.d.ts +8 -0
- package/dist/templates/builders.d.ts +26 -63
- package/dist/templates/calibrationCurveAdapters.d.ts +4 -0
- package/dist/templates/calibrationCurveBuilder.d.ts +2 -0
- package/dist/templates/calibrationNormalizers.d.ts +5 -0
- package/dist/templates/componentBindingCatalog.d.ts +25 -0
- package/dist/templates/componentBindingHelpers.d.ts +17 -0
- package/dist/templates/componentDoseResponseProps.d.ts +3 -0
- package/dist/templates/componentGenericProps.d.ts +8 -0
- package/dist/templates/componentPlateHelpers.d.ts +5 -0
- package/dist/templates/componentPlateMapProps.d.ts +3 -0
- package/dist/templates/componentPropsFactory.d.ts +3 -0
- package/dist/templates/componentQpcrPlateProps.d.ts +3 -0
- package/dist/templates/componentTargetResolvers.d.ts +5 -0
- package/dist/templates/componentTemplateProps.d.ts +3 -0
- package/dist/templates/controlSchemaClone.d.ts +4 -0
- package/dist/templates/controlSchemaConstants.d.ts +10 -0
- package/dist/templates/controlSchemaMerge.d.ts +3 -0
- package/dist/templates/controlSchemaTargets.d.ts +17 -0
- package/dist/templates/controlSchemaTypes.d.ts +4 -0
- package/dist/templates/controlSchemas.d.ts +4 -4
- package/dist/templates/defaultBioTemplateBuilder.d.ts +2 -0
- package/dist/templates/doseResponseAdapters.d.ts +4 -0
- package/dist/templates/doseResponseBuilder.d.ts +2 -0
- package/dist/templates/elisaAssayCollectionBuilder.d.ts +2 -0
- package/dist/templates/flowCytometryAssayCollectionBuilder.d.ts +2 -0
- package/dist/templates/flowCytometryPanelBuilder.d.ts +2 -0
- package/dist/templates/flowNormalizers.d.ts +8 -0
- package/dist/templates/flowPanelAdapters.d.ts +4 -0
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +2 -2
- package/dist/templates/instrumentRunAdapterHelpers.d.ts +8 -0
- package/dist/templates/instrumentRunAdapters.d.ts +8 -0
- package/dist/templates/instrumentRunBuilder.d.ts +2 -0
- package/dist/templates/lcmsBatchCollectionBuilder.d.ts +2 -0
- package/dist/templates/plateGeometry.d.ts +4 -0
- package/dist/templates/plateMapAdapters.d.ts +3 -0
- package/dist/templates/plateMapBuilder.d.ts +2 -0
- package/dist/templates/presetControlSchemas.d.ts +534 -0
- package/dist/templates/presets.d.ts +12 -0
- package/dist/templates/protocolAdapters.d.ts +5 -0
- package/dist/templates/protocolNormalizers.d.ts +6 -0
- package/dist/templates/protocolStepsBuilder.d.ts +2 -0
- package/dist/templates/qpcrAdapters.d.ts +5 -0
- package/dist/templates/qpcrExpressionCollectionBuilder.d.ts +2 -0
- package/dist/templates/qpcrPlateBuilder.d.ts +2 -0
- package/dist/templates/reagentAdapters.d.ts +5 -0
- package/dist/templates/reagentListBuilder.d.ts +2 -0
- package/dist/templates/runNormalizers.d.ts +10 -0
- package/dist/templates/sampleNormalizers.d.ts +4 -0
- package/dist/templates/samplePrepAdapters.d.ts +4 -0
- package/dist/templates/samplePrepBuilder.d.ts +2 -0
- package/dist/templates/sampleSheetAdapters.d.ts +5 -0
- package/dist/templates/sampleSheetBuilder.d.ts +2 -0
- package/dist/templates/targetedMetabolomicsCollectionBuilder.d.ts +2 -0
- package/dist/templates/targetedMetabolomicsHelpers.d.ts +5 -0
- package/dist/templates/templateControlSchemas.d.ts +400 -0
- package/dist/templates/templateEnvelopes.d.ts +9 -0
- package/dist/templates/templatePackCollectionBuilder.d.ts +2 -0
- package/dist/templates/templatePresetCollectionBuilder.d.ts +18 -0
- package/dist/templates/templateValidators.d.ts +13 -0
- package/dist/templates/timeCourseAdapters.d.ts +5 -0
- package/dist/templates/timeCourseBuilder.d.ts +2 -0
- package/dist/templates/types.d.ts +16 -1
- package/dist/templates/wellPlateScreenCollectionBuilder.d.ts +2 -0
- package/dist/templates/westernBlotAssayCollectionBuilder.d.ts +2 -0
- package/dist/{templates-BSlxwV2c.js → templates-bUAWMn5L.js} +3610 -3154
- package/dist/templates-bUAWMn5L.js.map +1 -0
- package/dist/types/auth.d.ts +2 -0
- package/dist/types/components.d.ts +32 -3
- package/dist/types/form-builder.d.ts +2 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/instrument.d.ts +56 -0
- package/dist/types/platform.d.ts +3 -0
- package/dist/{useExperimentData-BbbdI5xT.js → useProtocolTemplates-QZtHFFH2.js} +534 -359
- package/dist/useProtocolTemplates-QZtHFFH2.js.map +1 -0
- package/dist/utils/rack.d.ts +47 -0
- package/package.json +1 -1
- package/src/__tests__/components/AppTopBar.test.ts +15 -0
- package/src/__tests__/components/BaseTabs.test.ts +15 -0
- package/src/__tests__/components/LcmsSequenceTable.test.ts +57 -0
- package/src/__tests__/components/ProgressBar.test.ts +18 -0
- package/src/__tests__/components/RackEditor.test.ts +125 -0
- package/src/__tests__/components/SampleSelector.test.ts +25 -0
- package/src/__tests__/components/SegmentedControl.test.ts +45 -0
- package/src/__tests__/components/SequenceProgressBar.test.ts +39 -0
- package/src/__tests__/components/SettingsModal.test.ts +83 -2
- package/src/__tests__/composables/useControlSchema.test.ts +4 -0
- package/src/__tests__/composables/useExperimentData.test.ts +23 -0
- package/src/__tests__/composables/useExperimentSamples.test.ts +91 -0
- package/src/__tests__/templates/templates.test.ts +86 -0
- package/src/__tests__/utils/instrument.test.ts +47 -0
- package/src/__tests__/utils/lcms.test.ts +73 -0
- package/src/__tests__/utils/permissions.test.ts +50 -0
- package/src/__tests__/utils/rack.test.ts +120 -0
- package/src/components/AppTopBar.vue +1 -0
- package/src/components/BaseTabs.vue +22 -1
- package/src/components/InstrumentAlertLog.vue +191 -0
- package/src/components/InstrumentStateBadge.vue +50 -0
- package/src/components/InstrumentStatusCard.vue +188 -0
- package/src/components/LcmsSequenceTable.vue +191 -0
- package/src/components/ProgressBar.vue +3 -0
- package/src/components/RackEditor.vue +73 -2
- package/src/components/SampleSelector.vue +28 -9
- package/src/components/SegmentedControl.story.vue +17 -0
- package/src/components/SegmentedControl.vue +14 -3
- package/src/components/SequenceProgressBar.vue +71 -0
- package/src/components/SettingsModal.vue +42 -2
- package/src/components/WellPlate.vue +142 -21
- package/src/components/index.ts +5 -0
- package/src/components/internal/WellEditPopupInternal.vue +1 -0
- package/src/composables/controlComponentBindings.ts +80 -0
- package/src/composables/controlSchemaAdapters.ts +196 -0
- package/src/composables/controlSchemaFormFields.ts +61 -0
- package/src/composables/controlSchemaLayout.ts +59 -0
- package/src/composables/controlSchemaNormalize.ts +101 -0
- package/src/composables/controlSchemaUtils.ts +36 -0
- package/src/composables/controlWorkspaceOptions.ts +21 -0
- package/src/composables/experimentDesignData.ts +182 -0
- package/src/composables/index.ts +14 -0
- package/src/composables/useAuth.ts +4 -0
- package/src/composables/useAutoGroup.ts +5 -1
- package/src/composables/useControlSchema.ts +62 -618
- package/src/composables/useControlWorkspace.ts +207 -0
- package/src/composables/useExperimentData.ts +57 -16
- package/src/composables/useExperimentSamples.ts +142 -0
- package/src/index.ts +27 -0
- package/src/instrument.ts +90 -0
- package/src/lcms.ts +108 -0
- package/src/permissions.ts +143 -0
- package/src/stores/auth.ts +31 -3
- package/src/styles/components/instrument-monitor.css +478 -0
- package/src/styles/components/lcms-sequence-table.css +189 -0
- package/src/styles/components/sequence-progress-bar.css +63 -0
- package/src/styles/components/tabs.css +9 -0
- package/src/styles/components/well-edit-popup.css +7 -1
- package/src/styles/components/well-plate.css +5 -0
- package/src/styles/index.css +3 -0
- package/src/templates/adapters.ts +89 -930
- package/src/templates/assayLookups.ts +33 -0
- package/src/templates/assayMatrixAdapters.ts +78 -0
- package/src/templates/assayMatrixBuilder.ts +59 -0
- package/src/templates/assayNormalizers.ts +34 -0
- package/src/templates/builderDefaults.ts +11 -0
- package/src/templates/builderIdUtils.ts +20 -0
- package/src/templates/builderPresetControls.ts +165 -0
- package/src/templates/builderReadUtils.ts +57 -0
- package/src/templates/builders.ts +122 -2149
- package/src/templates/calibrationCurveAdapters.ts +59 -0
- package/src/templates/calibrationCurveBuilder.ts +99 -0
- package/src/templates/calibrationNormalizers.ts +60 -0
- package/src/templates/componentBindingCatalog.ts +90 -0
- package/src/templates/componentBindingHelpers.ts +93 -0
- package/src/templates/componentBindings.ts +12 -461
- package/src/templates/componentDoseResponseProps.ts +42 -0
- package/src/templates/componentGenericProps.ts +77 -0
- package/src/templates/componentPlateHelpers.ts +29 -0
- package/src/templates/componentPlateMapProps.ts +32 -0
- package/src/templates/componentPropsFactory.ts +21 -0
- package/src/templates/componentQpcrPlateProps.ts +28 -0
- package/src/templates/componentTargetResolvers.ts +69 -0
- package/src/templates/componentTemplateProps.ts +78 -0
- package/src/templates/controlSchemaClone.ts +32 -0
- package/src/templates/controlSchemaConstants.ts +11 -0
- package/src/templates/controlSchemaMerge.ts +40 -0
- package/src/templates/controlSchemaTargets.ts +87 -0
- package/src/templates/controlSchemaTypes.ts +20 -0
- package/src/templates/controlSchemas.ts +22 -636
- package/src/templates/defaultBioTemplateBuilder.ts +124 -0
- package/src/templates/doseResponseAdapters.ts +45 -0
- package/src/templates/doseResponseBuilder.ts +44 -0
- package/src/templates/elisaAssayCollectionBuilder.ts +62 -0
- package/src/templates/flowCytometryAssayCollectionBuilder.ts +41 -0
- package/src/templates/flowCytometryPanelBuilder.ts +53 -0
- package/src/templates/flowNormalizers.ts +58 -0
- package/src/templates/flowPanelAdapters.ts +58 -0
- package/src/templates/index.ts +2 -0
- package/src/templates/instrumentRunAdapterHelpers.ts +94 -0
- package/src/templates/instrumentRunAdapters.ts +163 -0
- package/src/templates/instrumentRunBuilder.ts +97 -0
- package/src/templates/lcmsBatchCollectionBuilder.ts +38 -0
- package/src/templates/plateGeometry.ts +62 -0
- package/src/templates/plateMapAdapters.ts +36 -0
- package/src/templates/plateMapBuilder.ts +43 -0
- package/src/templates/presetControlSchemas.ts +258 -0
- package/src/templates/presets.ts +23 -0
- package/src/templates/protocolAdapters.ts +69 -0
- package/src/templates/protocolNormalizers.ts +37 -0
- package/src/templates/protocolStepsBuilder.ts +36 -0
- package/src/templates/qpcrAdapters.ts +104 -0
- package/src/templates/qpcrExpressionCollectionBuilder.ts +33 -0
- package/src/templates/qpcrPlateBuilder.ts +96 -0
- package/src/templates/reagentAdapters.ts +77 -0
- package/src/templates/reagentListBuilder.ts +30 -0
- package/src/templates/runNormalizers.ts +63 -0
- package/src/templates/sampleNormalizers.ts +58 -0
- package/src/templates/samplePrepAdapters.ts +63 -0
- package/src/templates/samplePrepBuilder.ts +51 -0
- package/src/templates/sampleSheetAdapters.ts +75 -0
- package/src/templates/sampleSheetBuilder.ts +23 -0
- package/src/templates/targetedMetabolomicsCollectionBuilder.ts +79 -0
- package/src/templates/targetedMetabolomicsHelpers.ts +102 -0
- package/src/templates/templateControlSchemas.ts +320 -0
- package/src/templates/templateEnvelopes.ts +137 -0
- package/src/templates/templatePackCollectionBuilder.ts +23 -0
- package/src/templates/templatePresetCollectionBuilder.ts +139 -0
- package/src/templates/templateValidators.ts +414 -0
- package/src/templates/timeCourseAdapters.ts +73 -0
- package/src/templates/timeCourseBuilder.ts +64 -0
- package/src/templates/types.ts +17 -0
- package/src/templates/wellPlateScreenCollectionBuilder.ts +36 -0
- package/src/templates/westernBlotAssayCollectionBuilder.ts +68 -0
- package/src/types/auth.ts +3 -0
- package/src/types/components.ts +45 -3
- package/src/types/form-builder.ts +2 -1
- package/src/types/index.ts +35 -0
- package/src/types/instrument.ts +61 -0
- package/src/types/platform.ts +4 -0
- package/src/utils/rack.ts +209 -0
- package/dist/auth-CBG3bWEc.js.map +0 -1
- package/dist/components-5KSfsVqf.js.map +0 -1
- package/dist/composables-D4Myb30a.js.map +0 -1
- package/dist/templates-BSlxwV2c.js.map +0 -1
- package/dist/useExperimentData-BbbdI5xT.js.map +0 -1
|
@@ -4,535 +4,39 @@ import {
|
|
|
4
4
|
controlsToSidebarPanels,
|
|
5
5
|
getControlDefaults,
|
|
6
6
|
useControlSchema,
|
|
7
|
-
type ControlDefinition,
|
|
8
7
|
type ControlSchemaOptions,
|
|
9
8
|
type UseControlSchemaReturn,
|
|
10
9
|
} from '../composables/useControlSchema'
|
|
11
10
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
cloneControlSchema,
|
|
12
|
+
cloneSchemaMap,
|
|
13
|
+
} from './controlSchemaClone'
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
} from './
|
|
15
|
+
mergeTemplateControlSchemas,
|
|
16
|
+
} from './controlSchemaMerge'
|
|
17
17
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
describeControlTarget,
|
|
19
|
+
resolveControlSchemaTarget,
|
|
20
|
+
} from './controlSchemaTargets'
|
|
20
21
|
import {
|
|
21
|
-
|
|
22
|
-
} from './
|
|
22
|
+
presetControlSchemas,
|
|
23
|
+
} from './presetControlSchemas'
|
|
24
|
+
import {
|
|
25
|
+
templateControlSchemas,
|
|
26
|
+
} from './templateControlSchemas'
|
|
23
27
|
import type {
|
|
24
|
-
BioTemplateEnvelope,
|
|
25
|
-
TemplateCollectionEnvelope,
|
|
26
28
|
TemplateId,
|
|
27
|
-
TemplatePackId,
|
|
28
29
|
TemplatePresetId,
|
|
29
30
|
} from './types'
|
|
31
|
+
import type {
|
|
32
|
+
BioTemplateControlSchema,
|
|
33
|
+
BioTemplateControlTarget,
|
|
34
|
+
} from './controlSchemaTypes'
|
|
30
35
|
|
|
31
|
-
export type
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| TemplatePresetId
|
|
36
|
-
| string
|
|
37
|
-
| BioTemplateEnvelope<unknown>
|
|
38
|
-
| TemplateCollectionEnvelope
|
|
39
|
-
|
|
40
|
-
const ICONS = {
|
|
41
|
-
plate: ['M4 4h16v16H4z', 'M8 4v16', 'M12 4v16', 'M16 4v16', 'M4 8h16', 'M4 12h16', 'M4 16h16'],
|
|
42
|
-
samples: ['M16 21v-2a4 4 0 0 0-8 0v2', 'M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8'],
|
|
43
|
-
dose: ['M10 2v8L4 20h16l-6-10V2', 'M8 2h8', 'M7 14h10'],
|
|
44
|
-
table: ['M3 5h18', 'M3 12h18', 'M3 19h18', 'M8 5v14', 'M16 5v14'],
|
|
45
|
-
run: ['M4 17l6-6 4 4 6-8', 'M4 21h16'],
|
|
46
|
-
settings: ['M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8', 'M4 12h2', 'M18 12h2', 'M12 4v2', 'M12 18v2'],
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const PLATE_FORMAT_OPTIONS = [6, 12, 24, 48, 96, 384] as const
|
|
50
|
-
const CONCENTRATION_UNITS = ['nM', 'uM', 'mM', 'ug/mL', 'mg/mL'] as const
|
|
51
|
-
|
|
52
|
-
const templateControlSchemas = {
|
|
53
|
-
'plate-map': {
|
|
54
|
-
plateName: {
|
|
55
|
-
label: 'Plate name',
|
|
56
|
-
default: 'Plate 1',
|
|
57
|
-
section: 'layout',
|
|
58
|
-
sectionLabel: 'Layout',
|
|
59
|
-
sectionSubtitle: 'Plate geometry',
|
|
60
|
-
view: 'design',
|
|
61
|
-
sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },
|
|
62
|
-
},
|
|
63
|
-
plateFormat: {
|
|
64
|
-
label: 'Format',
|
|
65
|
-
default: 96,
|
|
66
|
-
options: PLATE_FORMAT_OPTIONS,
|
|
67
|
-
section: 'layout',
|
|
68
|
-
view: 'design',
|
|
69
|
-
},
|
|
70
|
-
sampleNames: {
|
|
71
|
-
type: 'tags',
|
|
72
|
-
label: 'Samples',
|
|
73
|
-
default: ['Control', 'Treatment'],
|
|
74
|
-
section: 'samples',
|
|
75
|
-
sectionLabel: 'Samples',
|
|
76
|
-
sectionSubtitle: 'Groups and legend',
|
|
77
|
-
view: 'design',
|
|
78
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
'sample-sheet': {
|
|
82
|
-
sampleCount: {
|
|
83
|
-
type: 'number',
|
|
84
|
-
label: 'Sample count',
|
|
85
|
-
default: 2,
|
|
86
|
-
min: 1,
|
|
87
|
-
max: 10000,
|
|
88
|
-
section: 'samples',
|
|
89
|
-
sectionLabel: 'Samples',
|
|
90
|
-
sectionSubtitle: 'Metadata table',
|
|
91
|
-
view: 'design',
|
|
92
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
93
|
-
},
|
|
94
|
-
includeGroups: {
|
|
95
|
-
label: 'Include groups',
|
|
96
|
-
default: true,
|
|
97
|
-
section: 'samples',
|
|
98
|
-
view: 'design',
|
|
99
|
-
},
|
|
100
|
-
includeBatch: {
|
|
101
|
-
label: 'Include batch',
|
|
102
|
-
default: false,
|
|
103
|
-
section: 'columns',
|
|
104
|
-
sectionLabel: 'Columns',
|
|
105
|
-
view: 'design',
|
|
106
|
-
sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
'sample-prep': {
|
|
110
|
-
prepType: {
|
|
111
|
-
label: 'Prep type',
|
|
112
|
-
default: 'extraction',
|
|
113
|
-
options: ['extraction', 'dilution', 'normalization', 'transfer', 'quench', 'custom'],
|
|
114
|
-
section: 'protocol',
|
|
115
|
-
sectionLabel: 'Protocol',
|
|
116
|
-
sectionSubtitle: 'Prep workflow',
|
|
117
|
-
view: 'design',
|
|
118
|
-
sidebar: { icon: ICONS.run, iconColor: '#f97316', iconBg: '#ffedd5' },
|
|
119
|
-
},
|
|
120
|
-
volumeUnit: {
|
|
121
|
-
label: 'Volume unit',
|
|
122
|
-
default: 'uL',
|
|
123
|
-
options: ['uL', 'mL'],
|
|
124
|
-
section: 'protocol',
|
|
125
|
-
view: 'design',
|
|
126
|
-
},
|
|
127
|
-
outputVolume: {
|
|
128
|
-
type: 'number',
|
|
129
|
-
label: 'Output volume',
|
|
130
|
-
default: 50,
|
|
131
|
-
min: 0,
|
|
132
|
-
section: 'protocol',
|
|
133
|
-
view: 'design',
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
'dose-response': {
|
|
137
|
-
unit: {
|
|
138
|
-
label: 'Dose unit',
|
|
139
|
-
default: 'uM',
|
|
140
|
-
options: CONCENTRATION_UNITS,
|
|
141
|
-
section: 'dose',
|
|
142
|
-
sectionLabel: 'Dose Design',
|
|
143
|
-
sectionSubtitle: 'Concentration series',
|
|
144
|
-
view: 'design',
|
|
145
|
-
sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },
|
|
146
|
-
},
|
|
147
|
-
replicates: {
|
|
148
|
-
type: 'number',
|
|
149
|
-
label: 'Replicates',
|
|
150
|
-
default: 3,
|
|
151
|
-
min: 1,
|
|
152
|
-
max: 24,
|
|
153
|
-
section: 'dose',
|
|
154
|
-
view: 'design',
|
|
155
|
-
},
|
|
156
|
-
includePlateLayout: {
|
|
157
|
-
label: 'Create plate layout',
|
|
158
|
-
default: true,
|
|
159
|
-
section: 'layout',
|
|
160
|
-
sectionLabel: 'Layout',
|
|
161
|
-
sectionSubtitle: 'Well assignment',
|
|
162
|
-
view: 'design',
|
|
163
|
-
sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff', defaultOpen: false },
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
'calibration-curve': {
|
|
167
|
-
analyte: {
|
|
168
|
-
label: 'Analyte',
|
|
169
|
-
default: 'Analyte',
|
|
170
|
-
section: 'standards',
|
|
171
|
-
sectionLabel: 'Standards',
|
|
172
|
-
sectionSubtitle: 'Curve setup',
|
|
173
|
-
view: 'analysis',
|
|
174
|
-
sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },
|
|
175
|
-
},
|
|
176
|
-
model: {
|
|
177
|
-
label: 'Model',
|
|
178
|
-
default: 'linear',
|
|
179
|
-
options: ['linear', 'linear-weighted-1-x', 'linear-weighted-1-x2', 'quadratic', 'four-parameter-logistic'],
|
|
180
|
-
section: 'fit',
|
|
181
|
-
sectionLabel: 'Fit',
|
|
182
|
-
view: 'analysis',
|
|
183
|
-
sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff' },
|
|
184
|
-
},
|
|
185
|
-
minRSquared: {
|
|
186
|
-
type: 'number',
|
|
187
|
-
label: 'Minimum R squared',
|
|
188
|
-
default: 0.99,
|
|
189
|
-
min: 0,
|
|
190
|
-
max: 1,
|
|
191
|
-
props: { step: 0.001 },
|
|
192
|
-
section: 'fit',
|
|
193
|
-
view: 'analysis',
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
'time-course': {
|
|
197
|
-
timeUnit: {
|
|
198
|
-
label: 'Time unit',
|
|
199
|
-
default: 'hour',
|
|
200
|
-
options: ['second', 'minute', 'hour', 'day', 'week'],
|
|
201
|
-
section: 'schedule',
|
|
202
|
-
sectionLabel: 'Schedule',
|
|
203
|
-
sectionSubtitle: 'Sampling timeline',
|
|
204
|
-
view: 'design',
|
|
205
|
-
sidebar: { icon: ICONS.run, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
206
|
-
},
|
|
207
|
-
replicates: {
|
|
208
|
-
type: 'number',
|
|
209
|
-
label: 'Replicates',
|
|
210
|
-
default: 3,
|
|
211
|
-
min: 1,
|
|
212
|
-
max: 24,
|
|
213
|
-
section: 'samples',
|
|
214
|
-
sectionLabel: 'Samples',
|
|
215
|
-
view: 'design',
|
|
216
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
'protocol-steps': {
|
|
220
|
-
defaultDuration: {
|
|
221
|
-
type: 'number',
|
|
222
|
-
label: 'Default duration',
|
|
223
|
-
default: 30,
|
|
224
|
-
min: 0,
|
|
225
|
-
section: 'protocol',
|
|
226
|
-
sectionLabel: 'Protocol',
|
|
227
|
-
sectionSubtitle: 'Step defaults',
|
|
228
|
-
view: 'design',
|
|
229
|
-
sidebar: { icon: ICONS.run, iconColor: '#f97316', iconBg: '#ffedd5' },
|
|
230
|
-
props: { suffix: 'min' },
|
|
231
|
-
},
|
|
232
|
-
editable: {
|
|
233
|
-
label: 'Editable timeline',
|
|
234
|
-
default: true,
|
|
235
|
-
section: 'protocol',
|
|
236
|
-
view: 'design',
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
'assay-matrix': {
|
|
240
|
-
featureType: {
|
|
241
|
-
label: 'Feature type',
|
|
242
|
-
default: 'metabolite',
|
|
243
|
-
options: ['metabolite', 'protein', 'gene', 'cell', 'compound', 'readout', 'other'],
|
|
244
|
-
section: 'features',
|
|
245
|
-
sectionLabel: 'Features',
|
|
246
|
-
sectionSubtitle: 'Measurement matrix',
|
|
247
|
-
view: 'analysis',
|
|
248
|
-
sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
249
|
-
},
|
|
250
|
-
normalizeValues: {
|
|
251
|
-
label: 'Normalize values',
|
|
252
|
-
default: false,
|
|
253
|
-
section: 'analysis',
|
|
254
|
-
sectionLabel: 'Analysis',
|
|
255
|
-
view: 'analysis',
|
|
256
|
-
sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff', defaultOpen: false },
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
'reagent-list': {
|
|
260
|
-
reagentKind: {
|
|
261
|
-
label: 'Reagent kind',
|
|
262
|
-
default: 'reagent',
|
|
263
|
-
options: ['compound', 'antibody', 'primer', 'enzyme', 'buffer', 'media', 'kit', 'reagent', 'other'],
|
|
264
|
-
section: 'inventory',
|
|
265
|
-
sectionLabel: 'Inventory',
|
|
266
|
-
sectionSubtitle: 'Reagent metadata',
|
|
267
|
-
view: 'design',
|
|
268
|
-
sidebar: { icon: ICONS.table, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
269
|
-
},
|
|
270
|
-
trackStock: {
|
|
271
|
-
label: 'Track stock level',
|
|
272
|
-
default: true,
|
|
273
|
-
section: 'inventory',
|
|
274
|
-
view: 'design',
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
'flow-cytometry-panel': {
|
|
278
|
-
markers: {
|
|
279
|
-
type: 'tags',
|
|
280
|
-
label: 'Markers',
|
|
281
|
-
default: ['CD3', 'CD4', 'CD8'],
|
|
282
|
-
section: 'panel',
|
|
283
|
-
sectionLabel: 'Panel',
|
|
284
|
-
sectionSubtitle: 'Markers and controls',
|
|
285
|
-
view: 'design',
|
|
286
|
-
sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
287
|
-
},
|
|
288
|
-
instrument: {
|
|
289
|
-
label: 'Instrument',
|
|
290
|
-
default: 'Flow cytometer',
|
|
291
|
-
section: 'panel',
|
|
292
|
-
sectionLabel: 'Panel',
|
|
293
|
-
sectionSubtitle: 'Markers and controls',
|
|
294
|
-
view: 'design',
|
|
295
|
-
sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff' },
|
|
296
|
-
},
|
|
297
|
-
includeDefaultControls: {
|
|
298
|
-
label: 'Default controls',
|
|
299
|
-
default: true,
|
|
300
|
-
section: 'panel',
|
|
301
|
-
view: 'design',
|
|
302
|
-
},
|
|
303
|
-
},
|
|
304
|
-
'instrument-run': {
|
|
305
|
-
instrument: {
|
|
306
|
-
label: 'Instrument',
|
|
307
|
-
default: 'LC-MS',
|
|
308
|
-
options: ['LC-MS', 'GC-MS', 'Orbitrap', 'Triple quadrupole', 'Plate reader', 'Other'],
|
|
309
|
-
section: 'acquisition',
|
|
310
|
-
sectionLabel: 'Acquisition',
|
|
311
|
-
sectionSubtitle: 'Run queue',
|
|
312
|
-
view: 'run',
|
|
313
|
-
sidebar: { icon: ICONS.run, iconColor: '#ef4444', iconBg: '#fee2e2' },
|
|
314
|
-
},
|
|
315
|
-
method: {
|
|
316
|
-
label: 'Method',
|
|
317
|
-
default: 'Default method',
|
|
318
|
-
section: 'acquisition',
|
|
319
|
-
view: 'run',
|
|
320
|
-
},
|
|
321
|
-
includeQc: {
|
|
322
|
-
label: 'Include QC',
|
|
323
|
-
default: true,
|
|
324
|
-
section: 'quality',
|
|
325
|
-
sectionLabel: 'Quality Control',
|
|
326
|
-
view: 'run',
|
|
327
|
-
sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff', defaultOpen: false },
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
|
-
'qpcr-plate': {
|
|
331
|
-
chemistry: {
|
|
332
|
-
label: 'Chemistry',
|
|
333
|
-
default: 'sybr',
|
|
334
|
-
options: ['sybr', 'taqman', 'probe', 'evagreen', 'other'],
|
|
335
|
-
section: 'assay',
|
|
336
|
-
sectionLabel: 'Assay',
|
|
337
|
-
sectionSubtitle: 'qPCR setup',
|
|
338
|
-
view: 'design',
|
|
339
|
-
sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },
|
|
340
|
-
},
|
|
341
|
-
replicates: {
|
|
342
|
-
type: 'number',
|
|
343
|
-
label: 'Replicates',
|
|
344
|
-
default: 3,
|
|
345
|
-
min: 1,
|
|
346
|
-
max: 12,
|
|
347
|
-
section: 'assay',
|
|
348
|
-
view: 'design',
|
|
349
|
-
},
|
|
350
|
-
includeNoTemplateControls: {
|
|
351
|
-
label: 'No-template controls',
|
|
352
|
-
default: true,
|
|
353
|
-
section: 'controls',
|
|
354
|
-
sectionLabel: 'Controls',
|
|
355
|
-
view: 'design',
|
|
356
|
-
sidebar: { icon: ICONS.settings, iconColor: '#8b5cf6', iconBg: '#ede9fe', defaultOpen: false },
|
|
357
|
-
},
|
|
358
|
-
},
|
|
359
|
-
} satisfies Record<TemplateId, BioTemplateControlSchema>
|
|
360
|
-
|
|
361
|
-
const presetControlSchemas = {
|
|
362
|
-
'wellplate-screen': {
|
|
363
|
-
...templateControlSchemas['plate-map'],
|
|
364
|
-
...templateControlSchemas['dose-response'],
|
|
365
|
-
sampleNames: {
|
|
366
|
-
...templateControlSchemas['plate-map'].sampleNames,
|
|
367
|
-
default: ['Control', 'Treatment'],
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
'qpcr-expression': {
|
|
371
|
-
sampleNames: {
|
|
372
|
-
type: 'tags',
|
|
373
|
-
label: 'Samples',
|
|
374
|
-
default: ['Control', 'Treatment'],
|
|
375
|
-
section: 'samples',
|
|
376
|
-
sectionLabel: 'Samples',
|
|
377
|
-
sectionSubtitle: 'Expression groups',
|
|
378
|
-
view: 'design',
|
|
379
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
380
|
-
},
|
|
381
|
-
targets: {
|
|
382
|
-
type: 'tags',
|
|
383
|
-
label: 'Targets',
|
|
384
|
-
default: ['ACTB', 'GAPDH'],
|
|
385
|
-
section: 'assay',
|
|
386
|
-
sectionLabel: 'Assay',
|
|
387
|
-
view: 'design',
|
|
388
|
-
sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },
|
|
389
|
-
},
|
|
390
|
-
...templateControlSchemas['qpcr-plate'],
|
|
391
|
-
},
|
|
392
|
-
'lcms-batch': {
|
|
393
|
-
sampleNames: {
|
|
394
|
-
type: 'tags',
|
|
395
|
-
label: 'Samples',
|
|
396
|
-
default: ['S001', 'S002'],
|
|
397
|
-
section: 'samples',
|
|
398
|
-
sectionLabel: 'Samples',
|
|
399
|
-
sectionSubtitle: 'Batch samples',
|
|
400
|
-
view: 'run',
|
|
401
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
402
|
-
},
|
|
403
|
-
featureNames: {
|
|
404
|
-
type: 'tags',
|
|
405
|
-
label: 'Features',
|
|
406
|
-
default: ['Glucose', 'Lactate'],
|
|
407
|
-
section: 'features',
|
|
408
|
-
sectionLabel: 'Features',
|
|
409
|
-
view: 'analysis',
|
|
410
|
-
sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
411
|
-
},
|
|
412
|
-
...templateControlSchemas['instrument-run'],
|
|
413
|
-
...templateControlSchemas['assay-matrix'],
|
|
414
|
-
},
|
|
415
|
-
'elisa-assay': {
|
|
416
|
-
sampleNames: {
|
|
417
|
-
type: 'tags',
|
|
418
|
-
label: 'Samples',
|
|
419
|
-
default: ['Control', 'Treatment'],
|
|
420
|
-
section: 'samples',
|
|
421
|
-
sectionLabel: 'Samples',
|
|
422
|
-
sectionSubtitle: 'Unknowns and controls',
|
|
423
|
-
view: 'design',
|
|
424
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
425
|
-
},
|
|
426
|
-
analyte: {
|
|
427
|
-
label: 'Analyte',
|
|
428
|
-
default: 'Analyte',
|
|
429
|
-
section: 'standards',
|
|
430
|
-
sectionLabel: 'Standards',
|
|
431
|
-
sectionSubtitle: 'Calibration setup',
|
|
432
|
-
view: 'analysis',
|
|
433
|
-
sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },
|
|
434
|
-
},
|
|
435
|
-
standardConcentrations: {
|
|
436
|
-
type: 'tags',
|
|
437
|
-
label: 'Standards',
|
|
438
|
-
default: ['1000', '100', '10', '1'],
|
|
439
|
-
section: 'standards',
|
|
440
|
-
view: 'analysis',
|
|
441
|
-
},
|
|
442
|
-
unit: {
|
|
443
|
-
label: 'Concentration unit',
|
|
444
|
-
default: 'pg/mL',
|
|
445
|
-
options: ['pg/mL', 'ng/mL', 'ug/mL', 'nM', 'uM'],
|
|
446
|
-
section: 'standards',
|
|
447
|
-
view: 'analysis',
|
|
448
|
-
},
|
|
449
|
-
responseUnit: {
|
|
450
|
-
label: 'Response unit',
|
|
451
|
-
default: 'OD450',
|
|
452
|
-
section: 'readout',
|
|
453
|
-
sectionLabel: 'Readout',
|
|
454
|
-
view: 'analysis',
|
|
455
|
-
sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
456
|
-
},
|
|
457
|
-
plateName: {
|
|
458
|
-
label: 'Plate name',
|
|
459
|
-
default: 'ELISA plate',
|
|
460
|
-
section: 'layout',
|
|
461
|
-
sectionLabel: 'Layout',
|
|
462
|
-
sectionSubtitle: 'Plate geometry',
|
|
463
|
-
view: 'design',
|
|
464
|
-
sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },
|
|
465
|
-
},
|
|
466
|
-
plateFormat: {
|
|
467
|
-
label: 'Format',
|
|
468
|
-
default: 96,
|
|
469
|
-
options: PLATE_FORMAT_OPTIONS,
|
|
470
|
-
section: 'layout',
|
|
471
|
-
view: 'design',
|
|
472
|
-
},
|
|
473
|
-
},
|
|
474
|
-
'flow-cytometry-assay': {
|
|
475
|
-
sampleNames: {
|
|
476
|
-
type: 'tags',
|
|
477
|
-
label: 'Samples',
|
|
478
|
-
default: ['Control', 'Treatment'],
|
|
479
|
-
section: 'samples',
|
|
480
|
-
sectionLabel: 'Samples',
|
|
481
|
-
sectionSubtitle: 'Assay groups',
|
|
482
|
-
view: 'design',
|
|
483
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
484
|
-
},
|
|
485
|
-
markers: {
|
|
486
|
-
...templateControlSchemas['flow-cytometry-panel'].markers,
|
|
487
|
-
default: ['CD3', 'CD4', 'CD8'],
|
|
488
|
-
},
|
|
489
|
-
featureNames: {
|
|
490
|
-
type: 'tags',
|
|
491
|
-
label: 'Readouts',
|
|
492
|
-
default: ['CD3+ cells', 'CD4+ cells', 'CD8+ cells'],
|
|
493
|
-
section: 'features',
|
|
494
|
-
sectionLabel: 'Readouts',
|
|
495
|
-
sectionSubtitle: 'Assay matrix columns',
|
|
496
|
-
view: 'analysis',
|
|
497
|
-
sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
498
|
-
},
|
|
499
|
-
instrument: {
|
|
500
|
-
...templateControlSchemas['flow-cytometry-panel'].instrument,
|
|
501
|
-
default: 'Flow cytometer',
|
|
502
|
-
},
|
|
503
|
-
includeDefaultControls: templateControlSchemas['flow-cytometry-panel'].includeDefaultControls,
|
|
504
|
-
},
|
|
505
|
-
'western-blot-assay': {
|
|
506
|
-
sampleNames: {
|
|
507
|
-
type: 'tags',
|
|
508
|
-
label: 'Samples',
|
|
509
|
-
default: ['Control', 'Treatment'],
|
|
510
|
-
section: 'samples',
|
|
511
|
-
sectionLabel: 'Samples',
|
|
512
|
-
sectionSubtitle: 'Blot lanes and groups',
|
|
513
|
-
view: 'design',
|
|
514
|
-
sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },
|
|
515
|
-
},
|
|
516
|
-
targets: {
|
|
517
|
-
type: 'tags',
|
|
518
|
-
label: 'Targets',
|
|
519
|
-
default: ['Target protein'],
|
|
520
|
-
section: 'assay',
|
|
521
|
-
sectionLabel: 'Assay',
|
|
522
|
-
sectionSubtitle: 'Protein targets',
|
|
523
|
-
view: 'design',
|
|
524
|
-
sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },
|
|
525
|
-
},
|
|
526
|
-
loadingControl: {
|
|
527
|
-
label: 'Loading control',
|
|
528
|
-
default: 'ACTB',
|
|
529
|
-
section: 'normalization',
|
|
530
|
-
sectionLabel: 'Normalization',
|
|
531
|
-
view: 'analysis',
|
|
532
|
-
sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff' },
|
|
533
|
-
},
|
|
534
|
-
},
|
|
535
|
-
} satisfies Record<TemplatePresetId, BioTemplateControlSchema>
|
|
36
|
+
export type {
|
|
37
|
+
BioTemplateControlSchema,
|
|
38
|
+
BioTemplateControlTarget,
|
|
39
|
+
} from './controlSchemaTypes'
|
|
536
40
|
|
|
537
41
|
export function listBioTemplateControlSchemas(): Record<TemplateId, BioTemplateControlSchema> {
|
|
538
42
|
return cloneSchemaMap(templateControlSchemas)
|
|
@@ -554,7 +58,7 @@ export function getBioTemplateControlSchema(
|
|
|
554
58
|
if (resolved.kind === 'preset') {
|
|
555
59
|
return cloneControlSchema(presetControlSchemas[resolved.name])
|
|
556
60
|
}
|
|
557
|
-
return mergeTemplateControlSchemas(resolved.templates)
|
|
61
|
+
return mergeTemplateControlSchemas(resolved.templates, templateControlSchemas)
|
|
558
62
|
}
|
|
559
63
|
|
|
560
64
|
export function requireBioTemplateControlSchema(
|
|
@@ -598,121 +102,3 @@ export function bioTemplateControlsToSectionFormSchemas(
|
|
|
598
102
|
export function getBioTemplateControlDefaults(target: BioTemplateControlTarget) {
|
|
599
103
|
return getControlDefaults(requireBioTemplateControlSchema(target))
|
|
600
104
|
}
|
|
601
|
-
|
|
602
|
-
function resolveControlSchemaTarget(
|
|
603
|
-
target: BioTemplateControlTarget
|
|
604
|
-
):
|
|
605
|
-
| { kind: 'template'; name: TemplateId }
|
|
606
|
-
| { kind: 'pack'; templates: TemplateId[] }
|
|
607
|
-
| { kind: 'preset'; name: TemplatePresetId }
|
|
608
|
-
| { kind: 'collection'; templates: TemplateId[] }
|
|
609
|
-
| undefined {
|
|
610
|
-
if (typeof target === 'string') {
|
|
611
|
-
const preset = getBioTemplatePresetInfo(target)
|
|
612
|
-
if (preset) return { kind: 'preset', name: preset.name }
|
|
613
|
-
const pack = getBioTemplatePackInfo(target)
|
|
614
|
-
if (pack) return { kind: 'pack', templates: [...pack.templates] }
|
|
615
|
-
const template = getBioTemplateInfo(target)
|
|
616
|
-
if (template) return { kind: 'template', name: template.template_id }
|
|
617
|
-
return undefined
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
if (isTemplateEnvelope(target)) {
|
|
621
|
-
const template = getBioTemplateInfo(target.template_id)
|
|
622
|
-
return template ? { kind: 'template', name: template.template_id } : undefined
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
const presetName = collectionPresetName(target)
|
|
626
|
-
if (presetName) {
|
|
627
|
-
const preset = getBioTemplatePresetInfo(presetName)
|
|
628
|
-
if (preset) return { kind: 'preset', name: preset.name }
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
const packName = collectionPackName(target)
|
|
632
|
-
if (packName) {
|
|
633
|
-
const pack = getBioTemplatePackInfo(packName)
|
|
634
|
-
if (pack) return { kind: 'pack', templates: [...pack.templates] }
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
const collection = extractTemplateCollection(target)
|
|
638
|
-
const templateIds = Object.keys(collection)
|
|
639
|
-
.map(id => getBioTemplateInfo(id)?.template_id)
|
|
640
|
-
.filter((id): id is TemplateId => id !== undefined)
|
|
641
|
-
return templateIds.length > 0 ? { kind: 'collection', templates: templateIds } : undefined
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
function mergeTemplateControlSchemas(templateIds: TemplateId[]): BioTemplateControlSchema {
|
|
645
|
-
const merged: BioTemplateControlSchema = {}
|
|
646
|
-
for (const templateId of templateIds) {
|
|
647
|
-
const schema = templateControlSchemas[templateId]
|
|
648
|
-
const template = getBioTemplateInfo(templateId)
|
|
649
|
-
for (const [name, definition] of Object.entries(schema)) {
|
|
650
|
-
const key = `${camelize(templateId)}${capitalize(name)}`
|
|
651
|
-
merged[key] = {
|
|
652
|
-
...cloneControlDefinition(definition),
|
|
653
|
-
section: definition.section ?? templateId,
|
|
654
|
-
sectionLabel: definition.sectionLabel ?? template?.label ?? templateId,
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
return merged
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
function cloneSchemaMap<TName extends string>(
|
|
662
|
-
schemas: Record<TName, BioTemplateControlSchema>
|
|
663
|
-
): Record<TName, BioTemplateControlSchema> {
|
|
664
|
-
const result = {} as Record<TName, BioTemplateControlSchema>
|
|
665
|
-
for (const name of Object.keys(schemas) as TName[]) {
|
|
666
|
-
result[name] = cloneControlSchema(schemas[name])
|
|
667
|
-
}
|
|
668
|
-
return result
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
function cloneControlSchema(schema: BioTemplateControlSchema): BioTemplateControlSchema {
|
|
672
|
-
return Object.fromEntries(
|
|
673
|
-
Object.entries(schema).map(([name, definition]) => [name, cloneControlDefinition(definition)])
|
|
674
|
-
)
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
function cloneControlDefinition(definition: BioTemplateControlSchema[string]): BioTemplateControlSchema[string] {
|
|
678
|
-
return {
|
|
679
|
-
...definition,
|
|
680
|
-
options: definition.options ? [...definition.options] : undefined,
|
|
681
|
-
props: definition.props ? { ...definition.props } : undefined,
|
|
682
|
-
sidebar: typeof definition.sidebar === 'object' && definition.sidebar !== null
|
|
683
|
-
? { ...definition.sidebar }
|
|
684
|
-
: definition.sidebar,
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
function isTemplateEnvelope(value: unknown): value is BioTemplateEnvelope<unknown> {
|
|
689
|
-
return isRecord(value) && typeof value.template_id === 'string' && 'data' in value
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
function collectionPresetName(value: unknown): string | undefined {
|
|
693
|
-
if (!isRecord(value) || !isRecord(value.metadata)) return undefined
|
|
694
|
-
return typeof value.metadata.preset === 'string' ? value.metadata.preset : undefined
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
function collectionPackName(value: unknown): string | undefined {
|
|
698
|
-
if (!isRecord(value) || !isRecord(value.metadata)) return undefined
|
|
699
|
-
return typeof value.metadata.pack === 'string' ? value.metadata.pack : undefined
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
703
|
-
return typeof value === 'object' && value !== null
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
function describeControlTarget(target: BioTemplateControlTarget): string {
|
|
707
|
-
if (typeof target === 'string') return target
|
|
708
|
-
if (isTemplateEnvelope(target)) return target.template_id
|
|
709
|
-
return collectionPresetName(target) ?? collectionPackName(target) ?? 'template collection'
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
function camelize(value: string): string {
|
|
713
|
-
return value.replace(/-([a-z0-9])/g, (_, char: string) => char.toUpperCase())
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
function capitalize(value: string): string {
|
|
717
|
-
return value.charAt(0).toUpperCase() + value.slice(1)
|
|
718
|
-
}
|