@morscherlab/mint-sdk 1.2.10 → 1.3.0-beta.10
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 +45 -137
- package/dist/ResourcePickerListInternal-CFAw4vTZ.js +605 -0
- package/dist/ResourcePickerListInternal-CFAw4vTZ.js.map +1 -0
- package/dist/__stories__/experiment-helpers.d.ts +12 -1
- package/dist/__tests__/components/ScientificNumber.test.d.ts +1 -0
- package/dist/__tests__/components/SequenceInput.test.d.ts +1 -0
- package/dist/__tests__/components/Skeleton.test.d.ts +1 -0
- package/dist/__tests__/components/SmartGroupFieldRecipe.test.d.ts +1 -0
- package/dist/__tests__/components/SmartGroupModal.test.d.ts +1 -0
- package/dist/__tests__/components/StepWizard.test.d.ts +1 -0
- package/dist/__tests__/components/TimeRangeInput.test.d.ts +1 -0
- package/dist/__tests__/components/UnitInput.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.keyboard.test.d.ts +1 -0
- package/dist/__tests__/components/WellPlate.sampleTypeIndicator.test.d.ts +1 -0
- package/dist/__tests__/composables/useChemicalFormula.test.d.ts +1 -0
- package/dist/__tests__/composables/useRackEditor.test.d.ts +1 -0
- package/dist/__tests__/composables/useSequenceUtils.test.d.ts +1 -0
- package/dist/__tests__/styles/baseControlsRules.test.d.ts +1 -0
- package/dist/__tests__/styles/controlRefreshRules.test.d.ts +1 -0
- package/dist/__tests__/styles/darkModeRules.test.d.ts +1 -0
- package/dist/__tests__/styles/menusShellRefresh.test.d.ts +1 -0
- package/dist/__tests__/templates/templatesDeprecation.test.d.ts +1 -0
- package/dist/__tests__/utils/plotlyTemplate.test.d.ts +1 -0
- package/dist/__tests__/utils/sampleTypeMarker.test.d.ts +1 -0
- package/dist/{analysisArtifactTypes-DQ0MjwHZ.js → analysisArtifactTypes-Cy3D0Ipg.js} +1 -1
- package/dist/{analysisArtifactTypes-DQ0MjwHZ.js.map → analysisArtifactTypes-Cy3D0Ipg.js.map} +1 -1
- package/dist/components/ActionMenu.vue.d.ts +17 -5
- package/dist/components/AdductText.vue.d.ts +3 -2
- package/dist/components/AlertBox.vue.d.ts +11 -14
- package/dist/components/AppAvatarMenu.vue.d.ts +18 -28
- package/dist/components/AppContainer.vue.d.ts +7 -11
- package/dist/components/AppLayout.vue.d.ts +11 -13
- package/dist/components/AppSidebar.vue.d.ts +30 -28
- package/dist/components/AppToastContainer.vue.d.ts +2 -1
- package/dist/components/AppTopBar.vue.d.ts +45 -44
- package/dist/components/ArtifactSaveDialog.vue.d.ts +3 -2
- package/dist/components/ArtifactSelectorModal.vue.d.ts +5 -6
- package/dist/components/AuditTrail.vue.d.ts +17 -18
- package/dist/components/AutoGroupModal.vue.d.ts +4 -3
- package/dist/components/Avatar.vue.d.ts +2 -1
- package/dist/components/BaseButton.vue.d.ts +11 -13
- package/dist/components/BaseCheckbox.vue.d.ts +7 -1
- package/dist/components/BaseInput.vue.d.ts +15 -2
- package/dist/components/BaseModal.vue.d.ts +20 -23
- package/dist/components/BasePill.vue.d.ts +10 -13
- package/dist/components/BaseRadioGroup.vue.d.ts +2 -1
- package/dist/components/BaseSelect.vue.d.ts +3 -2
- package/dist/components/BaseSlider.vue.d.ts +18 -1
- package/dist/components/BaseTabs.vue.d.ts +2 -1
- package/dist/components/BaseTextarea.vue.d.ts +2 -1
- package/dist/components/BaseToggle.vue.d.ts +2 -1
- package/dist/components/BatchProgressList.vue.d.ts +22 -26
- package/dist/components/BioTemplateExperimentWorkspaceView.vue.d.ts +7 -14
- package/dist/components/BioTemplatePackWorkspaceView.vue.d.ts +6 -13
- package/dist/components/BioTemplatePresetWorkspaceView.vue.d.ts +7 -14
- package/dist/components/BioTemplateRenderer.vue.d.ts +2 -1
- package/dist/components/Breadcrumb.vue.d.ts +13 -16
- package/dist/components/Calendar.vue.d.ts +21 -23
- package/dist/components/ChartContainer.vue.d.ts +19 -25
- package/dist/components/ChemicalFormula.vue.d.ts +7 -11
- package/dist/components/CollapsibleCard.vue.d.ts +7 -11
- package/dist/components/ComponentBindingRenderer.vue.d.ts +2 -1
- package/dist/components/ConcentrationInput.vue.d.ts +2 -1
- package/dist/components/ConfirmDialog.vue.d.ts +10 -13
- package/dist/components/ControlWorkspaceView.vue.d.ts +9 -18
- package/dist/components/DataFrame.vue.d.ts +27 -24
- package/dist/components/DatePicker.vue.d.ts +3 -6
- package/dist/components/DateTimePicker.vue.d.ts +3 -6
- package/dist/components/Divider.vue.d.ts +3 -2
- package/dist/components/DoseCalculator.vue.d.ts +2 -1
- package/dist/components/DoseCalculatorVolumeField.vue.d.ts +2 -1
- package/dist/components/DoseDesignWorkspaceView.vue.d.ts +9 -18
- package/dist/components/EmptyState.vue.d.ts +9 -12
- package/dist/components/ExperimentCodeBadge.vue.d.ts +2 -1
- package/dist/components/ExperimentDataViewer.vue.d.ts +13 -15
- package/dist/components/ExperimentPopover.vue.d.ts +3 -5
- package/dist/components/ExperimentSelectorModal.vue.d.ts +3 -4
- package/dist/components/ExperimentTimeline.vue.d.ts +13 -15
- package/dist/components/FilePicker.vue.d.ts +10 -5
- package/dist/components/FileUploader.vue.d.ts +8 -16
- package/dist/components/FitPanel.vue.d.ts +26 -16
- package/dist/components/FormActions.vue.d.ts +2 -1
- package/dist/components/FormBuilder.vue.d.ts +54 -250
- package/dist/components/FormField.vue.d.ts +14 -16
- package/dist/components/FormulaInput.vue.d.ts +2 -1
- package/dist/components/GeneratedPathInput.vue.d.ts +6 -5
- package/dist/components/GeneratedPlotlyResult.vue.d.ts +2 -1
- package/dist/components/GeneratedPluginView.vue.d.ts +2 -1
- package/dist/components/GeneratedResultRenderer.vue.d.ts +2 -1
- package/dist/components/GroupAssigner.vue.d.ts +2 -1
- package/dist/components/IconButton.vue.d.ts +7 -11
- package/dist/components/InstrumentStateBadge.vue.d.ts +4 -3
- package/dist/components/JobsStatusTray.vue.d.ts +13 -29
- package/dist/components/LayoutResizeHandle.vue.d.ts +2 -1
- package/dist/components/LoadingSpinner.vue.d.ts +2 -1
- package/dist/components/MobileSupportGate.vue.d.ts +5 -13
- package/dist/components/MoleculeInput.vue.d.ts +3 -4
- package/dist/components/MultiSelect.vue.d.ts +2 -1
- package/dist/components/NumberInput.vue.d.ts +2 -1
- package/dist/components/PlateEditor.vue.d.ts +147 -0
- package/dist/components/PlotlyChart.vue.d.ts +21 -31
- package/dist/components/PluginIcon.vue.d.ts +2 -1
- package/dist/components/PluginWorkspaceView.props.d.ts +2 -6
- package/dist/components/PluginWorkspaceView.vue.d.ts +23 -51
- package/dist/components/ProgressBar.vue.d.ts +4 -9
- package/dist/components/ProtocolStepEditor.vue.d.ts +7 -5
- package/dist/components/ProtocolStepParameterField.vue.d.ts +2 -1
- package/dist/components/ReagentEditor.vue.d.ts +2 -1
- package/dist/components/ReagentList.presentation.d.ts +2 -1
- package/dist/components/ReagentList.vue.d.ts +15 -17
- package/dist/components/ResourceCard.vue.d.ts +18 -17
- package/dist/components/RuntimeUpdateNotice.vue.d.ts +3 -2
- package/dist/components/SampleHierarchyTree.vue.d.ts +21 -15
- package/dist/components/SampleLegend.vue.d.ts +2 -1
- package/dist/components/SampleSelector.vue.d.ts +15 -21
- package/dist/components/SampleSelectorGroupNode.vue.d.ts +2 -1
- package/dist/components/SampleSelectorSampleRow.vue.d.ts +2 -5
- package/dist/components/ScheduleCalendar.vue.d.ts +34 -36
- package/dist/components/ScientificNumber.vue.d.ts +3 -2
- package/dist/components/SearchableSelect.vue.d.ts +14 -32
- package/dist/components/SecretInput.vue.d.ts +2 -1
- package/dist/components/SectionCard.vue.d.ts +13 -14
- package/dist/components/SegmentedControl.vue.d.ts +2 -1
- package/dist/components/SequenceInput.vue.d.ts +10 -21
- package/dist/components/SequenceProgressBar.vue.d.ts +2 -1
- package/dist/components/SettingsModal.schema.d.ts +1 -1
- package/dist/components/SettingsModal.vue.d.ts +28 -25
- package/dist/components/Skeleton.vue.d.ts +2 -1
- package/dist/components/SmartGroup.types.d.ts +2 -2
- package/dist/components/SmartGroupFieldRecipe.groups.d.ts +2 -0
- package/dist/components/SmartGroupFieldRecipe.vue.d.ts +4 -7
- package/dist/components/SmartGroupManual.vue.d.ts +3 -2
- package/dist/components/SmartGroupModal.vue.d.ts +6 -4
- package/dist/components/StatusIndicator.vue.d.ts +2 -1
- package/dist/components/StepWizard.vue.d.ts +26 -27
- package/dist/components/TagsInput.vue.d.ts +3 -5
- package/dist/components/ThemeToggle.vue.d.ts +2 -1
- package/dist/components/TimePicker.vue.d.ts +6 -6
- package/dist/components/TimeRangeInput.vue.d.ts +9 -2
- package/dist/components/Tooltip.vue.d.ts +8 -18
- package/dist/components/UnitInput.vue.d.ts +2 -1
- package/dist/components/WellPlate.colors.d.ts +2 -4
- package/dist/components/WellPlate.rendering.d.ts +7 -1
- package/dist/components/WellPlate.sampleDrop.d.ts +2 -0
- package/dist/components/WellPlate.vue.d.ts +22 -39
- package/dist/components/index.d.ts +34 -31
- package/dist/components/index.js +5 -8
- package/dist/components/internal/ActionItemInternal.vue.d.ts +11 -13
- package/dist/components/internal/AppTopBarPageSelectorInternal.vue.d.ts +14 -23
- package/dist/components/internal/AppTopBarPillNavInternal.vue.d.ts +2 -1
- package/dist/components/internal/CalendarGridPanelInternal.vue.d.ts +2 -1
- package/dist/components/internal/DataStateInternal.vue.d.ts +7 -11
- package/dist/components/internal/{FilePickerTreeInternal.vue.d.ts → FilePickerListInternal.vue.d.ts} +9 -6
- package/dist/components/internal/FilePickerPreviewInternal.vue.d.ts +4 -3
- package/dist/components/internal/FormFieldRendererInternal.vue.d.ts +16 -18
- package/dist/components/internal/FormSectionRenderer.vue.d.ts +36 -32
- package/dist/components/internal/PlateEditorBindingInternal.vue.d.ts +8 -0
- package/dist/components/internal/ResourcePickerListInternal.vue.d.ts +65 -0
- package/dist/components/internal/SettingsPaneHeadInternal.vue.d.ts +15 -0
- package/dist/components/internal/WellEditPopupInternal.vue.d.ts +12 -4
- package/dist/components/internal/WorkspaceControlsInternal.vue.d.ts +6 -13
- package/dist/components/internal/WorkspaceShellInternal.vue.d.ts +19 -42
- package/dist/components/internal/WorkspaceSidebarInternal.vue.d.ts +9 -19
- package/dist/components/internal/filePickerPresentation.d.ts +8 -0
- package/dist/components/internal/generatedJobsApi.d.ts +9 -0
- package/dist/{components-Bbg_gtzF.js → components-GDDvof8D.js} +7088 -5955
- package/dist/components-GDDvof8D.js.map +1 -0
- package/dist/composables/controlSchemaTypes.d.ts +4 -43
- package/dist/composables/createFilePickerAdapter.d.ts +5 -1
- package/dist/composables/filePicker/usePickerNavigation.d.ts +7 -2
- package/dist/composables/index.d.ts +2 -13
- package/dist/composables/index.js +7 -11
- package/dist/composables/pluginWorkspaceModel.d.ts +1 -3
- package/dist/composables/useAutoGroup.d.ts +10 -0
- package/dist/composables/useBioTemplateComponents.d.ts +15 -3
- package/dist/composables/useBioTemplateControls.d.ts +5 -1
- package/dist/composables/useBioTemplatePackWorkspace.d.ts +2 -0
- package/dist/composables/useBioTemplatePresetWorkspace.d.ts +5 -1
- package/dist/composables/useBioTemplateWorkspace.d.ts +5 -1
- package/dist/composables/useChemicalFormula.d.ts +2 -1
- package/dist/composables/useDropdownState.d.ts +5 -0
- package/dist/composables/useExperimentSave.d.ts +5 -1
- package/dist/composables/useFileBrowser.d.ts +3 -2
- package/dist/composables/useFilePicker.d.ts +25 -13
- package/dist/composables/useFocusTrap.d.ts +2 -1
- package/dist/composables/useGroupAssignment.d.ts +5 -1
- package/dist/composables/useJobsStatusTray.d.ts +5 -5
- package/dist/composables/useMenuKeyboard.d.ts +3 -3
- package/dist/composables/usePlatformContext.d.ts +3 -0
- package/dist/composables/usePluginClient.d.ts +1 -1
- package/dist/composables/useRackEditor.d.ts +36 -1
- package/dist/composables/useSequenceUtils.d.ts +8 -0
- package/dist/composables/useTemplateCollection.d.ts +5 -1
- package/dist/composables/workspaceRecipes.d.ts +1 -0
- package/dist/composables-D6uqp0UF.js +591 -0
- package/dist/composables-D6uqp0UF.js.map +1 -0
- package/dist/{errors-BLuqMee5.js → experiment-DgllIc3I.js} +89 -333
- package/dist/experiment-DgllIc3I.js.map +1 -0
- package/dist/{experiment-utils-CV2Wza3z.js → experiment-utils-DTANyVKV.js} +68 -37
- package/dist/experiment-utils-DTANyVKV.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +122 -17
- package/dist/index.js.map +1 -1
- package/dist/install.js +1 -2
- package/dist/install.js.map +1 -1
- package/dist/instrument.d.ts +6 -0
- package/dist/lcms.d.ts +11 -0
- package/dist/permissions.d.ts +2 -47
- package/dist/permissions.js +2 -26
- package/dist/permissions.js.map +1 -1
- package/dist/settings-BLr8lzw6.js +341 -0
- package/dist/settings-BLr8lzw6.js.map +1 -0
- package/dist/stores/auth.d.ts +2 -150
- package/dist/stores/experiment.d.ts +2 -106
- package/dist/stores/index.js +2 -2
- package/dist/stores/settings.d.ts +2 -44
- package/dist/styles.css +8608 -6950
- package/dist/tailwind.preset.js.map +1 -1
- package/dist/templates/adapters.d.ts +3 -0
- package/dist/templates/assayMatrixAdapters.d.ts +8 -1
- package/dist/templates/assayMatrixBuilder.d.ts +1 -0
- package/dist/templates/builderPresetControls.d.ts +1 -0
- package/dist/templates/calibrationCurveAdapters.d.ts +3 -0
- package/dist/templates/calibrationCurveBuilder.d.ts +1 -0
- package/dist/templates/catalog.d.ts +6 -2
- package/dist/templates/componentBindings.d.ts +31 -5
- package/dist/templates/componentPlateHelpers.d.ts +7 -1
- package/dist/templates/controlSchemas.d.ts +9 -0
- package/dist/templates/defaultBioTemplateBuilder.d.ts +1 -0
- package/dist/templates/doseResponseAdapters.d.ts +2 -0
- package/dist/templates/doseResponseBuilder.d.ts +1 -0
- package/dist/templates/elisaAssayCollectionBuilder.d.ts +1 -0
- package/dist/templates/flowCytometryAssayCollectionBuilder.d.ts +1 -0
- package/dist/templates/flowCytometryPanelBuilder.d.ts +1 -0
- package/dist/templates/flowPanelAdapters.d.ts +3 -0
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/index.js +2 -3
- package/dist/templates/instrumentRunAdapters.d.ts +13 -2
- package/dist/templates/instrumentRunBuilder.d.ts +1 -0
- package/dist/templates/lcmsBatchCollectionBuilder.d.ts +1 -0
- package/dist/templates/packs.d.ts +4 -0
- package/dist/templates/plateMapAdapters.d.ts +2 -0
- package/dist/templates/plateMapBuilder.d.ts +1 -0
- package/dist/templates/presets.d.ts +6 -2
- package/dist/templates/protocolAdapters.d.ts +4 -0
- package/dist/templates/protocolStepsBuilder.d.ts +1 -0
- package/dist/templates/qpcrAdapters.d.ts +4 -0
- package/dist/templates/qpcrExpressionCollectionBuilder.d.ts +1 -0
- package/dist/templates/qpcrPlateBuilder.d.ts +1 -0
- package/dist/templates/reagentAdapters.d.ts +4 -0
- package/dist/templates/reagentListBuilder.d.ts +1 -0
- package/dist/templates/samplePrepAdapters.d.ts +3 -0
- package/dist/templates/samplePrepBuilder.d.ts +1 -0
- package/dist/templates/sampleSheetAdapters.d.ts +4 -0
- package/dist/templates/sampleSheetBuilder.d.ts +1 -0
- package/dist/templates/targetedMetabolomicsCollectionBuilder.d.ts +1 -0
- package/dist/templates/templateEnvelopes.d.ts +8 -0
- package/dist/templates/templatePackCollectionBuilder.d.ts +1 -0
- package/dist/templates/templatePresetCollectionBuilder.d.ts +2 -0
- package/dist/templates/templateValidators.d.ts +12 -0
- package/dist/templates/timeCourseAdapters.d.ts +4 -0
- package/dist/templates/timeCourseBuilder.d.ts +1 -0
- package/dist/templates/wellPlateScreenCollectionBuilder.d.ts +1 -0
- package/dist/templates/westernBlotAssayCollectionBuilder.d.ts +1 -0
- package/dist/templates-BU1pet28.js +12304 -0
- package/dist/templates-BU1pet28.js.map +1 -0
- package/dist/types/auth.d.ts +0 -27
- package/dist/types/componentLabTypes.d.ts +14 -7
- package/dist/types/componentWorkflowTypes.d.ts +26 -0
- package/dist/types/components.d.ts +40 -17
- package/dist/types/fileBrowserTypes.d.ts +13 -0
- package/dist/types/filePicker.d.ts +19 -1
- package/dist/types/generated-ui.d.ts +13 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +1 -1
- package/dist/types/instrument.d.ts +43 -15
- package/dist/types/platform.d.ts +2 -0
- package/dist/utils/color.d.ts +6 -1
- package/dist/utils/formModelSync.d.ts +1 -0
- package/dist/utils/plotlyTemplate.d.ts +3 -0
- package/dist/utils/rack.d.ts +16 -0
- package/dist/utils/sampleTypeMarker.d.ts +23 -0
- package/dist/{validation-ChMyixAf.js → validation-Dmp9Q5W0.js} +3032 -838
- package/dist/validation-Dmp9Q5W0.js.map +1 -0
- package/package.json +17 -23
- package/src/__stories__/experiment-helpers.ts +8 -4
- package/src/__tests__/components/ActionMenu.test.ts +66 -0
- package/src/__tests__/components/AlertBox.test.ts +21 -0
- package/src/__tests__/components/AppAvatarMenu.test.ts +25 -0
- package/src/__tests__/components/AppTopBar.test.ts +79 -0
- package/src/__tests__/components/AppTopBarPageSelector.test.ts +20 -0
- package/src/__tests__/components/AppTopBarPillNav.test.ts +74 -0
- package/src/__tests__/components/ArtifactSelectorModal.test.ts +20 -6
- package/src/__tests__/components/AuditTrail.test.ts +38 -0
- package/src/__tests__/components/BaseCheckbox.test.ts +43 -0
- package/src/__tests__/components/BaseInput.test.ts +43 -0
- package/src/__tests__/components/BaseModal.test.ts +90 -0
- package/src/__tests__/components/BaseRadioGroup.test.ts +8 -0
- package/src/__tests__/components/BaseSlider.test.ts +116 -0
- package/src/__tests__/components/BaseToggle.test.ts +7 -0
- package/src/__tests__/components/BatchProgressList.test.ts +22 -14
- package/src/__tests__/components/BioTemplateExperimentWorkspaceView.test.ts +4 -4
- package/src/__tests__/components/BioTemplatePackWorkspaceView.test.ts +1 -1
- package/src/__tests__/components/BioTemplatePresetWorkspaceView.test.ts +8 -8
- package/src/__tests__/components/BioTemplateRenderer.test.ts +2 -2
- package/src/__tests__/components/Breadcrumb.test.ts +45 -0
- package/src/__tests__/components/CalendarGridPanel.test.ts +14 -0
- package/src/__tests__/components/ChartContainer.test.ts +23 -0
- package/src/__tests__/components/ChemicalFormula.test.ts +15 -0
- package/src/__tests__/components/CollapsibleCard.test.ts +12 -9
- package/src/__tests__/components/ComponentBindingRenderer.test.ts +45 -17
- package/src/__tests__/components/ConcentrationInput.test.ts +17 -2
- package/src/__tests__/components/DataFrame.test.ts +107 -4
- package/src/__tests__/components/DataStates.test.ts +0 -16
- package/src/__tests__/components/DatePicker.test.ts +10 -0
- package/src/__tests__/components/DoseCalculator.test.ts +47 -0
- package/src/__tests__/components/DoseCalculatorVolumeField.test.ts +37 -34
- package/src/__tests__/components/EmptyState.test.ts +16 -1
- package/src/__tests__/components/ExperimentSelectorModal.test.ts +31 -3
- package/src/__tests__/components/ExperimentTimeline.test.ts +45 -0
- package/src/__tests__/components/FilePicker.state.test.ts +2 -2
- package/src/__tests__/components/FilePicker.test.ts +360 -13
- package/src/__tests__/components/FileUploader.test.ts +15 -0
- package/src/__tests__/components/FitPanel.test.ts +96 -0
- package/src/__tests__/components/FormulaInput.test.ts +97 -0
- package/src/__tests__/components/GeneratedPathInput.test.ts +168 -41
- package/src/__tests__/components/GeneratedPlotlyResult.test.ts +1 -1
- package/src/__tests__/components/GeneratedResultRenderer.test.ts +47 -2
- package/src/__tests__/components/InstrumentStateBadge.test.ts +50 -0
- package/src/__tests__/components/JobsStatusTray.test.ts +27 -0
- package/src/__tests__/components/MoleculeInput.test.ts +78 -0
- package/src/__tests__/components/MultiSelect.test.ts +6 -0
- package/src/__tests__/components/PlateEditor.test.ts +1134 -0
- package/src/__tests__/components/PlateEditorBindingInternal.test.ts +64 -0
- package/src/__tests__/components/PlotlyChart.test.ts +147 -1
- package/src/__tests__/components/ProgressBar.test.ts +18 -0
- package/src/__tests__/components/ProtocolStepEditor.test.ts +106 -18
- package/src/__tests__/components/ProtocolStepParameterField.test.ts +74 -29
- package/src/__tests__/components/ReagentList.presentation.test.ts +10 -5
- package/src/__tests__/components/ReagentList.test.ts +23 -0
- package/src/__tests__/components/ResourcePickerListInternal.test.ts +141 -0
- package/src/__tests__/components/RetiredStyles.test.ts +0 -6
- package/src/__tests__/components/SampleHierarchyTree.test.ts +102 -0
- package/src/__tests__/components/SampleLegend.test.ts +18 -0
- package/src/__tests__/components/SampleSelector.test.ts +92 -1
- package/src/__tests__/components/SampleSelectorSampleRow.test.ts +5 -2
- package/src/__tests__/components/ScheduleCalendar.test.ts +32 -0
- package/src/__tests__/components/ScientificNumber.test.ts +113 -0
- package/src/__tests__/components/SearchableSelect.test.ts +21 -0
- package/src/__tests__/components/SecretInput.test.ts +6 -0
- package/src/__tests__/components/SegmentedControl.test.ts +14 -0
- package/src/__tests__/components/SequenceInput.test.ts +81 -0
- package/src/__tests__/components/SettingsModal.schema.test.ts +5 -5
- package/src/__tests__/components/SettingsModal.test.ts +371 -23
- package/src/__tests__/components/Skeleton.test.ts +23 -0
- package/src/__tests__/components/SmartGroupFieldRecipe.test.ts +12 -0
- package/src/__tests__/components/SmartGroupModal.test.ts +69 -0
- package/src/__tests__/components/StepWizard.test.ts +75 -0
- package/src/__tests__/components/TagsInput.test.ts +16 -0
- package/src/__tests__/components/TimePicker.test.ts +66 -0
- package/src/__tests__/components/TimeRangeInput.test.ts +83 -0
- package/src/__tests__/components/UnitInput.test.ts +147 -0
- package/src/__tests__/components/WellEditPopupInternal.test.ts +434 -2
- package/src/__tests__/components/WellPlate.decoration.test.ts +18 -0
- package/src/__tests__/components/WellPlate.geometry.test.ts +13 -0
- package/src/__tests__/components/WellPlate.interaction.test.ts +213 -0
- package/src/__tests__/components/WellPlate.keyboard.test.ts +24 -0
- package/src/__tests__/components/WellPlate.rendering.test.ts +38 -19
- package/src/__tests__/components/WellPlate.sampleDrop.test.ts +19 -0
- package/src/__tests__/components/WellPlate.sampleTypeIndicator.test.ts +58 -0
- package/src/__tests__/composables/createFilePickerAdapter.test.ts +114 -1
- package/src/__tests__/composables/useBioTemplatePackWorkspace.test.ts +1 -1
- package/src/__tests__/composables/useBioTemplateWorkspace.test.ts +1 -1
- package/src/__tests__/composables/useChemicalFormula.test.ts +60 -0
- package/src/__tests__/composables/useControlSchema.test.ts +15 -5
- package/src/__tests__/composables/useDropdownState.test.ts +20 -1
- package/src/__tests__/composables/useGeneratedAnalysis.test.ts +52 -0
- package/src/__tests__/composables/usePickerNavigation.test.ts +61 -1
- package/src/__tests__/composables/usePlatformFilePickerAdapter.test.ts +18 -6
- package/src/__tests__/composables/useRackEditor.test.ts +270 -0
- package/src/__tests__/composables/useSequenceUtils.test.ts +28 -0
- package/src/__tests__/docs/frontendDocsCatalog.test.ts +44 -9
- package/src/__tests__/styles/baseControlsRules.test.ts +115 -0
- package/src/__tests__/styles/controlRefreshRules.test.ts +218 -0
- package/src/__tests__/styles/cssTokens.test.ts +7 -5
- package/src/__tests__/styles/darkModeRules.test.ts +47 -0
- package/src/__tests__/styles/menusShellRefresh.test.ts +75 -0
- package/src/__tests__/templates/templates.test.ts +65 -15
- package/src/__tests__/templates/templatesDeprecation.test.ts +78 -0
- package/src/__tests__/utils/permissions.test.ts +0 -68
- package/src/__tests__/utils/plotlyTemplate.test.ts +69 -0
- package/src/__tests__/utils/sampleTypeMarker.test.ts +54 -0
- package/src/components/ActionMenu.vue +44 -23
- package/src/components/AdductText.story.vue +18 -0
- package/src/components/AdductText.vue +7 -1
- package/src/components/AlertBox.vue +3 -7
- package/src/components/AppAvatarMenu.vue +12 -10
- package/src/components/AppSidebar.vue +1 -1
- package/src/components/AppTopBar.story.vue +47 -4
- package/src/components/AppTopBar.vue +16 -22
- package/src/components/ArtifactSelectorModal.story.vue +1 -1
- package/src/components/ArtifactSelectorModal.vue +48 -160
- package/src/components/AuditTrail.vue +26 -12
- package/src/components/AutoGroupModal.vue +1 -1
- package/src/components/BaseCheckbox.story.vue +58 -2
- package/src/components/BaseCheckbox.vue +21 -3
- package/src/components/BaseInput.story.vue +51 -0
- package/src/components/BaseInput.vue +62 -1
- package/src/components/BaseModal.story.vue +55 -0
- package/src/components/BaseModal.vue +83 -50
- package/src/components/BaseRadioGroup.vue +1 -1
- package/src/components/BaseSlider.story.vue +36 -0
- package/src/components/BaseSlider.vue +56 -8
- package/src/components/BaseToggle.vue +1 -7
- package/src/components/BatchProgressList.vue +50 -52
- package/src/components/BioTemplatePresetWorkspaceView.vue +1 -1
- package/src/components/Breadcrumb.story.vue +1 -1
- package/src/components/Breadcrumb.vue +50 -15
- package/src/components/ChartContainer.story.vue +42 -0
- package/src/components/ChartContainer.vue +22 -1
- package/src/components/ChemicalFormula.story.vue +11 -11
- package/src/components/ChemicalFormula.vue +1 -0
- package/src/components/CollapsibleCard.vue +12 -32
- package/src/components/ComponentBindingRenderer.vue +6 -8
- package/src/components/ConcentrationInput.story.vue +1 -1
- package/src/components/ConcentrationInput.vue +8 -14
- package/src/components/ControlWorkspaceView.vue +1 -1
- package/src/components/DataFrame.story.vue +45 -2
- package/src/components/DataFrame.vue +28 -13
- package/src/components/DatePicker.story.vue +11 -0
- package/src/components/DatePicker.vue +5 -5
- package/src/components/DateTimePicker.story.vue +1 -1
- package/src/components/DateTimePicker.vue +8 -5
- package/src/components/Divider.story.vue +1 -1
- package/src/components/DoseCalculator.vue +44 -51
- package/src/components/DoseCalculatorVolumeField.vue +22 -35
- package/src/components/DoseDesignWorkspaceView.vue +1 -1
- package/src/components/EmptyState.story.vue +4 -4
- package/src/components/EmptyState.vue +4 -2
- package/src/components/ExperimentPopover.story.vue +2 -2
- package/src/components/ExperimentPopover.vue +6 -4
- package/src/components/ExperimentSelectorModal.story.vue +2 -1
- package/src/components/ExperimentSelectorModal.vue +91 -261
- package/src/components/ExperimentTimeline.story.vue +29 -0
- package/src/components/ExperimentTimeline.vue +20 -0
- package/src/components/FilePicker.story.vue +65 -10
- package/src/components/FilePicker.vue +203 -121
- package/src/components/FitPanel.story.vue +72 -6
- package/src/components/FitPanel.vue +70 -18
- package/src/components/FormField.vue +2 -0
- package/src/components/FormulaInput.story.vue +6 -0
- package/src/components/FormulaInput.vue +49 -70
- package/src/components/GeneratedPathInput.story.vue +121 -8
- package/src/components/GeneratedPathInput.vue +155 -86
- package/src/components/GeneratedPlotlyResult.vue +1 -1
- package/src/components/GeneratedPluginView.vue +4 -4
- package/src/components/GeneratedResultRenderer.vue +19 -0
- package/src/components/InstrumentStateBadge.story.vue +41 -0
- package/src/components/InstrumentStateBadge.vue +24 -14
- package/src/components/JobsStatusTray.vue +30 -8
- package/src/components/MoleculeInput.vue +12 -7
- package/src/components/MultiSelect.vue +3 -3
- package/src/components/PlateEditor.story.vue +333 -0
- package/src/components/PlateEditor.vue +793 -0
- package/src/components/PlotlyChart.story.vue +37 -1
- package/src/components/PlotlyChart.vue +86 -16
- package/src/components/PluginWorkspaceView.props.ts +1 -7
- package/src/components/PluginWorkspaceView.vue +0 -4
- package/src/components/ProgressBar.story.vue +0 -30
- package/src/components/ProgressBar.vue +3 -53
- package/src/components/ProtocolStepEditor.story.vue +8 -0
- package/src/components/ProtocolStepEditor.vue +55 -145
- package/src/components/ProtocolStepParameterField.vue +55 -93
- package/src/components/ReagentList.presentation.ts +7 -6
- package/src/components/ReagentList.vue +18 -17
- package/src/components/SampleHierarchyTree.story.vue +19 -0
- package/src/components/SampleHierarchyTree.vue +47 -14
- package/src/components/SampleLegend.vue +12 -4
- package/src/components/SampleSelector.story.vue +5 -1
- package/src/components/SampleSelector.vue +25 -15
- package/src/components/SampleSelectorGroupNode.vue +10 -20
- package/src/components/SampleSelectorSampleRow.vue +7 -18
- package/src/components/ScheduleCalendar.story.vue +14 -0
- package/src/components/ScheduleCalendar.vue +13 -1
- package/src/components/ScientificNumber.story.vue +15 -2
- package/src/components/ScientificNumber.vue +22 -26
- package/src/components/SearchableSelect.vue +14 -9
- package/src/components/SecretInput.vue +1 -1
- package/src/components/SegmentedControl.story.vue +23 -0
- package/src/components/SegmentedControl.vue +6 -1
- package/src/components/SequenceInput.story.vue +27 -5
- package/src/components/SequenceInput.vue +74 -29
- package/src/components/SequenceProgressBar.vue +0 -1
- package/src/components/SettingsModal.schema.ts +4 -2
- package/src/components/SettingsModal.story.vue +83 -22
- package/src/components/SettingsModal.vue +338 -79
- package/src/components/Skeleton.vue +6 -35
- package/src/components/SmartGroup.types.ts +2 -2
- package/src/components/SmartGroupFieldRecipe.groups.ts +4 -1
- package/src/components/SmartGroupFieldRecipe.vue +14 -8
- package/src/components/SmartGroupManual.vue +14 -11
- package/src/components/StepWizard.vue +16 -19
- package/src/components/TagsInput.story.vue +16 -11
- package/src/components/TagsInput.vue +20 -3
- package/src/components/TimePicker.story.vue +38 -3
- package/src/components/TimePicker.vue +26 -11
- package/src/components/TimeRangeInput.story.vue +50 -1
- package/src/components/TimeRangeInput.vue +36 -17
- package/src/components/UnitInput.story.vue +1 -1
- package/src/components/UnitInput.vue +173 -107
- package/src/components/WellPlate.colors.ts +7 -6
- package/src/components/WellPlate.geometry.ts +3 -0
- package/src/components/WellPlate.interaction.ts +39 -5
- package/src/components/WellPlate.rendering.ts +21 -27
- package/src/components/WellPlate.sampleDrop.ts +20 -12
- package/src/components/WellPlate.story.vue +18 -7
- package/src/components/WellPlate.vue +28 -22
- package/src/components/index.ts +34 -31
- package/src/components/internal/AppTopBarPageSelectorInternal.vue +13 -7
- package/src/components/internal/AppTopBarPillNavInternal.vue +12 -7
- package/src/components/internal/CalendarGridPanelInternal.vue +1 -1
- package/src/components/internal/FilePickerListInternal.vue +318 -0
- package/src/components/internal/FilePickerPreviewInternal.vue +54 -52
- package/src/components/internal/PlateEditorBindingInternal.vue +37 -0
- package/src/components/internal/ResourcePickerListInternal.vue +237 -0
- package/src/components/internal/SettingsPaneHeadInternal.vue +41 -0
- package/src/components/internal/WellEditPopupInternal.vue +219 -146
- package/src/components/internal/WorkspaceShellInternal.vue +0 -6
- package/src/components/internal/filePickerPresentation.ts +30 -0
- package/src/components/internal/generatedJobsApi.ts +12 -0
- package/src/composables/autoGroup/index.ts +3 -0
- package/src/composables/controlSchemaAdapters.ts +0 -4
- package/src/composables/controlSchemaFormFields.ts +0 -4
- package/src/composables/controlSchemaTypes.ts +4 -43
- package/src/composables/createFilePickerAdapter.ts +90 -22
- package/src/composables/filePicker/localFiles.ts +1 -0
- package/src/composables/filePicker/usePickerNavigation.ts +29 -2
- package/src/composables/index.ts +2 -71
- package/src/composables/pluginWorkspaceModel.ts +0 -3
- package/src/composables/useAutoGroup.ts +10 -0
- package/src/composables/useBioTemplateComponents.ts +15 -3
- package/src/composables/useBioTemplateControls.ts +5 -1
- package/src/composables/useBioTemplatePackWorkspace.ts +2 -0
- package/src/composables/useBioTemplatePresetWorkspace.ts +5 -1
- package/src/composables/useBioTemplateWorkspace.ts +5 -1
- package/src/composables/useChemicalFormula.ts +39 -13
- package/src/composables/useDropdownState.ts +6 -1
- package/src/composables/useExperimentSave.ts +5 -1
- package/src/composables/useFileBrowser.ts +3 -2
- package/src/composables/useFilePicker.ts +98 -13
- package/src/composables/useFocusTrap.ts +9 -6
- package/src/composables/useGeneratedAnalysis.ts +38 -0
- package/src/composables/useGroupAssignment.ts +5 -1
- package/src/composables/useJobsStatusTray.ts +5 -5
- package/src/composables/useMenuKeyboard.ts +5 -3
- package/src/composables/usePlatformFilePickerAdapter.ts +26 -4
- package/src/composables/usePluginClient.ts +1 -1
- package/src/composables/usePluginWorkspace.ts +0 -1
- package/src/composables/useRackEditor.ts +202 -12
- package/src/composables/useSequenceUtils.ts +20 -2
- package/src/composables/useTemplateCollection.ts +5 -1
- package/src/composables/workspaceRecipes.ts +1 -0
- package/src/index.ts +9 -3
- package/src/instrument.ts +6 -0
- package/src/lcms.ts +11 -0
- package/src/permissions.ts +2 -59
- package/src/styles/components/action-menu.css +9 -38
- package/src/styles/components/adduct-text.css +15 -3
- package/src/styles/components/alert-box.css +19 -70
- package/src/styles/components/app-avatar-menu.css +22 -57
- package/src/styles/components/app-container.css +4 -4
- package/src/styles/components/app-layout.css +18 -18
- package/src/styles/components/app-page-selector.css +50 -105
- package/src/styles/components/app-pill-nav.css +24 -42
- package/src/styles/components/app-sidebar.css +2 -2
- package/src/styles/components/app-top-bar.css +78 -55
- package/src/styles/components/artifact-selector-modal.css +1 -211
- package/src/styles/components/audit-trail.css +45 -38
- package/src/styles/components/avatar.css +1 -1
- package/src/styles/components/batch-progress-list.css +179 -95
- package/src/styles/components/breadcrumb.css +34 -15
- package/src/styles/components/calendar.css +2 -8
- package/src/styles/components/chart-container.css +81 -38
- package/src/styles/components/checkbox.css +8 -6
- package/src/styles/components/chemical-formula.css +8 -6
- package/src/styles/components/collapsible-card.css +6 -46
- package/src/styles/components/concentration-input.css +1 -10
- package/src/styles/components/dataframe.css +48 -67
- package/src/styles/components/date-picker.css +124 -62
- package/src/styles/components/datetime-picker.css +81 -47
- package/src/styles/components/divider.css +2 -4
- package/src/styles/components/dose-calculator.css +9 -135
- package/src/styles/components/empty-state.css +26 -35
- package/src/styles/components/experiment-code-badge.css +1 -1
- package/src/styles/components/experiment-popover.css +16 -83
- package/src/styles/components/experiment-selector-modal.css +9 -226
- package/src/styles/components/experiment-timeline.css +120 -50
- package/src/styles/components/file-picker.css +323 -299
- package/src/styles/components/file-uploader.css +4 -6
- package/src/styles/components/fit-panel.css +108 -22
- package/src/styles/components/form-field.css +6 -4
- package/src/styles/components/formula-input.css +121 -48
- package/src/styles/components/group-assigner.css +1 -3
- package/src/styles/components/icon-button.css +15 -37
- package/src/styles/components/input.css +91 -2
- package/src/styles/components/instrument-monitor.css +37 -447
- package/src/styles/components/jobs-status-tray.css +82 -61
- package/src/styles/components/loading-spinner.css +18 -0
- package/src/styles/components/mobile-support-gate.css +15 -17
- package/src/styles/components/modal.css +44 -33
- package/src/styles/components/molecule-input.css +31 -16
- package/src/styles/components/multi-select.css +33 -29
- package/src/styles/components/number-input.css +1 -1
- package/src/styles/components/plate-editor.css +497 -0
- package/src/styles/components/popover.css +162 -0
- package/src/styles/components/progress-bar.css +1 -70
- package/src/styles/components/protocol-step-editor.css +21 -333
- package/src/styles/components/radio-group.css +9 -18
- package/src/styles/components/reagent-editor.css +3 -7
- package/src/styles/components/reagent-list.css +63 -69
- package/src/styles/components/resource-card.css +4 -6
- package/src/styles/components/resource-picker-list.css +212 -0
- package/src/styles/components/sample-hierarchy-tree.css +83 -65
- package/src/styles/components/sample-legend.css +18 -7
- package/src/styles/components/sample-selector.css +41 -68
- package/src/styles/components/schedule-calendar.css +59 -54
- package/src/styles/components/scientific-number.css +72 -18
- package/src/styles/components/searchable-select.css +17 -26
- package/src/styles/components/secret-input.css +20 -23
- package/src/styles/components/section-card.css +3 -5
- package/src/styles/components/segmented-control.css +14 -1
- package/src/styles/components/select.css +19 -8
- package/src/styles/components/sequence-input.css +85 -37
- package/src/styles/components/sequence-progress-bar.css +18 -37
- package/src/styles/components/settings-modal.css +683 -34
- package/src/styles/components/skeleton.css +24 -23
- package/src/styles/components/slider.css +74 -8
- package/src/styles/components/smart-group.css +27 -39
- package/src/styles/components/status-indicator.css +1 -1
- package/src/styles/components/step-wizard.css +62 -99
- package/src/styles/components/tabs.css +2 -6
- package/src/styles/components/tags-input.css +64 -54
- package/src/styles/components/textarea.css +2 -2
- package/src/styles/components/time-picker.css +67 -38
- package/src/styles/components/time-range-input.css +16 -18
- package/src/styles/components/toast.css +1 -1
- package/src/styles/components/toggle.css +21 -31
- package/src/styles/components/tooltip.css +13 -15
- package/src/styles/components/unit-input.css +86 -36
- package/src/styles/components/well-edit-popup.css +111 -189
- package/src/styles/components/well-plate.css +7 -7
- package/src/styles/index.css +5 -7
- package/src/styles/variables.css +35 -7
- package/src/templates/adapters.ts +4 -0
- package/src/templates/assayMatrixAdapters.ts +8 -1
- package/src/templates/assayMatrixBuilder.ts +1 -0
- package/src/templates/builderPresetControls.ts +1 -0
- package/src/templates/calibrationCurveAdapters.ts +3 -0
- package/src/templates/calibrationCurveBuilder.ts +1 -0
- package/src/templates/catalog.ts +6 -2
- package/src/templates/componentBindingCatalog.ts +1 -1
- package/src/templates/componentBindings.ts +31 -5
- package/src/templates/componentDoseResponseProps.ts +0 -1
- package/src/templates/componentPlateHelpers.ts +22 -1
- package/src/templates/componentPlateMapProps.ts +7 -5
- package/src/templates/componentQpcrPlateProps.ts +0 -1
- package/src/templates/controlSchemas.ts +9 -0
- package/src/templates/defaultBioTemplateBuilder.ts +1 -0
- package/src/templates/doseResponseAdapters.ts +2 -0
- package/src/templates/doseResponseBuilder.ts +1 -0
- package/src/templates/elisaAssayCollectionBuilder.ts +1 -0
- package/src/templates/flowCytometryAssayCollectionBuilder.ts +1 -0
- package/src/templates/flowCytometryPanelBuilder.ts +1 -0
- package/src/templates/flowPanelAdapters.ts +3 -0
- package/src/templates/index.ts +4 -0
- package/src/templates/instrumentRunAdapters.ts +13 -2
- package/src/templates/instrumentRunBuilder.ts +1 -0
- package/src/templates/lcmsBatchCollectionBuilder.ts +1 -0
- package/src/templates/packs.ts +4 -0
- package/src/templates/plateMapAdapters.ts +2 -0
- package/src/templates/plateMapBuilder.ts +1 -0
- package/src/templates/presets.ts +6 -2
- package/src/templates/protocolAdapters.ts +4 -0
- package/src/templates/protocolStepsBuilder.ts +1 -0
- package/src/templates/qpcrAdapters.ts +4 -0
- package/src/templates/qpcrExpressionCollectionBuilder.ts +1 -0
- package/src/templates/qpcrPlateBuilder.ts +1 -0
- package/src/templates/reagentAdapters.ts +4 -0
- package/src/templates/reagentListBuilder.ts +1 -0
- package/src/templates/samplePrepAdapters.ts +3 -0
- package/src/templates/samplePrepBuilder.ts +1 -0
- package/src/templates/sampleSheetAdapters.ts +4 -0
- package/src/templates/sampleSheetBuilder.ts +1 -0
- package/src/templates/targetedMetabolomicsCollectionBuilder.ts +1 -0
- package/src/templates/templateEnvelopes.ts +8 -0
- package/src/templates/templatePackCollectionBuilder.ts +1 -0
- package/src/templates/templatePresetCollectionBuilder.ts +2 -0
- package/src/templates/templateValidators.ts +12 -0
- package/src/templates/timeCourseAdapters.ts +4 -0
- package/src/templates/timeCourseBuilder.ts +1 -0
- package/src/templates/wellPlateScreenCollectionBuilder.ts +1 -0
- package/src/templates/westernBlotAssayCollectionBuilder.ts +1 -0
- package/src/types/auth.ts +0 -37
- package/src/types/componentLabTypes.ts +16 -13
- package/src/types/componentWorkflowTypes.ts +29 -0
- package/src/types/components.ts +43 -20
- package/src/types/fileBrowserTypes.ts +15 -0
- package/src/types/filePicker.ts +19 -1
- package/src/types/generated-ui.ts +15 -0
- package/src/types/index.ts +12 -11
- package/src/types/instrument.ts +47 -15
- package/src/types/platform.ts +2 -0
- package/src/utils/color.ts +16 -1
- package/src/utils/formModelSync.ts +1 -1
- package/src/utils/plotlyTemplate.ts +39 -0
- package/src/utils/rack.ts +16 -0
- package/src/utils/sampleTypeMarker.ts +44 -0
- package/dist/ExperimentPopover-CJdNlCZb.js +0 -451
- package/dist/ExperimentPopover-CJdNlCZb.js.map +0 -1
- package/dist/ExperimentSelectorModal-DHE9k8TP.js +0 -507
- package/dist/ExperimentSelectorModal-DHE9k8TP.js.map +0 -1
- package/dist/SettingsModal-DELMkUFR.js +0 -492
- package/dist/SettingsModal-DELMkUFR.js.map +0 -1
- package/dist/Skeleton-jhF9wUkU.js +0 -485
- package/dist/Skeleton-jhF9wUkU.js.map +0 -1
- package/dist/__tests__/composables/usePluginConfig.test.d.ts +0 -15
- package/dist/chunk-BoAXSpZd.js +0 -33
- package/dist/components/AppPluginSwitcher.vue.d.ts +0 -40
- package/dist/components/ColorSlider.vue.d.ts +0 -34
- package/dist/components/DropdownButton.vue.d.ts +0 -49
- package/dist/components/FileBrowserModal.vue.d.ts +0 -99
- package/dist/components/InstrumentAlertLog.vue.d.ts +0 -22
- package/dist/components/InstrumentStatusCard.vue.d.ts +0 -13
- package/dist/components/LcmsSequenceTable.vue.d.ts +0 -54
- package/dist/components/PlateMapEditor.vue.d.ts +0 -50
- package/dist/components/RackEditor.vue.d.ts +0 -78
- package/dist/components/fileBrowserPresentation.d.ts +0 -10
- package/dist/components/internal/FileBrowserDialogInternal.vue.d.ts +0 -34
- package/dist/components/internal/FileBrowserListingInternal.vue.d.ts +0 -25
- package/dist/components/internal/FileBrowserToolbarInternal.vue.d.ts +0 -26
- package/dist/components/internal/PlateMapEditorToolbarInternal.vue.d.ts +0 -28
- package/dist/components-Bbg_gtzF.js.map +0 -1
- package/dist/composables/useAsync.d.ts +0 -132
- package/dist/composables/useAuth.d.ts +0 -47
- package/dist/composables/useCommandHistory.d.ts +0 -33
- package/dist/composables/useOptimisticMutation.d.ts +0 -32
- package/dist/composables/usePasskey.d.ts +0 -10
- package/dist/composables/usePluginConfig.d.ts +0 -27
- package/dist/composables/useResourceCrud.d.ts +0 -44
- package/dist/composables/useWellPainting.d.ts +0 -39
- package/dist/composables/useWellPlateAdapter.d.ts +0 -40
- package/dist/composables/useWellPlateEditor.d.ts +0 -33
- package/dist/composables/useWellPlateValidation.d.ts +0 -31
- package/dist/composables-BCbYb2lA.js +0 -2356
- package/dist/composables-BCbYb2lA.js.map +0 -1
- package/dist/errors-BLuqMee5.js.map +0 -1
- package/dist/experiment-CVDRAnqp.js +0 -90
- package/dist/experiment-CVDRAnqp.js.map +0 -1
- package/dist/experiment-utils-CV2Wza3z.js.map +0 -1
- package/dist/plotly.min-c2Sez60c.js +0 -180634
- package/dist/plotly.min-c2Sez60c.js.map +0 -1
- package/dist/templates-NuaNHohp.js +0 -5260
- package/dist/templates-NuaNHohp.js.map +0 -1
- package/dist/useControlSchema-vLiRPUmj.js +0 -7301
- package/dist/useControlSchema-vLiRPUmj.js.map +0 -1
- package/dist/useDropdownState-C7hRiVQf.js +0 -63
- package/dist/useDropdownState-C7hRiVQf.js.map +0 -1
- package/dist/useExperimentSelector-G_CAOFTX.js +0 -328
- package/dist/useExperimentSelector-G_CAOFTX.js.map +0 -1
- package/dist/useFormBuilder-D37ajgS8.js +0 -729
- package/dist/useFormBuilder-D37ajgS8.js.map +0 -1
- package/dist/validation-ChMyixAf.js.map +0 -1
- package/src/__tests__/components/AppPluginSwitcher.test.ts +0 -44
- package/src/__tests__/components/DropdownButton.test.ts +0 -628
- package/src/__tests__/components/FileBrowserModal.test.ts +0 -460
- package/src/__tests__/components/InstrumentAlertLog.test.ts +0 -59
- package/src/__tests__/components/LcmsSequenceTable.test.ts +0 -79
- package/src/__tests__/components/PlateMapEditorToolbarInternal.test.ts +0 -54
- package/src/__tests__/components/RackEditor.test.ts +0 -169
- package/src/__tests__/composables/useAuth.test.ts +0 -233
- package/src/__tests__/composables/useCommandHistory.test.ts +0 -43
- package/src/__tests__/composables/useOptimisticMutation.test.ts +0 -40
- package/src/__tests__/composables/usePluginConfig.test.ts +0 -497
- package/src/__tests__/composables/useResourceCrud.test.ts +0 -56
- package/src/__tests__/composables/useWellPainting.test.ts +0 -52
- package/src/__tests__/composables/useWellPlateAdapter.test.ts +0 -50
- package/src/__tests__/composables/useWellPlateValidation.test.ts +0 -42
- package/src/components/AppPluginSwitcher.story.vue +0 -87
- package/src/components/AppPluginSwitcher.vue +0 -134
- package/src/components/ColorSlider.story.vue +0 -120
- package/src/components/ColorSlider.vue +0 -160
- package/src/components/DropdownButton.story.vue +0 -102
- package/src/components/DropdownButton.vue +0 -181
- package/src/components/FileBrowserModal.story.vue +0 -203
- package/src/components/FileBrowserModal.vue +0 -384
- package/src/components/InstrumentAlertLog.vue +0 -187
- package/src/components/InstrumentStatusCard.vue +0 -184
- package/src/components/LcmsSequenceTable.vue +0 -222
- package/src/components/PlateMapEditor.story.vue +0 -92
- package/src/components/PlateMapEditor.vue +0 -423
- package/src/components/RackEditor.story.vue +0 -100
- package/src/components/RackEditor.vue +0 -429
- package/src/components/fileBrowserPresentation.ts +0 -39
- package/src/components/internal/FileBrowserDialogInternal.vue +0 -75
- package/src/components/internal/FileBrowserListingInternal.vue +0 -197
- package/src/components/internal/FileBrowserToolbarInternal.vue +0 -136
- package/src/components/internal/FilePickerTreeInternal.vue +0 -238
- package/src/components/internal/PlateMapEditorToolbarInternal.vue +0 -128
- package/src/composables/useAsync.ts +0 -327
- package/src/composables/useAuth.ts +0 -458
- package/src/composables/useCommandHistory.ts +0 -117
- package/src/composables/useOptimisticMutation.ts +0 -97
- package/src/composables/usePasskey.ts +0 -216
- package/src/composables/usePluginConfig.ts +0 -252
- package/src/composables/useResourceCrud.ts +0 -235
- package/src/composables/useWellPainting.ts +0 -167
- package/src/composables/useWellPlateAdapter.ts +0 -151
- package/src/composables/useWellPlateEditor.ts +0 -415
- package/src/composables/useWellPlateValidation.ts +0 -89
- package/src/plotly-dist.d.ts +0 -3
- package/src/styles/components/app-plugin-switcher.css +0 -196
- package/src/styles/components/color-slider.css +0 -110
- package/src/styles/components/dropdown-button.css +0 -280
- package/src/styles/components/file-browser-modal.css +0 -489
- package/src/styles/components/lcms-sequence-table.css +0 -204
- package/src/styles/components/plate-map-editor.css +0 -464
- package/src/styles/components/rack-editor.css +0 -287
- /package/dist/__tests__/components/{AppPluginSwitcher.test.d.ts → AlertBox.test.d.ts} +0 -0
- /package/dist/__tests__/components/{DropdownButton.test.d.ts → AuditTrail.test.d.ts} +0 -0
- /package/dist/__tests__/components/{FileBrowserModal.test.d.ts → BaseCheckbox.test.d.ts} +0 -0
- /package/dist/__tests__/components/{InstrumentAlertLog.test.d.ts → BaseSlider.test.d.ts} +0 -0
- /package/dist/__tests__/components/{LcmsSequenceTable.test.d.ts → DoseCalculator.test.d.ts} +0 -0
- /package/dist/__tests__/components/{PlateMapEditorToolbarInternal.test.d.ts → FileUploader.test.d.ts} +0 -0
- /package/dist/__tests__/components/{RackEditor.test.d.ts → FitPanel.test.d.ts} +0 -0
- /package/dist/__tests__/{composables/useAuth.test.d.ts → components/FormulaInput.test.d.ts} +0 -0
- /package/dist/__tests__/{composables/useCommandHistory.test.d.ts → components/InstrumentStateBadge.test.d.ts} +0 -0
- /package/dist/__tests__/{composables/useOptimisticMutation.test.d.ts → components/MoleculeInput.test.d.ts} +0 -0
- /package/dist/__tests__/{composables/useResourceCrud.test.d.ts → components/PlateEditor.test.d.ts} +0 -0
- /package/dist/__tests__/{composables/useWellPainting.test.d.ts → components/PlateEditorBindingInternal.test.d.ts} +0 -0
- /package/dist/__tests__/{composables/useWellPlateAdapter.test.d.ts → components/ResourcePickerListInternal.test.d.ts} +0 -0
- /package/dist/__tests__/{composables/useWellPlateValidation.test.d.ts → components/SampleLegend.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composables-D6uqp0UF.js","names":[],"sources":["../src/composables/pluginFrontendBase.ts","../src/composables/useManualLayoutResize.ts","../src/composables/useFileBrowser.ts","../src/composables/analysisArtifactTarget.ts","../src/composables/createFilePickerAdapter.ts","../src/composables/usePlatformFilePickerAdapter.ts"],"sourcesContent":["import { getInjectedPlatformContext } from './platformContextHelpers'\n\nfunction normalizePluginRoutePrefix(prefix: string | undefined): string | undefined {\n const candidate = prefix?.trim()\n if (!candidate) return undefined\n\n const path = candidate.split('/').filter(Boolean).join('/')\n return path ? `/${path}/` : '/'\n}\n\n/**\n * Resolve the Vue Router base for a plugin frontend.\n *\n * Integrated plugins use the platform-injected mount prefix. Standalone and\n * development builds retain the caller's Vite base unchanged.\n */\nexport function resolvePluginFrontendBase(fallbackBase: string = '/'): string {\n const context = getInjectedPlatformContext()\n if (!context?.isIntegrated) return fallbackBase\n\n return normalizePluginRoutePrefix(context.plugin?.route_prefix) ?? fallbackBase\n}\n","import { computed, onBeforeUnmount, shallowRef, toValue, watch, type MaybeRefOrGetter } from 'vue'\n\nexport interface ResizePanelWidthConstraints {\n minWidth: number\n maxWidth: number\n mainMinWidth?: number\n layoutGap?: number\n}\n\nexport interface ResizePercentConstraints {\n minPercent: number\n maxPercent: number\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value))\n}\n\nfunction availablePanelWidth(\n containerWidth: number,\n constraints: ResizePanelWidthConstraints,\n): number {\n return Math.min(\n constraints.maxWidth,\n containerWidth - (constraints.mainMinWidth ?? 0) - (constraints.layoutGap ?? 0),\n )\n}\n\nexport function resizedLeadingPanelWidth(\n startWidth: number,\n deltaX: number,\n containerWidth: number,\n constraints: ResizePanelWidthConstraints,\n): number {\n return Math.round(clamp(\n startWidth + deltaX,\n constraints.minWidth,\n Math.max(constraints.minWidth, availablePanelWidth(containerWidth, constraints)),\n ))\n}\n\nexport function resizedTrailingPanelWidth(\n startWidth: number,\n deltaX: number,\n containerWidth: number,\n constraints: ResizePanelWidthConstraints,\n): number {\n return resizedLeadingPanelWidth(startWidth, -deltaX, containerWidth, constraints)\n}\n\nexport function resizedVerticalSplitPercent(\n startPercent: number,\n deltaY: number,\n containerHeight: number,\n constraints: ResizePercentConstraints,\n): number {\n if (containerHeight <= 0) return startPercent\n return Math.round(clamp(\n startPercent + (deltaY / containerHeight) * 100,\n constraints.minPercent,\n constraints.maxPercent,\n ))\n}\n\nexport interface ManualLayoutResizeContext<TKind extends string> {\n kind: TKind\n startValue: number\n deltaX: number\n deltaY: number\n containerRect: DOMRectReadOnly\n secondaryRect: DOMRectReadOnly | null\n}\n\nexport interface ManualLayoutResizeTarget<TKind extends string> {\n cursor?: string\n getContainerElement: () => HTMLElement | null\n getSecondaryElement?: () => HTMLElement | null\n getStartValue: () => number\n onResize: (context: ManualLayoutResizeContext<TKind>) => void\n}\n\n/** Coordinates pointer-driven resizing for one or more layout splitters. */\nexport function useManualLayoutResize<TKind extends string>(options: {\n enabled: MaybeRefOrGetter<boolean>\n resolveTarget: (kind: TKind) => ManualLayoutResizeTarget<TKind> | null\n}) {\n const activeResize = shallowRef<{\n kind: TKind\n startClientX: number\n startClientY: number\n startValue: number\n containerRect: DOMRectReadOnly\n secondaryRect: DOMRectReadOnly | null\n cursor: string\n } | null>(null)\n const isResizing = computed(() => activeResize.value !== null)\n let previousBodyCursor = ''\n let previousBodyUserSelect = ''\n\n function stopResize(): void {\n if (!activeResize.value) return\n activeResize.value = null\n window.removeEventListener('pointermove', handlePointerMove)\n window.removeEventListener('pointerup', stopResize)\n window.removeEventListener('pointercancel', stopResize)\n if (typeof document !== 'undefined') {\n document.body.style.cursor = previousBodyCursor\n document.body.style.userSelect = previousBodyUserSelect\n }\n }\n\n function handlePointerMove(event: PointerEvent): void {\n const state = activeResize.value\n if (!state) return\n options.resolveTarget(state.kind)?.onResize({\n kind: state.kind,\n startValue: state.startValue,\n deltaX: event.clientX - state.startClientX,\n deltaY: event.clientY - state.startClientY,\n containerRect: state.containerRect,\n secondaryRect: state.secondaryRect,\n })\n }\n\n function startResize(kind: TKind, event: PointerEvent): void {\n if (!toValue(options.enabled) || event.button !== 0) return\n const target = options.resolveTarget(kind)\n const containerRect = target?.getContainerElement()?.getBoundingClientRect()\n if (!target || !containerRect) return\n\n event.preventDefault()\n if (event.currentTarget instanceof HTMLElement) {\n event.currentTarget.setPointerCapture(event.pointerId)\n }\n const secondary = target.getSecondaryElement?.() ?? null\n activeResize.value = {\n kind,\n startClientX: event.clientX,\n startClientY: event.clientY,\n startValue: target.getStartValue(),\n containerRect,\n secondaryRect: secondary?.getBoundingClientRect() ?? null,\n cursor: target.cursor ?? 'col-resize',\n }\n\n if (typeof document !== 'undefined') {\n previousBodyCursor = document.body.style.cursor\n previousBodyUserSelect = document.body.style.userSelect\n document.body.style.cursor = activeResize.value.cursor\n document.body.style.userSelect = 'none'\n }\n window.addEventListener('pointermove', handlePointerMove)\n window.addEventListener('pointerup', stopResize)\n window.addEventListener('pointercancel', stopResize)\n }\n\n function isResizingKind(kind: TKind): boolean {\n return activeResize.value?.kind === kind\n }\n\n watch(() => toValue(options.enabled), enabled => { if (!enabled) stopResize() })\n onBeforeUnmount(stopResize)\n\n return { activeResize, isResizing, isResizingKind, startResize, stopResize }\n}\n","import {\n computed,\n getCurrentScope,\n onScopeDispose,\n ref,\n shallowRef,\n toValue,\n watch,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from 'vue'\n\nimport type {\n FileBrowserSortKey,\n FileDirectoryListing,\n FileEntry,\n FilePathCrumb,\n FileSelection,\n ServerMount,\n} from '../types/fileBrowserTypes'\nimport { useApi } from './useApi'\nimport { getInjectedPlatformContext } from './platformContextHelpers'\nimport { useRequestSyncState } from './useRequestSyncState'\n\nexport interface UseFileBrowserOptions {\n /** Extensions the caller cares about; entries are flagged, never removed. */\n typeRules?: MaybeRefOrGetter<string[] | undefined>\n /** Mount to open first; defaults to the first available one. */\n initialMountId?: MaybeRefOrGetter<string | undefined>\n /** Override the platform API base URL (standalone plugin dev). */\n apiBaseUrl?: string\n}\n\nexport interface UseFileBrowserReturn {\n /** Every configured mount, offline ones included. */\n mounts: Ref<ServerMount[]>\n /** Mount the current listing belongs to. */\n mountId: Ref<string>\n /** Mount-relative path of the current listing. */\n path: Ref<string>\n /** Parent path, or null at a mount root. */\n parent: Ref<string | null>\n entries: Ref<FileEntry[]>\n breadcrumbs: Ref<FilePathCrumb[]>\n /** Directory size before any search filter. */\n totalCount: Ref<number | null>\n /** How many entries satisfy the type rules. */\n matchCount: Ref<number | null>\n /** How many rows this listing carries, after search and any cap. */\n shownCount: Ref<number | null>\n /** True when the server capped the listing. */\n truncated: Ref<boolean>\n search: Ref<string>\n sort: Ref<FileBrowserSortKey>\n /** Paths the user has picked, keyed by mount and path. */\n selected: Ref<FileSelection[]>\n isLoading: ComputedRef<boolean>\n error: Ref<string | null>\n /** Load the mount list and open the first available mount. */\n init: () => Promise<void>\n /** Open a directory, or a mount root when path is empty. */\n navigate: (location: { mount_id: string; path: string }) => Promise<void>\n /** Re-read the current directory. */\n refresh: () => Promise<void>\n /** Take the directory currently being viewed as the input. */\n selectCurrentFolder: () => void\n clear: () => void\n}\n\n/**\n * Browses the platform's `/api/filesystem` routes for a custom file UI. For the\n * ready-made dialog, use `FilePicker` with `usePlatformFilePickerAdapter()`.\n *\n * Requires the `filesystem.browse` permission and a deployment that declares\n * mounts; with none configured the routes are absent and `mounts` stays empty.\n */\nexport function useFileBrowser(options: UseFileBrowserOptions = {}): UseFileBrowserReturn {\n const injectedContext = getInjectedPlatformContext()\n const api = useApi({ baseUrl: options.apiBaseUrl ?? injectedContext?.platformApiUrl })\n const sync = useRequestSyncState('Could not read the server mounts.')\n\n const mounts = ref<ServerMount[]>([])\n const mountId = shallowRef('')\n const path = shallowRef('')\n const parent = ref<string | null>(null)\n const entries = ref<FileEntry[]>([])\n const breadcrumbs = ref<FilePathCrumb[]>([])\n const totalCount = ref<number | null>(null)\n const matchCount = ref<number | null>(null)\n const shownCount = ref<number | null>(null)\n const truncated = ref(false)\n const search = shallowRef('')\n const sort = shallowRef<FileBrowserSortKey>('name')\n const selected = ref<FileSelection[]>([])\n\n const mountsLoading = shallowRef(false)\n const listingLoading = shallowRef(false)\n const listingReady = shallowRef(false)\n const isLoading = computed(() => mountsLoading.value || listingLoading.value)\n let listToken = 0\n let mountsToken = 0\n let disposed = false\n let listingController: AbortController | undefined\n let mountsController: AbortController | undefined\n let searchTimer: ReturnType<typeof setTimeout> | undefined\n\n function resetListing(): void {\n listingReady.value = false\n entries.value = []\n breadcrumbs.value = []\n parent.value = null\n totalCount.value = null\n matchCount.value = null\n shownCount.value = null\n truncated.value = false\n }\n\n function typeRuleParams(): string {\n const rules = toValue(options.typeRules) ?? []\n return rules.map((rule) => `&type_rules=${encodeURIComponent(rule)}`).join('')\n }\n\n /** Prefer the API's own `detail` over axios's \"Request failed with status N\". */\n function describe(cause: unknown, fallback: string): string {\n const detail = (cause as { response?: { data?: { detail?: unknown } } })?.response?.data?.detail\n return typeof detail === 'string' && detail ? detail : sync.readErrorMessage(cause, fallback)\n }\n\n function fail(cause: unknown, fallback: string): void {\n sync.setError(new Error(describe(cause, fallback)), fallback)\n }\n\n function statusOf(cause: unknown): number | undefined {\n return (cause as { response?: { status?: number } })?.response?.status\n }\n\n async function loadMounts(): Promise<boolean> {\n const token = ++mountsToken\n mountsController?.abort()\n mountsController = new AbortController()\n mountsLoading.value = true\n try {\n const data = await api.get<{ mounts: ServerMount[] }>('/filesystem/mounts', {\n signal: mountsController.signal,\n })\n if (disposed || token !== mountsToken) return false\n mounts.value = data.mounts ?? []\n sync.clearError()\n sync.markLoaded()\n return true\n } catch (cause) {\n if (disposed || token !== mountsToken) return false\n // The platform only registers these routes once mounts are configured, so\n // a 404 means \"none declared\" — an empty sidebar, not a failure.\n if (statusOf(cause) === 404) {\n mounts.value = []\n sync.clearError()\n sync.markLoaded()\n return true\n }\n mounts.value = []\n fail(cause, 'Could not read the server mounts.')\n return false\n } finally {\n if (token === mountsToken) mountsLoading.value = false\n }\n }\n\n async function navigate(location: { mount_id: string; path: string }, refresh = false): Promise<void> {\n if (disposed || !location.mount_id) return\n clearTimeout(searchTimer)\n const token = ++listToken\n listingController?.abort()\n listingController = new AbortController()\n listingLoading.value = true\n mountId.value = location.mount_id\n path.value = location.path\n resetListing()\n sync.clearError()\n try {\n const query =\n `mount_id=${encodeURIComponent(location.mount_id)}` +\n `&path=${encodeURIComponent(location.path)}` +\n `&sort=${sort.value}` +\n (refresh ? '&refresh=true' : '') +\n (search.value ? `&search=${encodeURIComponent(search.value)}` : '') +\n typeRuleParams()\n const listing = await api.get<FileDirectoryListing>(`/filesystem/browse?${query}`, {\n signal: listingController.signal,\n })\n if (disposed || token !== listToken) return\n mountId.value = listing.mount_id\n path.value = listing.path\n parent.value = listing.parent ?? null\n entries.value = listing.entries ?? []\n breadcrumbs.value = listing.breadcrumbs ?? []\n totalCount.value = listing.total_count ?? null\n matchCount.value = listing.match_count ?? null\n shownCount.value = listing.shown_count ?? listing.entries?.length ?? null\n truncated.value = listing.truncated ?? false\n listingReady.value = true\n sync.clearError()\n sync.markLoaded()\n } catch (cause) {\n if (disposed || token !== listToken) return\n entries.value = []\n fail(cause, 'Could not read that folder.')\n } finally {\n if (token === listToken) listingLoading.value = false\n }\n }\n\n async function init(): Promise<void> {\n if (disposed) return\n const navigationToken = listToken\n if (!(await loadMounts()) || disposed || navigationToken !== listToken) return\n const preferred = toValue(options.initialMountId)\n // An offline mount is not navigable, so a remembered preference for one\n // falls through to the first reachable mount instead of opening on an error.\n const reachable = (mount: ServerMount): boolean => mount.available !== false\n const target =\n mounts.value.find((mount) => mount.id === preferred && reachable(mount)) ??\n mounts.value.find(reachable)\n if (target) await navigate({ mount_id: target.id, path: '' })\n else {\n mountId.value = ''\n path.value = ''\n resetListing()\n }\n }\n\n async function refresh(): Promise<void> {\n if (disposed) return\n if (mountId.value) await navigate({ mount_id: mountId.value, path: path.value }, true)\n else await init()\n }\n\n function selectCurrentFolder(): void {\n if (!mountId.value || !listingReady.value || isLoading.value || sync.error.value) return\n const crumb = breadcrumbs.value[breadcrumbs.value.length - 1]\n const key = JSON.stringify([mountId.value, path.value])\n if (selected.value.some((item) => JSON.stringify([item.mount_id, item.path]) === key)) return\n selected.value = [\n ...selected.value,\n {\n mount_id: mountId.value,\n path: path.value,\n name: crumb?.label ?? path.value,\n kind: 'directory',\n child_count: totalCount.value,\n },\n ]\n }\n\n function clear(): void {\n selected.value = []\n }\n\n // Both controls are server-side, so they only take effect on a re-fetch.\n // Without these watchers the search box and sort button look live but are\n // inert until the user happens to navigate.\n watch(search, () => {\n if (!mountId.value) return\n clearTimeout(searchTimer)\n // Debounced: search changes on every keystroke.\n searchTimer = setTimeout(() => {\n void navigate({ mount_id: mountId.value, path: path.value })\n }, 250)\n })\n\n watch(sort, () => {\n if (mountId.value) void navigate({ mount_id: mountId.value, path: path.value })\n })\n\n watch(\n () => toValue(options.typeRules),\n () => {\n if (mountId.value) void navigate({ mount_id: mountId.value, path: path.value })\n },\n { deep: true },\n )\n\n if (getCurrentScope())\n onScopeDispose(() => {\n disposed = true\n ++listToken\n ++mountsToken\n clearTimeout(searchTimer)\n listingController?.abort()\n mountsController?.abort()\n })\n\n return {\n mounts,\n mountId,\n path,\n parent,\n entries,\n breadcrumbs,\n totalCount,\n matchCount,\n shownCount,\n truncated,\n search,\n sort,\n selected,\n isLoading,\n error: sync.error,\n init,\n navigate,\n refresh,\n selectCurrentFolder,\n clear,\n }\n}\n","import type { AnalysisArtifactTarget } from '../types/analysisArtifactTypes'\n\nconst EXPERIMENT_ID = 'experiment_id'\nconst ARTIFACT_PLUGIN_ID = 'artifact_plugin_id'\nconst ARTIFACT_KEY = 'artifact_key'\nconst ARTIFACT_ID = 'artifact_id'\n\nfunction parsePositiveInteger(value: string | null): number | undefined {\n if (value === null || !/^\\d+$/.test(value)) return undefined\n const parsed = Number(value)\n return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : undefined\n}\n\n/** Build the canonical query used to open one analysis artifact in a plugin. */\nexport function buildAnalysisArtifactTargetQuery(\n target: AnalysisArtifactTarget,\n): URLSearchParams {\n const query = new URLSearchParams()\n query.set(EXPERIMENT_ID, String(target.experimentId))\n query.set(ARTIFACT_PLUGIN_ID, target.artifactPluginId)\n query.set(ARTIFACT_KEY, target.artifactKey)\n if (target.artifactId !== undefined) {\n query.set(ARTIFACT_ID, String(target.artifactId))\n }\n return query\n}\n\n/** Parse a complete canonical target. Incomplete or invalid input is not guessed. */\nexport function parseAnalysisArtifactTarget(\n query: URLSearchParams,\n): AnalysisArtifactTarget | null {\n const experimentId = parsePositiveInteger(query.get(EXPERIMENT_ID))\n const artifactPluginId = query.get(ARTIFACT_PLUGIN_ID)?.trim()\n const artifactKey = query.get(ARTIFACT_KEY)?.trim()\n const rawArtifactId = query.get(ARTIFACT_ID)\n const artifactId = parsePositiveInteger(rawArtifactId)\n\n if (\n experimentId === undefined\n || !artifactPluginId\n || !artifactKey\n || (rawArtifactId !== null && artifactId === undefined)\n ) {\n return null\n }\n\n return {\n experimentId,\n artifactPluginId,\n artifactKey,\n ...(artifactId === undefined ? {} : { artifactId }),\n }\n}\n","import type { PickerAdapter, PickerNode, PickerRequest, PickerSearchResult } from '../types/filePicker'\nimport type {\n FileBrowserLocation,\n FileDirectoryListing,\n FileDirectoryTree,\n FileEntry,\n FileSearchResult,\n ServerMount,\n} from '../types/fileBrowserTypes'\nimport { pickerFormat } from './filePicker/validation'\n\nexport interface FilePickerTransport {\n listMounts(request?: PickerRequest): Promise<ServerMount[]>\n browse(location: FileBrowserLocation, request?: PickerRequest): Promise<FileDirectoryListing>\n /** `GET …/filesystem/tree`: one request fills the cache for the subfolders too. */\n tree?(location: FileBrowserLocation, request?: PickerRequest): Promise<FileDirectoryTree>\n /** `GET …/filesystem/search`: replaces the folder-by-folder search walk. */\n search?(\n location: FileBrowserLocation,\n query: string,\n recursive: boolean,\n request?: PickerRequest,\n ): Promise<FileSearchResult>\n}\nexport interface FilePickerAdapterOptions {\n /** Show this directory's contents directly and prevent navigation outside it. */\n rootLocation?: FileBrowserLocation\n}\n\n/** Opaque picker identity; decode before passing a selection to a mount-scoped API. */\nexport function encodePlatformPickerPath(mountId: string, path = ''): string {\n return JSON.stringify([mountId, path])\n}\nexport function decodePlatformPickerPath(path: string): { mountId: string; path: string } {\n const decoded: unknown = JSON.parse(path)\n if (\n !Array.isArray(decoded) || decoded.length !== 2 ||\n !decoded.every((item) => typeof item === 'string') || !decoded[0]\n ) throw new Error('Invalid platform picker path.')\n return { mountId: decoded[0], path: decoded[1] }\n}\n\nfunction isRelativePath(path: string): boolean {\n return path === '' || (!/^[a-z]:/i.test(path) && !/[\\\\\\x00-\\x1f\\x7f]/.test(path) &&\n path.split('/').every((part) => part !== '' && part !== '.' && part !== '..'))\n}\n\n/** Mount browsing and search shared by platform and generated plugin clients. */\nexport function createFilePickerAdapter(\n transport: FilePickerTransport,\n options: FilePickerAdapterOptions = {},\n): PickerAdapter {\n const root = options.rootLocation && { ...options.rootLocation }\n const mountLabels = new Map<string, string>()\n // Per picker instance: never share permission-sensitive listings across clients.\n const listings = new Map<string, PickerNode[]>()\n let generation = 0\n\n function invalidate(): void {\n generation++\n listings.clear()\n mountLabels.clear()\n }\n\n function validateLocation(location: FileBrowserLocation) {\n if (!location.mount_id || !isRelativePath(location.path) || (root && (\n location.mount_id !== root.mount_id ||\n (root.path !== '' && location.path !== root.path && !location.path.startsWith(`${root.path}/`))\n ))) throw new Error('Invalid file picker location.')\n }\n if (root) validateLocation(root)\n function begin(request?: PickerRequest): number {\n request?.signal?.throwIfAborted()\n if (request?.refresh) invalidate()\n return generation\n }\n function check(request: PickerRequest | undefined, token: number) {\n request?.signal?.throwIfAborted()\n if (token !== generation) throw new DOMException('Cancelled', 'AbortError')\n }\n async function read(path: string, request: PickerRequest | undefined, token: number): Promise<PickerNode[]> {\n check(request, token)\n const decoded = path ? decodePlatformPickerPath(path) : undefined\n const location = decoded ? { mount_id: decoded.mountId, path: decoded.path } : root\n if (location) validateLocation(location)\n const key = location ? encodePlatformPickerPath(location.mount_id, location.path) : ''\n const cached = listings.get(key)\n if (cached) return cached\n let nodes: PickerNode[]\n if (!location) {\n const mounts = await transport.listMounts(request)\n check(request, token)\n nodes = mounts.map((mount) => {\n mountLabels.set(mount.id, mount.label)\n return {\n kind: 'folder', path: encodePlatformPickerPath(mount.id), name: mount.label,\n parentPath: null, parentName: 'Server mounts',\n unavailableReason: mount.available === false ? 'This mount is offline.' : undefined,\n }\n })\n } else if (transport.tree) {\n const tree = await transport.tree(location, request)\n check(request, token)\n for (const listing of tree.listings ?? []) {\n const at = { mount_id: listing.mount_id, path: listing.path }\n validateLocation(at)\n if (at.mount_id !== location.mount_id) throw new Error('Invalid file picker directory entry.')\n // A capped subfolder is read on its own when opened, and reports the cap then.\n if (!listing.truncated) listings.set(encodePlatformPickerPath(at.mount_id, at.path), toNodes(at, listing))\n }\n const cached = listings.get(key)\n if (!cached)\n throw new Error('This directory exceeds the server listing limit. Choose a smaller data directory.')\n return cached\n } else {\n const listing = await transport.browse(location, request)\n check(request, token)\n if (listing.truncated)\n throw new Error('This directory exceeds the server listing limit. Choose a smaller data directory.')\n nodes = toNodes(location, listing)\n }\n listings.set(key, nodes)\n return nodes\n }\n function toNodes(location: FileBrowserLocation, listing: FileDirectoryListing): PickerNode[] {\n return (listing.entries ?? []).map((entry) => {\n if (entry.path !== `${location.path ? `${location.path}/` : ''}${entry.name}`)\n throw new Error('Invalid file picker directory entry.')\n return toNode(location.mount_id, entry)\n })\n }\n /** One entry, parented on the folder its mount-relative path names. */\n function toNode(mountId: string, entry: FileEntry): PickerNode {\n if (!isRelativePath(entry.path) || !entry.name || entry.name.includes('/') ||\n (entry.path !== entry.name && !entry.path.endsWith(`/${entry.name}`)))\n throw new Error('Invalid file picker directory entry.')\n const parent = entry.path.slice(0, Math.max(0, entry.path.length - entry.name.length - 1))\n const atRoot = root && mountId === root.mount_id && parent === root.path\n const common = {\n path: encodePlatformPickerPath(mountId, entry.path),\n parentPath: atRoot ? null : encodePlatformPickerPath(mountId, parent),\n parentName: `${mountLabels.get(mountId) ?? mountId}${parent ? ` / ${parent}` : ''}`,\n name: entry.name, bytes: entry.size_bytes, modifiedAt: entry.modified_at,\n }\n return entry.kind === 'directory'\n // Counts may include only matching formats, not nested directories.\n ? { ...common, kind: 'folder' }\n : { ...common, kind: 'file', format: pickerFormat(entry.name) }\n }\n async function serverSearch(\n query: string,\n scope: { path: string; recursive: boolean },\n request: PickerRequest | undefined,\n ): Promise<PickerNode[] | PickerSearchResult> {\n const token = begin(request)\n const decoded = scope.path ? decodePlatformPickerPath(scope.path) : undefined\n const location = decoded ? { mount_id: decoded.mountId, path: decoded.path } : root!\n validateLocation(location)\n const result = await transport.search!(location, query, scope.recursive, request)\n check(request, token)\n const prefix = location.path ? `${location.path}/` : ''\n const nodes = (result.entries ?? []).map((entry) => {\n // \"This folder\" searches may return direct children only.\n if (!entry.path.startsWith(prefix) || (!scope.recursive && entry.path.slice(prefix.length).includes('/')))\n throw new Error('Invalid file picker directory entry.')\n return toNode(location.mount_id, entry)\n })\n return result.truncated ? { nodes, truncated: true } : nodes\n }\n return {\n mounts: !root,\n mountOf(path) {\n try {\n return encodePlatformPickerPath(decodePlatformPickerPath(path).mountId)\n } catch {\n return undefined // initialPath is caller input; the listing reports a bad one.\n }\n },\n invalidate,\n listRoot: async (request) => read('', request, begin(request)),\n listChildren: async (path, request) => read(path, request, begin(request)),\n async search(query, scope, request) {\n // The mount list itself has no server to search, so it keeps the walk.\n if (transport.search && (scope.path || root)) return serverSearch(query, scope, request)\n const token = begin(request)\n const matches: PickerNode[] = []\n const queue = [scope.path]\n const visited = new Set<string>()\n const needle = query.toLowerCase()\n let currentRequest = request\n while (queue.length) {\n check(request, token)\n const path = queue.shift()!\n if (visited.has(path)) continue\n visited.add(path)\n if (visited.size > 500) return { nodes: matches, truncated: true }\n const nodes = await read(path, currentRequest, token)\n check(request, token)\n if (currentRequest?.refresh) {\n currentRequest = { ...currentRequest }\n delete currentRequest.refresh\n }\n for (const node of nodes) {\n if (node.name.toLowerCase().includes(needle)) matches.push(node)\n if (scope.recursive && node.kind === 'folder' && !node.unavailableReason)\n queue.push(node.path)\n }\n if (matches.length > 10000) return { nodes: matches.slice(0, 10000), truncated: true }\n }\n return matches\n },\n }\n}\n","import type { PickerAdapter } from '../types/filePicker'\nimport type {\n FileBrowserLocation,\n FileDirectoryListing,\n FileDirectoryTree,\n FileSearchResult,\n ServerMount,\n} from '../types/fileBrowserTypes'\nimport type { PickerRequest } from '../types/filePicker'\nimport { useApi } from './useApi'\nimport { getInjectedPlatformContext } from './platformContextHelpers'\nimport { createFilePickerAdapter, type FilePickerAdapterOptions } from './createFilePickerAdapter'\n\nexport { encodePlatformPickerPath, decodePlatformPickerPath } from './createFilePickerAdapter'\n\nfunction query(location: FileBrowserLocation, request?: PickerRequest): URLSearchParams {\n const params = new URLSearchParams({ mount_id: location.mount_id, path: location.path })\n if (request?.refresh) params.set('refresh', 'true')\n return params\n}\n\n/** Adapt the authenticated MINT mount API without exposing absolute host paths. */\nexport function usePlatformFilePickerAdapter(\n options: FilePickerAdapterOptions & { apiBaseUrl?: string } = {},\n): PickerAdapter {\n const api = useApi({\n baseUrl: options.apiBaseUrl ?? getInjectedPlatformContext()?.platformApiUrl,\n })\n return createFilePickerAdapter({\n async listMounts(request) {\n try {\n const url = `/filesystem/mounts${request?.refresh ? '?refresh=true' : ''}`\n const { mounts } = await api.get<{ mounts: ServerMount[] }>(url, {\n signal: request?.signal,\n })\n return mounts\n } catch (cause) {\n if ((cause as { response?: { status?: number } }).response?.status === 404) return []\n throw cause\n }\n },\n browse(location, request) {\n return api.get<FileDirectoryListing>(`/filesystem/browse?${query(location, request)}`, {\n signal: request?.signal,\n })\n },\n tree(location, request) {\n return api.get<FileDirectoryTree>(`/filesystem/tree?${query(location, request)}`, {\n signal: request?.signal,\n })\n },\n search(location, text, recursive, request) {\n const params = query(location, request)\n params.set('q', text)\n params.set('recursive', String(recursive))\n return api.get<FileSearchResult>(`/filesystem/search?${params}`, { signal: request?.signal })\n },\n }, options)\n}\n"],"mappings":";;;;;AAEA,SAAS,2BAA2B,QAAgD;CAClF,MAAM,YAAY,QAAQ,KAAK;CAC/B,IAAI,CAAC,WAAW,OAAO,KAAA;CAEvB,MAAM,OAAO,UAAU,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAC1D,OAAO,OAAO,IAAI,KAAK,KAAK;AAC9B;;;;;;;AAQA,SAAgB,0BAA0B,eAAuB,KAAa;CAC5E,MAAM,UAAU,2BAA2B;CAC3C,IAAI,CAAC,SAAS,cAAc,OAAO;CAEnC,OAAO,2BAA2B,QAAQ,QAAQ,YAAY,KAAK;AACrE;;;ACPA,SAAS,MAAM,OAAe,KAAa,KAAqB;CAC9D,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;AAEA,SAAS,oBACP,gBACA,aACQ;CACR,OAAO,KAAK,IACV,YAAY,UACZ,kBAAkB,YAAY,gBAAgB,MAAM,YAAY,aAAa,EAC/E;AACF;AAEA,SAAgB,yBACd,YACA,QACA,gBACA,aACQ;CACR,OAAO,KAAK,MAAM,MAChB,aAAa,QACb,YAAY,UACZ,KAAK,IAAI,YAAY,UAAU,oBAAoB,gBAAgB,WAAW,CAAC,CACjF,CAAC;AACH;AAEA,SAAgB,0BACd,YACA,QACA,gBACA,aACQ;CACR,OAAO,yBAAyB,YAAY,CAAC,QAAQ,gBAAgB,WAAW;AAClF;AAEA,SAAgB,4BACd,cACA,QACA,iBACA,aACQ;CACR,IAAI,mBAAmB,GAAG,OAAO;CACjC,OAAO,KAAK,MAAM,MAChB,eAAgB,SAAS,kBAAmB,KAC5C,YAAY,YACZ,YAAY,UACd,CAAC;AACH;;AAoBA,SAAgB,sBAA4C,SAGzD;CACD,MAA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AU,MAAM,SAAS;CAAK,CAAC;CACvF,IAAI,SAAS,SAAS,OAAO,IAAI,WAAW,MAAM;CAClD,OAAO;AACT;;AAGA,SAAgB,6BACd,UAA8D,CAAC,GAChD;CACf,MAAM,MAAM,OAAO,EACjB,SAAS,QAAQ,cAAc,2BAA2B,CAAC,EAAE,eAC/D,CAAC;CACD,OAAO,wBAAwB;EAC7B,MAAM,WAAW,SAAS;GACxB,IAAI;IACF,MAAM,MAAM,qBAAqB,SAAS,UAAU,kBAAkB;IACtE,MAAM,EAAE,WAAW,MAAM,IAAI,IAA+B,KAAK,EAC/D,QAAQ,SAAS,OACnB,CAAC;IACD,OAAO;GACT,SAAS,OAAO;IACd,IAAK,MAA6C,UAAU,WAAW,KAAK,OAAO,CAAC;IACpF,MAAM;GACR;EACF;EACA,OAAO,UAAU,SAAS;GACxB,OAAO,IAAI,IAA0B,sBAAsB,MAAM,UAAU,OAAO,KAAK,EACrF,QAAQ,SAAS,OACnB,CAAC;EACH;EACA,KAAK,UAAU,SAAS;GACtB,OAAO,IAAI,IAAuB,oBAAoB,MAAM,UAAU,OAAO,KAAK,EAChF,QAAQ,SAAS,OACnB,CAAC;EACH;EACA,OAAO,UAAU,MAAM,WAAW,SAAS;GACzC,MAAM,SAAS,MAAM,UAAU,OAAO;GACtC,OAAO,IAAI,KAAK,IAAI;GACpB,OAAO,IAAI,aAAa,OAAO,SAAS,CAAC;GACzC,OAAO,IAAI,IAAsB,sBAAsB,UAAU,EAAE,QAAQ,SAAS,OAAO,CAAC;EAC9F;CACF,GAAG,OAAO;AACZ"}
|
|
@@ -1,336 +1,8 @@
|
|
|
1
|
+
import { c as mintApiErrorFromResponse, o as useSettingsStore, s as MintApiError } from "./settings-BLr8lzw6.js";
|
|
1
2
|
import { canAccessAdmin, canAccessPlugin, getAccessAudience, getUserPermissions, hasAllPermissions, hasAnyPermission, isAdminUser } from "./permissions.js";
|
|
2
|
-
import { computed, ref
|
|
3
|
-
import { defineStore
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { defineStore } from "pinia";
|
|
4
5
|
import axios from "axios";
|
|
5
|
-
//#region src/apiErrors.ts
|
|
6
|
-
var STATUS_MESSAGES = {
|
|
7
|
-
400: "Bad request",
|
|
8
|
-
401: "Authentication required",
|
|
9
|
-
403: "Permission denied",
|
|
10
|
-
404: "Resource not found",
|
|
11
|
-
405: "Method not allowed",
|
|
12
|
-
409: "Conflict",
|
|
13
|
-
413: "Payload too large",
|
|
14
|
-
415: "Unsupported media type",
|
|
15
|
-
422: "Validation error",
|
|
16
|
-
429: "Rate limit exceeded",
|
|
17
|
-
500: "Internal server error",
|
|
18
|
-
502: "Bad gateway",
|
|
19
|
-
503: "Service unavailable"
|
|
20
|
-
};
|
|
21
|
-
function asRecord(value) {
|
|
22
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
/** Public error thrown by typed MINT SDK requests. */
|
|
26
|
-
var MintApiError = class extends Error {
|
|
27
|
-
name = "MintApiError";
|
|
28
|
-
constructor(message, code, status, requestId, details, detail, body, cause) {
|
|
29
|
-
super(message);
|
|
30
|
-
this.code = code;
|
|
31
|
-
this.status = status;
|
|
32
|
-
this.requestId = requestId;
|
|
33
|
-
this.details = details;
|
|
34
|
-
this.detail = detail;
|
|
35
|
-
this.body = body;
|
|
36
|
-
this.cause = cause;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
/** Normalize current typed envelopes and the previous FastAPI detail shape. */
|
|
40
|
-
function mintApiErrorFromResponse(status, payload, options = {}) {
|
|
41
|
-
const body = asRecord(payload);
|
|
42
|
-
const legacyDetail = body?.detail;
|
|
43
|
-
const inner = asRecord(legacyDetail) ?? body;
|
|
44
|
-
const text = (value) => typeof value === "string" && value ? value : void 0;
|
|
45
|
-
const canonical = typeof body?.status === "number" && text(body.code) && text(body.message);
|
|
46
|
-
const code = (canonical ? text(body.code) : text(inner?.error) ?? text(inner?.code)) ?? text(body?.code) ?? "unknown";
|
|
47
|
-
const message = (canonical ? text(body.message) : text(inner?.message)) ?? text(body?.message) ?? text(legacyDetail) ?? STATUS_MESSAGES[status] ?? `HTTP ${status}`;
|
|
48
|
-
const details = body?.details ?? inner?.details ?? null;
|
|
49
|
-
return new MintApiError(message, code, status, text(body?.request_id) ?? text(inner?.request_id) ?? options.requestId ?? null, details, legacyDetail, payload, options.cause);
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/stores/settings.ts
|
|
53
|
-
var STORAGE_KEY = "mint-settings";
|
|
54
|
-
var LEGACY_STORAGE_KEY = "mld-settings";
|
|
55
|
-
function getDefaultServerHost() {
|
|
56
|
-
if (typeof window !== "undefined" && window.location.hostname !== "localhost") return window.location.hostname;
|
|
57
|
-
return "localhost";
|
|
58
|
-
}
|
|
59
|
-
function getDefaultServerPort() {
|
|
60
|
-
if (typeof window !== "undefined") {
|
|
61
|
-
if (window.location.port) return parseInt(window.location.port, 10);
|
|
62
|
-
return window.location.protocol === "https:" ? 443 : 80;
|
|
63
|
-
}
|
|
64
|
-
return 8e3;
|
|
65
|
-
}
|
|
66
|
-
var defaultSettings = {
|
|
67
|
-
serverHost: getDefaultServerHost(),
|
|
68
|
-
serverPort: getDefaultServerPort(),
|
|
69
|
-
requestTimeout: 12e4,
|
|
70
|
-
wsAutoReconnect: true,
|
|
71
|
-
wsReconnectInterval: 5e3,
|
|
72
|
-
theme: "system",
|
|
73
|
-
colorPalette: "default",
|
|
74
|
-
tableDensity: "normal"
|
|
75
|
-
};
|
|
76
|
-
var colorPalettes = {
|
|
77
|
-
default: {
|
|
78
|
-
name: "Default (Cyan-Pink)",
|
|
79
|
-
hues: [180, 320]
|
|
80
|
-
},
|
|
81
|
-
colorblind: {
|
|
82
|
-
name: "Colorblind-friendly",
|
|
83
|
-
hues: [45, 260]
|
|
84
|
-
},
|
|
85
|
-
viridis: {
|
|
86
|
-
name: "Viridis",
|
|
87
|
-
hues: [280, 80]
|
|
88
|
-
},
|
|
89
|
-
pastel: {
|
|
90
|
-
name: "Pastel",
|
|
91
|
-
hues: [200, 340]
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Custom properties a non-default palette overrides on `<html>`.
|
|
96
|
-
*
|
|
97
|
-
* The saturation/lightness pairs are lifted from the canonical indigo/orange
|
|
98
|
-
* tokens in `styles/variables.css` so only the hue moves; the `default`
|
|
99
|
-
* palette writes nothing at all and the stylesheet values stand.
|
|
100
|
-
*/
|
|
101
|
-
var PALETTE_CSS_VARIABLES = [
|
|
102
|
-
"--color-primary",
|
|
103
|
-
"--color-primary-hover",
|
|
104
|
-
"--color-primary-soft",
|
|
105
|
-
"--color-cta",
|
|
106
|
-
"--color-cta-hover"
|
|
107
|
-
];
|
|
108
|
-
/** Build the `<html>` custom-property overrides for a palette. */
|
|
109
|
-
function paletteCssVariables(palette) {
|
|
110
|
-
if (palette === "default") return {};
|
|
111
|
-
const [primaryHue, accentHue] = colorPalettes[palette].hues;
|
|
112
|
-
return {
|
|
113
|
-
"--color-primary": `hsl(${primaryHue} 84% 67%)`,
|
|
114
|
-
"--color-primary-hover": `hsl(${primaryHue} 75% 59%)`,
|
|
115
|
-
"--color-primary-soft": `hsl(${primaryHue} 84% 67% / 0.12)`,
|
|
116
|
-
"--color-cta": `hsl(${accentHue} 95% 53%)`,
|
|
117
|
-
"--color-cta-hover": `hsl(${accentHue} 90% 48%)`
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
/** `DataFrame`-style size that each table density maps onto. */
|
|
121
|
-
var DENSITY_TABLE_SIZE = {
|
|
122
|
-
compact: "sm",
|
|
123
|
-
normal: "md",
|
|
124
|
-
comfortable: "lg"
|
|
125
|
-
};
|
|
126
|
-
/** Map a table density onto the `size` prop shared by the SDK table components. */
|
|
127
|
-
function tableDensityToSize(density) {
|
|
128
|
-
return DENSITY_TABLE_SIZE[density];
|
|
129
|
-
}
|
|
130
|
-
function loadSettings() {
|
|
131
|
-
try {
|
|
132
|
-
const stored = localStorage.getItem(STORAGE_KEY);
|
|
133
|
-
if (stored) {
|
|
134
|
-
const parsed = JSON.parse(stored);
|
|
135
|
-
return {
|
|
136
|
-
...defaultSettings,
|
|
137
|
-
...parsed
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
const legacyStored = localStorage.getItem(LEGACY_STORAGE_KEY);
|
|
141
|
-
if (legacyStored) {
|
|
142
|
-
const parsed = JSON.parse(legacyStored);
|
|
143
|
-
const migrated = {
|
|
144
|
-
...defaultSettings,
|
|
145
|
-
...parsed
|
|
146
|
-
};
|
|
147
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(migrated));
|
|
148
|
-
localStorage.removeItem(LEGACY_STORAGE_KEY);
|
|
149
|
-
return migrated;
|
|
150
|
-
}
|
|
151
|
-
} catch (e) {
|
|
152
|
-
console.warn("Failed to load settings from localStorage:", e);
|
|
153
|
-
}
|
|
154
|
-
return { ...defaultSettings };
|
|
155
|
-
}
|
|
156
|
-
function saveSettings(settings) {
|
|
157
|
-
try {
|
|
158
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(settings));
|
|
159
|
-
} catch (e) {
|
|
160
|
-
console.warn("Failed to save settings to localStorage:", e);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function getSystemPrefersDark() {
|
|
164
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
|
|
165
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
166
|
-
}
|
|
167
|
-
var useSettingsStore = defineStore("mint-settings", () => {
|
|
168
|
-
const serverHost = ref(defaultSettings.serverHost);
|
|
169
|
-
const serverPort = ref(defaultSettings.serverPort);
|
|
170
|
-
const requestTimeout = ref(defaultSettings.requestTimeout);
|
|
171
|
-
const wsAutoReconnect = ref(defaultSettings.wsAutoReconnect);
|
|
172
|
-
const wsReconnectInterval = ref(defaultSettings.wsReconnectInterval);
|
|
173
|
-
const theme = ref(defaultSettings.theme);
|
|
174
|
-
const systemPrefersDark = ref(getSystemPrefersDark());
|
|
175
|
-
const colorPalette = ref(defaultSettings.colorPalette);
|
|
176
|
-
const tableDensity = ref(defaultSettings.tableDensity);
|
|
177
|
-
const apiPrefix = "/api";
|
|
178
|
-
function _isSameOrigin() {
|
|
179
|
-
const currentHost = typeof window !== "undefined" ? window.location.hostname : "localhost";
|
|
180
|
-
const currentPort = typeof window !== "undefined" ? window.location.port : "8000";
|
|
181
|
-
const effectivePort = currentPort || (window.location.protocol === "https:" ? "443" : "80");
|
|
182
|
-
return {
|
|
183
|
-
same: serverHost.value === currentHost && String(serverPort.value) === effectivePort || serverHost.value === "localhost" && currentHost !== "localhost",
|
|
184
|
-
currentHost,
|
|
185
|
-
currentPort
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
function getApiBaseUrl() {
|
|
189
|
-
const { same } = _isSameOrigin();
|
|
190
|
-
if (same) return apiPrefix;
|
|
191
|
-
return `http://${serverHost.value}:${serverPort.value}${apiPrefix}`;
|
|
192
|
-
}
|
|
193
|
-
function getWsBaseUrl() {
|
|
194
|
-
const { same, currentHost, currentPort } = _isSameOrigin();
|
|
195
|
-
const protocol = typeof window !== "undefined" && window.location.protocol === "https:" ? "wss:" : "ws:";
|
|
196
|
-
if (same) return `${protocol}//${currentHost}${currentPort ? ":" + currentPort : ""}${apiPrefix}`;
|
|
197
|
-
return `ws://${serverHost.value}:${serverPort.value}${apiPrefix}`;
|
|
198
|
-
}
|
|
199
|
-
let _initialized = false;
|
|
200
|
-
function initialize() {
|
|
201
|
-
if (_initialized) return;
|
|
202
|
-
_initialized = true;
|
|
203
|
-
const loaded = loadSettings();
|
|
204
|
-
serverHost.value = loaded.serverHost;
|
|
205
|
-
serverPort.value = loaded.serverPort;
|
|
206
|
-
requestTimeout.value = loaded.requestTimeout;
|
|
207
|
-
wsAutoReconnect.value = loaded.wsAutoReconnect;
|
|
208
|
-
wsReconnectInterval.value = loaded.wsReconnectInterval;
|
|
209
|
-
theme.value = loaded.theme;
|
|
210
|
-
colorPalette.value = loaded.colorPalette;
|
|
211
|
-
tableDensity.value = loaded.tableDensity;
|
|
212
|
-
applyTheme();
|
|
213
|
-
applyPalette();
|
|
214
|
-
applyDensity();
|
|
215
|
-
}
|
|
216
|
-
function applyTheme() {
|
|
217
|
-
if (typeof document === "undefined") return;
|
|
218
|
-
const dark = theme.value === "system" ? systemPrefersDark.value : theme.value === "dark";
|
|
219
|
-
document.documentElement.classList.toggle("dark", dark);
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Write the selected palette's hues onto `<html>` as custom-property
|
|
223
|
-
* overrides. The `default` palette clears them so `styles/variables.css`
|
|
224
|
-
* keeps ownership of the brand colors.
|
|
225
|
-
*/
|
|
226
|
-
function applyPalette() {
|
|
227
|
-
if (typeof document === "undefined") return;
|
|
228
|
-
const style = document.documentElement.style;
|
|
229
|
-
const overrides = paletteCssVariables(colorPalette.value);
|
|
230
|
-
for (const name of PALETTE_CSS_VARIABLES) {
|
|
231
|
-
const value = overrides[name];
|
|
232
|
-
if (value) style.setProperty(name, value);
|
|
233
|
-
else style.removeProperty(name);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
/** Mirror the table density onto `<html data-density>` for CSS consumers. */
|
|
237
|
-
function applyDensity() {
|
|
238
|
-
if (typeof document === "undefined") return;
|
|
239
|
-
document.documentElement.dataset.density = tableDensity.value;
|
|
240
|
-
}
|
|
241
|
-
watch(theme, () => {
|
|
242
|
-
applyTheme();
|
|
243
|
-
persistSettings();
|
|
244
|
-
});
|
|
245
|
-
watch(colorPalette, applyPalette);
|
|
246
|
-
watch(tableDensity, applyDensity);
|
|
247
|
-
if (typeof window !== "undefined" && typeof window.matchMedia === "function") window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (event) => {
|
|
248
|
-
systemPrefersDark.value = event.matches;
|
|
249
|
-
if (theme.value === "system") applyTheme();
|
|
250
|
-
});
|
|
251
|
-
function persistSettings() {
|
|
252
|
-
saveSettings({
|
|
253
|
-
serverHost: serverHost.value,
|
|
254
|
-
serverPort: serverPort.value,
|
|
255
|
-
requestTimeout: requestTimeout.value,
|
|
256
|
-
wsAutoReconnect: wsAutoReconnect.value,
|
|
257
|
-
wsReconnectInterval: wsReconnectInterval.value,
|
|
258
|
-
theme: theme.value,
|
|
259
|
-
colorPalette: colorPalette.value,
|
|
260
|
-
tableDensity: tableDensity.value
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
watch([
|
|
264
|
-
serverHost,
|
|
265
|
-
serverPort,
|
|
266
|
-
requestTimeout,
|
|
267
|
-
wsAutoReconnect,
|
|
268
|
-
wsReconnectInterval,
|
|
269
|
-
colorPalette,
|
|
270
|
-
tableDensity
|
|
271
|
-
], () => {
|
|
272
|
-
persistSettings();
|
|
273
|
-
});
|
|
274
|
-
function resetToDefaults() {
|
|
275
|
-
serverHost.value = defaultSettings.serverHost;
|
|
276
|
-
serverPort.value = defaultSettings.serverPort;
|
|
277
|
-
requestTimeout.value = defaultSettings.requestTimeout;
|
|
278
|
-
wsAutoReconnect.value = defaultSettings.wsAutoReconnect;
|
|
279
|
-
wsReconnectInterval.value = defaultSettings.wsReconnectInterval;
|
|
280
|
-
theme.value = defaultSettings.theme;
|
|
281
|
-
colorPalette.value = defaultSettings.colorPalette;
|
|
282
|
-
tableDensity.value = defaultSettings.tableDensity;
|
|
283
|
-
}
|
|
284
|
-
function getPaletteHues() {
|
|
285
|
-
return colorPalettes[colorPalette.value].hues;
|
|
286
|
-
}
|
|
287
|
-
/** The `size` the SDK table components default to for the current density. */
|
|
288
|
-
function getTableSize() {
|
|
289
|
-
return tableDensityToSize(tableDensity.value);
|
|
290
|
-
}
|
|
291
|
-
function isDark() {
|
|
292
|
-
return theme.value === "system" ? systemPrefersDark.value : theme.value === "dark";
|
|
293
|
-
}
|
|
294
|
-
return {
|
|
295
|
-
serverHost,
|
|
296
|
-
serverPort,
|
|
297
|
-
requestTimeout,
|
|
298
|
-
wsAutoReconnect,
|
|
299
|
-
wsReconnectInterval,
|
|
300
|
-
theme,
|
|
301
|
-
systemPrefersDark,
|
|
302
|
-
colorPalette,
|
|
303
|
-
tableDensity,
|
|
304
|
-
initialize,
|
|
305
|
-
applyTheme,
|
|
306
|
-
applyPalette,
|
|
307
|
-
applyDensity,
|
|
308
|
-
persistSettings,
|
|
309
|
-
resetToDefaults,
|
|
310
|
-
getPaletteHues,
|
|
311
|
-
getTableSize,
|
|
312
|
-
isDark,
|
|
313
|
-
getApiBaseUrl,
|
|
314
|
-
getWsBaseUrl
|
|
315
|
-
};
|
|
316
|
-
});
|
|
317
|
-
/**
|
|
318
|
-
* Read the settings store without requiring Pinia to be installed.
|
|
319
|
-
*
|
|
320
|
-
* SDK components are mounted standalone (unit tests, Histoire stories, plugin
|
|
321
|
-
* previews) where no Pinia instance exists. They use this to pick up a user's
|
|
322
|
-
* preferences when the platform is running and fall back to their own defaults
|
|
323
|
-
* otherwise, instead of throwing.
|
|
324
|
-
*/
|
|
325
|
-
function tryUseSettingsStore() {
|
|
326
|
-
if (!getActivePinia()) return null;
|
|
327
|
-
try {
|
|
328
|
-
return useSettingsStore();
|
|
329
|
-
} catch {
|
|
330
|
-
return null;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
//#endregion
|
|
334
6
|
//#region src/stores/auth.ts
|
|
335
7
|
var AUTH_TOKEN_KEY = "mint-auth-token";
|
|
336
8
|
var AUTH_EXPIRES_KEY = "mint-auth-expires";
|
|
@@ -698,6 +370,90 @@ function readErrorMessage(value, fallback = "Request failed.") {
|
|
|
698
370
|
return fallback;
|
|
699
371
|
}
|
|
700
372
|
//#endregion
|
|
701
|
-
|
|
373
|
+
//#region src/stores/experiment.ts
|
|
374
|
+
function getPlatformApiUrl() {
|
|
375
|
+
if (typeof window === "undefined") return void 0;
|
|
376
|
+
return window.__MINT_PLATFORM__?.platformApiUrl;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* The single source of truth for the experiment a plugin is currently working on.
|
|
380
|
+
*
|
|
381
|
+
* Both entry points land here: `ExperimentSelectorModal` calls `select()` with a
|
|
382
|
+
* record the platform already returned, and deep links call `selectById()` with
|
|
383
|
+
* nothing but an id. Because a name can only ever arrive from the platform,
|
|
384
|
+
* there is no code path in which a caller can invent one.
|
|
385
|
+
*/
|
|
386
|
+
var useExperimentStore = defineStore("mint-experiment", () => {
|
|
387
|
+
const current = ref(null);
|
|
388
|
+
const currentId = ref(null);
|
|
389
|
+
const isResolving = ref(false);
|
|
390
|
+
const error = ref(null);
|
|
391
|
+
const inFlight = /* @__PURE__ */ new Map();
|
|
392
|
+
let selectionToken = 0;
|
|
393
|
+
function fetchExperiment(id) {
|
|
394
|
+
const pending = inFlight.get(id);
|
|
395
|
+
if (pending) return pending;
|
|
396
|
+
const base = getPlatformApiUrl() ?? "";
|
|
397
|
+
const request = useApi().get(`${base}/experiments/${id}`).finally(() => {
|
|
398
|
+
inFlight.delete(id);
|
|
399
|
+
});
|
|
400
|
+
inFlight.set(id, request);
|
|
401
|
+
return request;
|
|
402
|
+
}
|
|
403
|
+
/** Adopt a record the platform already returned, without a further request. */
|
|
404
|
+
function select(experiment) {
|
|
405
|
+
selectionToken += 1;
|
|
406
|
+
current.value = experiment;
|
|
407
|
+
currentId.value = experiment.id;
|
|
408
|
+
error.value = null;
|
|
409
|
+
isResolving.value = false;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Bind to an experiment known only by id, resolving its record from the
|
|
413
|
+
* platform. On failure the binding is remembered but `current` stays null, so
|
|
414
|
+
* callers can distinguish "not resolved yet" from "nothing selected".
|
|
415
|
+
*/
|
|
416
|
+
async function selectById(id) {
|
|
417
|
+
const joinsCurrentResolution = isResolving.value && currentId.value === id;
|
|
418
|
+
const token = joinsCurrentResolution ? selectionToken : selectionToken += 1;
|
|
419
|
+
if (!joinsCurrentResolution) {
|
|
420
|
+
current.value = null;
|
|
421
|
+
currentId.value = id;
|
|
422
|
+
error.value = null;
|
|
423
|
+
isResolving.value = true;
|
|
424
|
+
}
|
|
425
|
+
try {
|
|
426
|
+
const experiment = await fetchExperiment(id);
|
|
427
|
+
if (token !== selectionToken) return null;
|
|
428
|
+
current.value = experiment;
|
|
429
|
+
return experiment;
|
|
430
|
+
} catch (err) {
|
|
431
|
+
if (token !== selectionToken) return null;
|
|
432
|
+
current.value = null;
|
|
433
|
+
error.value = readErrorMessage(err, "Failed to load experiment");
|
|
434
|
+
return null;
|
|
435
|
+
} finally {
|
|
436
|
+
if (token === selectionToken) isResolving.value = false;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function clear() {
|
|
440
|
+
selectionToken += 1;
|
|
441
|
+
current.value = null;
|
|
442
|
+
currentId.value = null;
|
|
443
|
+
error.value = null;
|
|
444
|
+
isResolving.value = false;
|
|
445
|
+
}
|
|
446
|
+
return {
|
|
447
|
+
current,
|
|
448
|
+
currentId,
|
|
449
|
+
isResolving,
|
|
450
|
+
error,
|
|
451
|
+
select,
|
|
452
|
+
selectById,
|
|
453
|
+
clear
|
|
454
|
+
};
|
|
455
|
+
});
|
|
456
|
+
//#endregion
|
|
457
|
+
export { useApi as a, authenticationRequiredError as i, readErrorMessage as n, useAuthStore as o, AuthenticationRequiredError as r, useExperimentStore as t };
|
|
702
458
|
|
|
703
|
-
//# sourceMappingURL=
|
|
459
|
+
//# sourceMappingURL=experiment-DgllIc3I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment-DgllIc3I.js","names":[],"sources":["../src/stores/auth.ts","../src/composables/useApi.ts","../src/utils/errors.ts","../src/stores/experiment.ts"],"sourcesContent":["import { defineStore } from 'pinia'\nimport { ref, computed } from 'vue'\nimport type { AuthConfig, UserInfo } from '../types'\nimport {\n canAccessAdmin as canUserAccessAdmin,\n canAccessPlugin as canUserAccessPlugin,\n getAccessAudience,\n getUserPermissions,\n hasAllPermissions,\n hasAnyPermission,\n isAdminUser,\n} from '../permissions'\n\nconst AUTH_TOKEN_KEY = 'mint-auth-token'\nconst AUTH_EXPIRES_KEY = 'mint-auth-expires'\n\nfunction getLocalStorage(): Storage | null {\n try {\n const storage = globalThis.localStorage\n return typeof storage?.getItem === 'function' ? storage : null\n } catch {\n return null\n }\n}\n\nfunction readStoredItem(key: string): string | null {\n try {\n return getLocalStorage()?.getItem(key) ?? null\n } catch {\n return null\n }\n}\n\nfunction writeStoredItem(key: string, value: string): void {\n try {\n getLocalStorage()?.setItem(key, value)\n } catch {\n // Keep auth usable in-memory when browser storage is blocked.\n }\n}\n\nfunction removeStoredItem(key: string): void {\n try {\n getLocalStorage()?.removeItem(key)\n } catch {\n // Keep auth cleanup usable in-memory when browser storage is blocked.\n }\n}\n\nexport const useAuthStore = defineStore('mint-auth', () => {\n // State\n const token = ref<string | null>(null)\n const tokenExpires = ref<Date | null>(null)\n const username = ref<string | null>(null)\n const userInfo = ref<UserInfo | null>(null)\n const authConfig = ref<AuthConfig>({\n authRequired: true,\n passkeyEnabled: false,\n passkeyRegistered: false,\n registrationEnabled: false,\n databaseMode: 'none',\n experimentVisibilityMode: 'open',\n })\n const isInitialized = ref(false)\n const isLoading = ref(false)\n const error = ref<string | null>(null)\n\n // Computed\n const isAuthenticated = computed(() => {\n if (!authConfig.value.authRequired) {\n return true\n }\n if (!token.value) {\n return false\n }\n if (tokenExpires.value && tokenExpires.value < new Date()) {\n return false\n }\n return true\n })\n\n const needsAuth = computed(() => {\n return authConfig.value.authRequired && !isAuthenticated.value\n })\n\n const isAdmin = computed(() => isAdminUser(userInfo.value))\n const userType = computed(() => getAccessAudience(userInfo.value))\n const permissions = computed(() => getUserPermissions(userInfo.value))\n const canAccessAdmin = computed(() => canUserAccessAdmin(userInfo.value))\n\n const canRegister = computed(() => {\n return authConfig.value.registrationEnabled\n })\n\n // Actions\n function initialize() {\n const storedToken = readStoredItem(AUTH_TOKEN_KEY)\n const storedExpires = readStoredItem(AUTH_EXPIRES_KEY)\n\n if (storedToken) {\n token.value = storedToken\n\n if (storedExpires) {\n const expires = new Date(storedExpires)\n if (expires > new Date()) {\n tokenExpires.value = expires\n } else {\n clearToken()\n }\n }\n }\n\n isInitialized.value = true\n }\n\n function setToken(accessToken: string, expiresIn: number) {\n token.value = accessToken\n const expires = new Date(Date.now() + expiresIn * 1000)\n tokenExpires.value = expires\n\n writeStoredItem(AUTH_TOKEN_KEY, accessToken)\n writeStoredItem(AUTH_EXPIRES_KEY, expires.toISOString())\n }\n\n function clearToken() {\n token.value = null\n tokenExpires.value = null\n username.value = null\n userInfo.value = null\n\n removeStoredItem(AUTH_TOKEN_KEY)\n removeStoredItem(AUTH_EXPIRES_KEY)\n }\n\n function setUserInfo(info: UserInfo) {\n userInfo.value = info\n username.value = info.username\n }\n\n function hasPermission(...perms: string[]): boolean {\n return hasAllPermissions(userInfo.value, perms)\n }\n\n function hasAnyPermissionForUser(...perms: string[]): boolean {\n return hasAnyPermission(userInfo.value, perms)\n }\n\n function canAccessPlugin(pluginName: string): boolean {\n return canUserAccessPlugin(userInfo.value, pluginName)\n }\n\n function setAuthConfig(config: AuthConfig) {\n authConfig.value = config\n }\n\n function setUsername(name: string) {\n username.value = name\n }\n\n function setError(message: string | null) {\n error.value = message\n }\n\n function setLoading(loading: boolean) {\n isLoading.value = loading\n }\n\n function logout() {\n clearToken()\n }\n\n return {\n // State\n token,\n tokenExpires,\n username,\n userInfo,\n authConfig,\n isInitialized,\n isLoading,\n error,\n\n // Computed\n isAuthenticated,\n needsAuth,\n isAdmin,\n userType,\n permissions,\n canAccessAdmin,\n canRegister,\n\n // Actions\n initialize,\n setToken,\n clearToken,\n setAuthConfig,\n setUsername,\n setUserInfo,\n setError,\n setLoading,\n hasPermission,\n hasAnyPermission: hasAnyPermissionForUser,\n canAccessPlugin,\n logout,\n }\n})\n","import axios, { type AxiosInstance, type AxiosRequestConfig, type InternalAxiosRequestConfig } from 'axios'\nimport { useSettingsStore } from '../stores/settings'\nimport { useAuthStore } from '../stores/auth'\nimport { MintApiError, mintApiErrorFromResponse } from '../apiErrors'\n\nlet apiClientInstance: AxiosInstance | null = null\nlet interceptorAttached = false\n\ninterface MintAxiosRequestConfig extends AxiosRequestConfig {\n _mintSkipAuth?: boolean\n _mintAuthToken?: string\n _mintTypedErrors?: boolean\n}\n\ninterface MintInternalAxiosRequestConfig extends InternalAxiosRequestConfig {\n _mintSkipAuth?: boolean\n _mintAuthToken?: string\n _mintTypedErrors?: boolean\n}\n\ntype MutableHeaders = Record<string, unknown> & {\n has?: (header: string) => boolean\n set?: (header: string, value: string) => void\n delete?: (header: string) => void\n}\n\nfunction joinUrlPath(baseUrl: string, path: string): string {\n if (/^https?:\\/\\//i.test(path)) return path\n if (!path) return baseUrl\n if (path.startsWith('?') || path.startsWith('#')) return `${baseUrl.replace(/\\/+$/, '')}${path}`\n const normalizedBase = baseUrl.replace(/\\/+$/, '')\n const normalizedPath = path.replace(/^\\/+/, '/')\n return `${normalizedBase}${normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`}`\n}\n\nfunction getBasePath(baseUrl: string): string {\n if (!baseUrl) return '/'\n\n try {\n const origin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost'\n return new URL(baseUrl, origin).pathname.replace(/\\/+$/, '') || '/'\n } catch {\n const path = baseUrl.replace(/^https?:\\/\\/[^/]+/i, '')\n return path.replace(/\\/+$/, '') || '/'\n }\n}\n\nfunction normalizeRequestUrl(baseUrl: string, url: string): string {\n if (!url || /^https?:\\/\\//.test(url)) return url\n\n const basePath = getBasePath(baseUrl)\n if (basePath === '/') return url\n\n const normalizedUrl = url.startsWith('/') ? url : `/${url}`\n if (\n normalizedUrl === basePath\n || normalizedUrl.startsWith(`${basePath}?`)\n || normalizedUrl.startsWith(`${basePath}#`)\n ) {\n return normalizedUrl.slice(basePath.length)\n }\n if (normalizedUrl.startsWith(`${basePath}/`)) {\n return normalizedUrl.slice(basePath.length) || ''\n }\n return url\n}\n\nfunction asMutableHeaders(headers: AxiosRequestConfig['headers']): MutableHeaders | null {\n return headers ? (headers as MutableHeaders) : null\n}\n\nfunction hasAuthorizationHeader(headers: AxiosRequestConfig['headers']): boolean {\n const bag = asMutableHeaders(headers)\n if (!bag) return false\n if (typeof bag.has === 'function') return bag.has('Authorization')\n return Object.keys(bag).some((key) => key.toLowerCase() === 'authorization')\n}\n\nfunction setAuthorizationHeader(headers: AxiosRequestConfig['headers'], value: string): void {\n const bag = asMutableHeaders(headers)\n if (!bag) return\n if (typeof bag.set === 'function') {\n bag.set('Authorization', value)\n return\n }\n bag.Authorization = value\n}\n\nfunction deleteAuthorizationHeader(headers: AxiosRequestConfig['headers']): void {\n const bag = asMutableHeaders(headers)\n if (!bag) return\n if (typeof bag.delete === 'function') {\n bag.delete('Authorization')\n return\n }\n for (const key of Object.keys(bag)) {\n if (key.toLowerCase() === 'authorization') delete bag[key]\n }\n}\n\nfunction getAuthorizationHeader(headers: AxiosRequestConfig['headers']): unknown {\n const bag = asMutableHeaders(headers) as (MutableHeaders & { get?: (header: string) => unknown }) | null\n if (!bag) return undefined\n if (typeof bag.get === 'function') return bag.get('Authorization')\n const key = Object.keys(bag).find((candidate) => candidate.toLowerCase() === 'authorization')\n return key ? bag[key] : undefined\n}\n\n/**\n * Raised when an authenticated SDK request is rejected because the login is no\n * longer valid. It is also a `MintApiError` (status 401), so typed-error callers\n * and `instanceof AuthenticationRequiredError` callers both recognise it.\n */\nexport class AuthenticationRequiredError extends MintApiError {\n override readonly name: string = 'AuthenticationRequiredError'\n declare readonly code: 'AUTHENTICATION_REQUIRED'\n declare readonly status: 401\n\n constructor(cause?: unknown, envelope?: MintApiError) {\n super(\n 'Authentication required. Please sign in again.',\n 'AUTHENTICATION_REQUIRED',\n 401,\n envelope?.requestId ?? null,\n envelope?.details ?? null,\n envelope?.detail,\n envelope?.body ?? null,\n cause,\n )\n }\n}\n\n/** @internal Convert a rejected authenticated request into the SDK's public auth error. */\nexport function authenticationRequiredError(\n cause: unknown,\n rejectedToken?: string,\n envelope?: MintApiError,\n): AuthenticationRequiredError {\n const currentAuthStore = useAuthStore()\n if (rejectedToken && currentAuthStore.token === rejectedToken) {\n currentAuthStore.clearToken()\n }\n return new AuthenticationRequiredError(cause, envelope)\n}\n\nfunction getApiClient(): AxiosInstance {\n if (!apiClientInstance) {\n apiClientInstance = axios.create({\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n }\n return apiClientInstance\n}\n\nexport interface ApiClientOptions {\n baseUrl?: string\n timeout?: number\n withAuth?: boolean\n /** Normalize failed responses into MintApiError. Generated clients enable this by default. */\n typedErrors?: boolean\n}\n\nexport interface UseApiReturn {\n client: AxiosInstance\n get: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>\n post: <T>(url: string, data?: unknown, config?: AxiosRequestConfig) => Promise<T>\n put: <T>(url: string, data?: unknown, config?: AxiosRequestConfig) => Promise<T>\n patch: <T>(url: string, data?: unknown, config?: AxiosRequestConfig) => Promise<T>\n delete: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>\n upload: <T>(url: string, file: File, fieldName?: string, additionalData?: Record<string, unknown>) => Promise<T>\n download: (url: string, filename?: string) => Promise<string>\n buildUrl: (path: string) => string\n buildWsUrl: (path: string) => string\n}\n\n/** Axios-based API client that injects the plugin base URL and JWT auth header on every request. */\nexport function useApi(options: ApiClientOptions = {}): UseApiReturn {\n const settingsStore = useSettingsStore()\n const authStore = useAuthStore()\n const apiClient = getApiClient()\n\n // Ensure auth store is initialized (reads token from localStorage)\n if (!authStore.isInitialized) {\n authStore.initialize()\n }\n\n // Attach auth interceptor only once (reads token dynamically, not from closure)\n if (!interceptorAttached) {\n apiClient.interceptors.request.use((config) => {\n const request = config as MintInternalAxiosRequestConfig\n if (request._mintSkipAuth) {\n deleteAuthorizationHeader(request.headers)\n return request\n }\n\n const currentAuthStore = useAuthStore()\n if (currentAuthStore.token && config.headers && !hasAuthorizationHeader(config.headers)) {\n setAuthorizationHeader(config.headers, `Bearer ${currentAuthStore.token}`)\n }\n if (getAuthorizationHeader(config.headers) === `Bearer ${currentAuthStore.token}`) {\n request._mintAuthToken = currentAuthStore.token ?? undefined\n }\n return config\n })\n apiClient.interceptors.response.use(\n (response) => response,\n async (error: unknown) => {\n if (axios.isAxiosError(error) && error.response) {\n const request = error.config as MintInternalAxiosRequestConfig | undefined\n if (request?._mintTypedErrors) {\n let payload: unknown = error.response.data\n if (payload instanceof Blob) {\n try {\n payload = JSON.parse(await payload.text())\n } catch {\n // Keep non-JSON download errors available as the original body.\n }\n }\n const typed = mintApiErrorFromResponse(\n error.response.status,\n payload,\n {\n requestId: String(error.response.headers?.['x-request-id'] ?? '') || null,\n cause: error,\n },\n )\n if (error.response.status === 401 && request._mintSkipAuth !== true) {\n return Promise.reject(authenticationRequiredError(error, request._mintAuthToken, typed))\n }\n return Promise.reject(typed)\n }\n if (error.response.status === 401) {\n if (request?._mintSkipAuth !== true) {\n return Promise.reject(authenticationRequiredError(error, request?._mintAuthToken))\n }\n }\n }\n return Promise.reject(error)\n },\n )\n interceptorAttached = true\n }\n\n function getBaseUrl(): string {\n return options.baseUrl ?? settingsStore.getApiBaseUrl()\n }\n\n function normalizeUrl(url: string): string {\n return normalizeRequestUrl(getBaseUrl(), url)\n }\n\n // Build per-request config that applies this caller's options\n function requestConfig(config?: AxiosRequestConfig): MintAxiosRequestConfig {\n const base: MintAxiosRequestConfig = {\n baseURL: getBaseUrl(),\n timeout: options.timeout ?? settingsStore.requestTimeout,\n _mintTypedErrors: options.typedErrors,\n ...config,\n }\n // Strip auth header if explicitly disabled\n if (options.withAuth === false) {\n base._mintSkipAuth = true\n deleteAuthorizationHeader(base.headers)\n }\n return base\n }\n\n // Generic request methods\n async function get<T>(url: string, config?: AxiosRequestConfig): Promise<T> {\n const response = await apiClient.get<T>(normalizeUrl(url), requestConfig(config))\n return response.data\n }\n\n async function post<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T> {\n const response = await apiClient.post<T>(normalizeUrl(url), data, requestConfig(config))\n return response.data\n }\n\n async function put<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T> {\n const response = await apiClient.put<T>(normalizeUrl(url), data, requestConfig(config))\n return response.data\n }\n\n async function patch<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T> {\n const response = await apiClient.patch<T>(normalizeUrl(url), data, requestConfig(config))\n return response.data\n }\n\n async function del<T>(url: string, config?: AxiosRequestConfig): Promise<T> {\n const response = await apiClient.delete<T>(normalizeUrl(url), requestConfig(config))\n return response.data\n }\n\n // File upload helper\n async function upload<T>(url: string, file: File, fieldName = 'file', additionalData?: Record<string, unknown>): Promise<T> {\n const formData = new FormData()\n formData.append(fieldName, file)\n\n if (additionalData) {\n Object.entries(additionalData).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n formData.append(key, typeof value === 'object' ? JSON.stringify(value) : String(value))\n }\n })\n }\n\n const response = await apiClient.post<T>(normalizeUrl(url), formData, requestConfig({\n // Let Axios set Content-Type with the correct multipart boundary\n headers: { 'Content-Type': undefined },\n }))\n return response.data\n }\n\n // Download helper - returns blob URL\n async function download(url: string, filename?: string): Promise<string> {\n const response = await apiClient.get(normalizeUrl(url), requestConfig({ responseType: 'blob' }))\n const blob = new Blob([response.data])\n const blobUrl = URL.createObjectURL(blob)\n\n // Optionally trigger download\n if (filename) {\n const link = document.createElement('a')\n link.href = blobUrl\n link.download = filename\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n // Revoke after a short delay to allow download to start;\n // return empty string since the URL will be invalidated\n setTimeout(() => URL.revokeObjectURL(blobUrl), 100)\n return ''\n }\n\n // Caller is responsible for revoking when no filename is provided\n return blobUrl\n }\n\n // Build full URL for external use (e.g., <a href=\"...\">)\n function buildUrl(path: string): string {\n const baseUrl = getBaseUrl()\n return joinUrlPath(baseUrl, normalizeRequestUrl(baseUrl, path))\n }\n\n // WebSocket URL builder\n function buildWsUrl(path: string): string {\n return joinUrlPath(settingsStore.getWsBaseUrl(), path)\n }\n\n return {\n client: apiClient,\n get,\n post,\n put,\n patch,\n delete: del,\n upload,\n download,\n buildUrl,\n buildWsUrl,\n }\n}\n","/**\n * The one place a thrown value is turned into a developer-facing message.\n *\n * Five copies of this logic drifted apart across the composables and stores\n * (some checked a bare `{ message }` object, some did not); this export is the\n * union of what they all accepted, so every caller now reads the same message\n * from the same value.\n */\nexport function readErrorMessage(value: unknown, fallback = 'Request failed.'): string {\n if (value instanceof Error && value.message) {\n return value.message\n }\n\n if (typeof value === 'string' && value.trim()) {\n return value\n }\n\n if (\n typeof value === 'object'\n && value !== null\n && 'message' in value\n && typeof (value as { message?: unknown }).message === 'string'\n && (value as { message: string }).message.trim()\n ) {\n return (value as { message: string }).message\n }\n\n return fallback\n}\n","import { defineStore } from 'pinia'\nimport { ref } from 'vue'\nimport { useApi } from '../composables/useApi'\nimport { readErrorMessage } from '../utils/errors'\nimport type { ExperimentSummary, PlatformContext } from '../types'\n\nfunction getPlatformApiUrl(): string | undefined {\n if (typeof window === 'undefined') return undefined\n return (window as unknown as { __MINT_PLATFORM__?: PlatformContext }).__MINT_PLATFORM__\n ?.platformApiUrl\n}\n\n/**\n * The single source of truth for the experiment a plugin is currently working on.\n *\n * Both entry points land here: `ExperimentSelectorModal` calls `select()` with a\n * record the platform already returned, and deep links call `selectById()` with\n * nothing but an id. Because a name can only ever arrive from the platform,\n * there is no code path in which a caller can invent one.\n */\nexport const useExperimentStore = defineStore('mint-experiment', () => {\n const current = ref<ExperimentSummary | null>(null)\n const currentId = ref<number | null>(null)\n const isResolving = ref(false)\n const error = ref<string | null>(null)\n\n // In-flight requests only. Resolved records are deliberately not memoised, so\n // a rename is picked up on the next resolve instead of persisting for the\n // lifetime of the page.\n const inFlight = new Map<number, Promise<ExperimentSummary>>()\n\n // Monotonic token guarding every write to the shared selection. Responses can\n // land in any order, and a late one must never overwrite a newer choice —\n // that would display a name belonging to a different experiment, which is the\n // failure this store exists to prevent.\n let selectionToken = 0\n\n function fetchExperiment(id: number): Promise<ExperimentSummary> {\n const pending = inFlight.get(id)\n if (pending) return pending\n\n const base = getPlatformApiUrl() ?? ''\n const request = useApi()\n .get<ExperimentSummary>(`${base}/experiments/${id}`)\n .finally(() => {\n inFlight.delete(id)\n })\n\n inFlight.set(id, request)\n return request\n }\n\n /** Adopt a record the platform already returned, without a further request. */\n function select(experiment: ExperimentSummary): void {\n selectionToken += 1\n current.value = experiment\n currentId.value = experiment.id\n error.value = null\n isResolving.value = false\n }\n\n /**\n * Bind to an experiment known only by id, resolving its record from the\n * platform. On failure the binding is remembered but `current` stays null, so\n * callers can distinguish \"not resolved yet\" from \"nothing selected\".\n */\n async function selectById(id: number): Promise<ExperimentSummary | null> {\n const joinsCurrentResolution = isResolving.value && currentId.value === id\n const token = joinsCurrentResolution ? selectionToken : (selectionToken += 1)\n if (!joinsCurrentResolution) {\n current.value = null\n currentId.value = id\n error.value = null\n isResolving.value = true\n }\n try {\n const experiment = await fetchExperiment(id)\n // A newer selection superseded this one while the request was in flight.\n // Returning null tells the caller its result is no longer the selection,\n // so it cannot be applied downstream either.\n if (token !== selectionToken) return null\n current.value = experiment\n return experiment\n } catch (err) {\n if (token !== selectionToken) return null\n current.value = null\n error.value = readErrorMessage(err, 'Failed to load experiment')\n return null\n } finally {\n // Only the newest request owns the loading flag; otherwise a superseded\n // response would clear it while the current one is still pending.\n if (token === selectionToken) isResolving.value = false\n }\n }\n\n function clear(): void {\n // Supersede any in-flight resolve so a detached experiment cannot be\n // repopulated by a response that was already on its way.\n selectionToken += 1\n current.value = null\n currentId.value = null\n error.value = null\n isResolving.value = false\n }\n\n return {\n current,\n currentId,\n isResolving,\n error,\n select,\n selectById,\n clear,\n }\n})\n"],"mappings":";;;;;;AAaA,IAAM,iBAAiB;AACvB,IAAM,mBAAmB;AAEzB,SAAS,kBAAkC;CACzC,IAAI;EACF,MAAM,UAAU,WAAW;EAC3B,OAAO,OAAO,SAAS,YAAY,aAAa,UAAU;CAC5D,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,eAAe,KAA4B;CAClD,IAAI;EACF,OA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