@trops/dash-core 0.1.518 → 0.1.520

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.js CHANGED
@@ -49347,6 +49347,12 @@ var PrivacySecurityList = function PrivacySecurityList(_ref) {
49347
49347
  var keyFor = function keyFor(group) {
49348
49348
  return group.packageId == null ? "__ungrouped__" : group.packageId;
49349
49349
  };
49350
+
49351
+ // Special selection keys for the two non-package items at the top
49352
+ // of the list. Keep them in the same selection state as packages so
49353
+ // the right panel knows what to render via a single key.
49354
+ var SETTINGS_KEY = "__settings__";
49355
+ var HELP_KEY = "__help__";
49350
49356
  function renderPackageItem(group) {
49351
49357
  var key = keyFor(group);
49352
49358
  var isSelected = selectedPackageKey === key;
@@ -49395,7 +49401,32 @@ var PrivacySecurityList = function PrivacySecurityList(_ref) {
49395
49401
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
49396
49402
  className: "flex-1 overflow-y-auto min-h-0",
49397
49403
  children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Sidebar.Content, {
49398
- children: [viewMode === "grouped" ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
49404
+ children: [/*#__PURE__*/jsxRuntime.jsxs(DashReact.Sidebar.Group, {
49405
+ label: "Configuration",
49406
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
49407
+ icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
49408
+ icon: "gear",
49409
+ className: "h-3.5 w-3.5"
49410
+ }),
49411
+ active: selectedPackageKey === SETTINGS_KEY,
49412
+ onClick: function onClick() {
49413
+ return onSelectPackage(SETTINGS_KEY);
49414
+ },
49415
+ className: selectedPackageKey === SETTINGS_KEY ? "bg-white/10 opacity-100" : "",
49416
+ children: "Settings"
49417
+ }, SETTINGS_KEY), /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
49418
+ icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
49419
+ icon: "circle-question",
49420
+ className: "h-3.5 w-3.5"
49421
+ }),
49422
+ active: selectedPackageKey === HELP_KEY,
49423
+ onClick: function onClick() {
49424
+ return onSelectPackage(HELP_KEY);
49425
+ },
49426
+ className: selectedPackageKey === HELP_KEY ? "bg-white/10 opacity-100" : "",
49427
+ children: "Help"
49428
+ }, HELP_KEY)]
49429
+ }), viewMode === "grouped" ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
49399
49430
  children: [withGrants.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Group, {
49400
49431
  label: "Has grants",
49401
49432
  children: withGrants.map(renderPackageItem)
@@ -49403,7 +49434,10 @@ var PrivacySecurityList = function PrivacySecurityList(_ref) {
49403
49434
  label: "No grants",
49404
49435
  children: withoutGrants.map(renderPackageItem)
49405
49436
  })]
49406
- }) : filtered.map(renderPackageItem), filtered.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
49437
+ }) : /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Group, {
49438
+ label: "Packages",
49439
+ children: filtered.map(renderPackageItem)
49440
+ }), filtered.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
49407
49441
  className: "text-sm opacity-40 py-8 text-center block",
49408
49442
  children: searchQuery ? "No packages match your search" : "No widgets installed"
49409
49443
  })]
