@trops/dash-core 0.1.57 → 0.1.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -7195,6 +7195,38 @@ var ProviderForm = function ProviderForm(_ref) {
7195
7195
  },
7196
7196
  placeholder: "Enter ".concat(fieldConfig.displayName.toLowerCase()),
7197
7197
  className: errors[fieldName] ? "border-red-500" : ""
7198
+ }), fieldConfig.type === "file" && /*#__PURE__*/jsxs("div", {
7199
+ className: "flex gap-2",
7200
+ children: [/*#__PURE__*/jsx("div", {
7201
+ className: "flex-1",
7202
+ children: /*#__PURE__*/jsx(InputText, {
7203
+ value: formData[fieldName] || "",
7204
+ onChange: function onChange(value) {
7205
+ return handleInputChange(fieldName, value);
7206
+ },
7207
+ placeholder: "Select a file...",
7208
+ className: errors[fieldName] ? "border-red-500" : ""
7209
+ })
7210
+ }), /*#__PURE__*/jsx("button", {
7211
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
7212
+ var filepath;
7213
+ return _regeneratorRuntime.wrap(function (_context) {
7214
+ while (1) switch (_context.prev = _context.next) {
7215
+ case 0:
7216
+ _context.next = 1;
7217
+ return window.mainApi.dialog.chooseFile(true, ["json"]);
7218
+ case 1:
7219
+ filepath = _context.sent;
7220
+ if (filepath) handleInputChange(fieldName, filepath);
7221
+ case 2:
7222
+ case "end":
7223
+ return _context.stop();
7224
+ }
7225
+ }, _callee);
7226
+ })),
7227
+ className: "px-3 py-1.5 text-sm rounded bg-white/10 hover:bg-white/20 transition-colors",
7228
+ children: "Browse"
7229
+ })]
7198
7230
  }), errors[fieldName] && /*#__PURE__*/jsx("p", {
7199
7231
  className: "text-sm text-red-500 dark:text-red-400",
7200
7232
  children: errors[fieldName]
@@ -26553,6 +26585,10 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
26553
26585
  isEditMode = _ref2$isEditMode === void 0 ? false : _ref2$isEditMode,
26554
26586
  _ref2$initialName = _ref2.initialName,
26555
26587
  initialName = _ref2$initialName === void 0 ? "" : _ref2$initialName,
26588
+ _ref2$initialProvider = _ref2.initialProviderType,
26589
+ initialProviderType = _ref2$initialProvider === void 0 ? "custom" : _ref2$initialProvider,
26590
+ _ref2$initialCredenti = _ref2.initialCredentialSchema,
26591
+ initialCredentialSchema = _ref2$initialCredenti === void 0 ? {} : _ref2$initialCredenti,
26556
26592
  _ref2$initialTranspor = _ref2.initialTransport,
26557
26593
  initialTransport = _ref2$initialTranspor === void 0 ? "stdio" : _ref2$initialTranspor,
26558
26594
  _ref2$initialCommand = _ref2.initialCommand,
@@ -26565,8 +26601,8 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
26565
26601
  initialUrl = _ref2$initialUrl === void 0 ? "" : _ref2$initialUrl,
26566
26602
  _ref2$initialHeaderRo = _ref2.initialHeaderRows,
26567
26603
  initialHeaderRows = _ref2$initialHeaderRo === void 0 ? [] : _ref2$initialHeaderRo,
26568
- _ref2$initialCredenti = _ref2.initialCredentials,
26569
- initialCredentials = _ref2$initialCredenti === void 0 ? {} : _ref2$initialCredenti;
26604
+ _ref2$initialCredenti2 = _ref2.initialCredentials,
26605
+ initialCredentials = _ref2$initialCredenti2 === void 0 ? {} : _ref2$initialCredenti2;
26570
26606
  var appContext = useContext(AppContext);
26571
26607
  var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
26572
26608
 
@@ -26658,8 +26694,8 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
26658
26694
 
26659
26695
  // Derive credential fields from the live mcpConfig
26660
26696
  var formFields = useMemo(function () {
26661
- return deriveFormFields(mcpConfig, {});
26662
- }, [mcpConfig]);
26697
+ return deriveFormFields(mcpConfig, initialCredentialSchema);
26698
+ }, [mcpConfig, initialCredentialSchema]);
26663
26699
 
26664
26700
  // --- envMapping row handlers ---
26665
26701
  var addEnvRow = function addEnvRow() {
@@ -26835,11 +26871,11 @@ var CustomMcpServerForm = function CustomMcpServerForm(_ref2) {
26835
26871
  url: result.url,
26836
26872
  headerRows: result.headerRows
26837
26873
  });
26838
- onSave(name, "custom", result.credentialData, config);
26874
+ onSave(name, initialProviderType, result.credentialData, config);
26839
26875
  return;
26840
26876
  }
26841
26877
  if (!validateForm()) return;
26842
- onSave(providerName.trim(), "custom", credentialData, mcpConfig);
26878
+ onSave(providerName.trim(), initialProviderType, credentialData, mcpConfig);
26843
26879
  };
26844
26880
  return /*#__PURE__*/jsxs("div", {
26845
26881
  className: "flex flex-col flex-1 min-h-0",
@@ -28130,9 +28166,14 @@ var ProvidersSection = function ProvidersSection(_ref) {
28130
28166
  });
28131
28167
  } else if (isEditingMcp && selectedName && selectedProvider) {
28132
28168
  var mc = selectedProvider.mcpConfig || {};
28169
+ var editCatalogEntry = catalog.find(function (entry) {
28170
+ return entry.id === selectedProvider.type;
28171
+ });
28133
28172
  detailContent = /*#__PURE__*/jsx(CustomMcpServerForm, {
28134
28173
  isEditMode: true,
28135
28174
  initialName: selectedName,
28175
+ initialProviderType: selectedProvider.type || "custom",
28176
+ initialCredentialSchema: (editCatalogEntry === null || editCatalogEntry === void 0 ? void 0 : editCatalogEntry.credentialSchema) || {},
28136
28177
  initialTransport: mc.transport || "stdio",
28137
28178
  initialCommand: mc.command || "",
28138
28179
  initialArgs: (mc.args || []).join(" "),