@@ -49737,18 +49771,15 @@ var PrivacySecuritySection = function PrivacySecuritySection() {
49737
49771
  _useState12 = _slicedToArray(_useState11, 2),
49738
49772
  viewMode = _useState12[0],
49739
49773
  setViewMode = _useState12[1];
49740
- var _useState13 = React.useState(null),
49774
+ // Default to the Settings sidebar item so first-time visitors land
49775
+ // on something useful rather than the empty-detail placeholder.
49776
+ // "__settings__"/"__help__" are special selection keys (see
49777
+ // PrivacySecurityList); a string starting without "__" is a
49778
+ // packageId.
49779
+ var _useState13 = React.useState("__settings__"),
49741
49780
  _useState14 = _slicedToArray(_useState13, 2),
49742
49781
  selectedPackageKey = _useState14[0],
49743
49782
  setSelectedPackageKey = _useState14[1];
49744
- // Two top-level tabs so the inline `HowThisWorksPanel` (which carries
49745
- // example fixtures and is intentionally tall) doesn't push the
49746
- // package list/detail below the viewport. "permissions" is the
49747
- // default and contains the actual UI users came here to use.
49748
- var _useState15 = React.useState("permissions"),
49749
- _useState16 = _slicedToArray(_useState15, 2),
49750
- activeTab = _useState16[0],
49751
- setActiveTab = _useState16[1];
49752
49783
  var reload = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
49753
49784
  var _api$widgetMcp, api, result, _t;
49754
49785
  return _regeneratorRuntime.wrap(function (_context) {
@@ -49946,7 +49977,9 @@ var PrivacySecuritySection = function PrivacySecuritySection() {
49946
49977
  });
49947
49978
  }
49948
49979
  var packageGroups = groupRowsByPackage(rows);
49949
- var selectedGroup = selectedPackageKey == null ? null : packageGroups.find(function (g) {
49980
+ var isSettingsSelected = selectedPackageKey === "__settings__";
49981
+ var isHelpSelected = selectedPackageKey === "__help__";
49982
+ var selectedGroup = selectedPackageKey == null || isSettingsSelected || isHelpSelected ? null : packageGroups.find(function (g) {
49950
49983
  return g.packageId == null ? selectedPackageKey === "__ungrouped__" : g.packageId === selectedPackageKey;
49951
49984
  }) || null;
49952
49985
  var listContent = /*#__PURE__*/jsxRuntime.jsx(PrivacySecurityList, {
@@ -49958,60 +49991,53 @@ var PrivacySecuritySection = function PrivacySecuritySection() {
49958
49991
  viewMode: viewMode,
49959
49992
  onViewModeChange: setViewMode
49960
49993
  });
49961
- var detailContent = selectedGroup ? /*#__PURE__*/jsxRuntime.jsx(WidgetPackageDetail, {
49962
- packageGroup: selectedGroup,
49963
- onRevokeWidget: revokeWidget,
49964
- onRevokeServer: revokeServer,
49965
- onGrantManually: function onGrantManually(widgetId) {
49966
- return setManualGrantWidgetId(widgetId);
49967
- },
49968
- onRevokePackage: revokePackage
49969
- }) : null;
49994
+
49995
+ // Detail panel content varies by what the user picked in the
49996
+ // sidebar — Settings shows the toggles, Help shows the how-it-
49997
+ // works panel, a package shows its widgets. Wrapping each non-
49998
+ // package case in a scrollable container so long content (like
49999
+ // the help fixtures) stays inside the panel and doesn't push the
50000
+ // sidebar around.
50001
+ var detailContent = null;
50002
+ if (isSettingsSelected) {
50003
+ detailContent = /*#__PURE__*/jsxRuntime.jsx("div", {
50004
+ className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6",
50005
+ children: /*#__PURE__*/jsxRuntime.jsx(EnforcementToggles, {})
50006
+ });
50007
+ } else if (isHelpSelected) {
50008
+ detailContent = /*#__PURE__*/jsxRuntime.jsx("div", {
50009
+ className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6",
50010
+ children: /*#__PURE__*/jsxRuntime.jsx(HowThisWorksPanel, {})
50011
+ });
50012
+ } else if (selectedGroup) {
50013
+ detailContent = /*#__PURE__*/jsxRuntime.jsx(WidgetPackageDetail, {
50014
+ packageGroup: selectedGroup,
50015
+ onRevokeWidget: revokeWidget,
50016
+ onRevokeServer: revokeServer,
50017
+ onGrantManually: function onGrantManually(widgetId) {
50018
+ return setManualGrantWidgetId(widgetId);
50019
+ },
50020
+ onRevokePackage: revokePackage
50021
+ });
50022
+ }
49970
50023
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
49971
50024
  className: "flex flex-col flex-1 min-h-0",
49972
50025
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
49973
- className: "flex-shrink-0 flex flex-col space-y-3 px-6 pt-6 pb-3 border-b border-gray-800",
49974
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
49975
- className: "flex flex-col space-y-2",
49976
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
49977
- title: "Widget MCP permissions",
49978
- padding: false
49979
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
49980
- className: "text-xs opacity-60",
49981
- children: "Granting access here is a trust signal about the widget \u2014 not a per-dashboard switch."
49982
- })]
49983
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3, {
49984
- value: activeTab,
49985
- onValueChange: setActiveTab,
49986
- backgroundColor: "bg-transparent",
49987
- spacing: "p-0",
49988
- children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Tabs3.List, {
49989
- spacing: "p-0.5",
49990
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
49991
- value: "permissions",
49992
- children: "Permissions"
49993
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
49994
- value: "help",
49995
- children: "Help"
49996
- })]
49997
- })
50026
+ className: "flex-shrink-0 flex flex-col space-y-2 px-6 pt-6 pb-3 border-b border-gray-800",
50027
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
50028
+ title: "Widget MCP permissions",
50029
+ padding: false
50030
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
50031
+ className: "text-xs opacity-60",
50032
+ children: "Granting access here is a trust signal about the widget \u2014 not a per-dashboard switch."
49998
50033
  }), error && /*#__PURE__*/jsxRuntime.jsx("div", {
49999
50034
  className: "text-xs text-red-400 bg-red-900 bg-opacity-20 border border-red-700 rounded p-3",
50000
50035
  children: error
50001
50036
  })]
50002
- }), activeTab === "permissions" ? /*#__PURE__*/jsxRuntime.jsxs("div", {
50003
- className: "flex flex-col flex-1 min-h-0",
50004
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
50005
- className: "flex-shrink-0 px-6 py-4 border-b border-gray-800",
50006
- children: /*#__PURE__*/jsxRuntime.jsx(EnforcementToggles, {})
50007
- }), /*#__PURE__*/jsxRuntime.jsx(SectionLayout, {
50008
- listContent: listContent,
50009
- detailContent: detailContent,
50010
- emptyDetailMessage: "Select a package to view its grants"
50011
- })]
50012
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
50013
- className: "flex-1 overflow-y-auto p-6",
50014
- children: /*#__PURE__*/jsxRuntime.jsx(HowThisWorksPanel, {})
50037
+ }), /*#__PURE__*/jsxRuntime.jsx(SectionLayout, {
50038
+ listContent: listContent,
50039
+ detailContent: detailContent,
50040
+ emptyDetailMessage: "Select an item from the sidebar"
50015
50041
  }), /*#__PURE__*/jsxRuntime.jsx(GrantManuallyModal, {
50016
50042
  isOpen: !!manualGrantWidgetId,
50017
50043
  setIsOpen: function setIsOpen(open) {
@@ -50048,19 +50074,19 @@ var EnforcementToggles = function EnforcementToggles() {
50048
50074
  // pendingDisable: { flag: 'enforce' | 'jit' } | null
50049
50075
  // When the user toggles a flag from ON → OFF, we open a confirm modal
50050
50076
  // before persisting. ON → ON or OFF → ON go through immediately.
50051
- var _useState17 = React.useState(null),
50052
- _useState18 = _slicedToArray(_useState17, 2),
50053
- pendingDisable = _useState18[0],
50054
- setPendingDisable = _useState18[1];
50077
+ var _useState15 = React.useState(null),
50078
+ _useState16 = _slicedToArray(_useState15, 2),
50079
+ pendingDisable = _useState16[0],
50080
+ setPendingDisable = _useState16[1];
50055
50081
 
50056
50082
  // lastTestResult: feedback for the "Test prompt" button. Tells the
50057
50083
  // user whether their JIT response was actually persisted, so they
50058
50084
  // don't have to interpret the post-grant "server not connected"
50059
50085
  // error as failure.
50060
- var _useState19 = React.useState(null),
50061
- _useState20 = _slicedToArray(_useState19, 2),
50062
- lastTestResult = _useState20[0],
50063
- setLastTestResult = _useState20[1];
50086
+ var _useState17 = React.useState(null),
50087
+ _useState18 = _slicedToArray(_useState17, 2),
50088
+ lastTestResult = _useState18[0],
50089
+ setLastTestResult = _useState18[1];
50064
50090
 
50065
50091
  // Auto-clear the test result after 30 seconds so it doesn't linger
50066
50092
  // forever after a successful test.
@@ -50461,10 +50487,10 @@ var noop = function noop() {};
50461
50487
  * users who don't want the wall of text collapse manually.
50462
50488
  */
50463
50489
  var HowThisWorksPanel = function HowThisWorksPanel() {
50464
- var _useState21 = React.useState(true),
50465
- _useState22 = _slicedToArray(_useState21, 2),
50466
- open = _useState22[0],
50467
- setOpen = _useState22[1];
50490
+ var _useState19 = React.useState(true),
50491
+ _useState20 = _slicedToArray(_useState19, 2),
50492
+ open = _useState20[0],
50493
+ setOpen = _useState20[1];
50468
50494
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
50469
50495
  className: "border border-gray-700 rounded",
50470
50496
  children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
@@ -50827,7 +50853,7 @@ var AppSettingsModal = function AppSettingsModal(_ref) {
50827
50853
  className: "flex-1 overflow-y-auto p-6 ".concat(panelStyles.textColor || "text-gray-200"),
50828
50854
  children: /*#__PURE__*/jsxRuntime.jsx(AiAssistantSection, {})
50829
50855
  }), activeSection === "privacy-security" && /*#__PURE__*/jsxRuntime.jsx("div", {
50830
- className: "flex-1 overflow-y-auto ".concat(panelStyles.textColor || "text-gray-200"),
50856
+ className: "flex-1 flex flex-col min-h-0 ".concat(panelStyles.textColor || "text-gray-200"),
50831
50857
  children: /*#__PURE__*/jsxRuntime.jsx(PrivacySecuritySection, {})
50832
50858
  })]
50833
50859
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.SettingsModal.Footer, {