@trops/dash-core 0.1.518 → 0.1.519

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
@@ -49329,6 +49329,12 @@ var PrivacySecurityList = function PrivacySecurityList(_ref) {
49329
49329
  var keyFor = function keyFor(group) {
49330
49330
  return group.packageId == null ? "__ungrouped__" : group.packageId;
49331
49331
  };
49332
+
49333
+ // Special selection keys for the two non-package items at the top
49334
+ // of the list. Keep them in the same selection state as packages so
49335
+ // the right panel knows what to render via a single key.
49336
+ var SETTINGS_KEY = "__settings__";
49337
+ var HELP_KEY = "__help__";
49332
49338
  function renderPackageItem(group) {
49333
49339
  var key = keyFor(group);
49334
49340
  var isSelected = selectedPackageKey === key;
@@ -49377,7 +49383,32 @@ var PrivacySecurityList = function PrivacySecurityList(_ref) {
49377
49383
  }), /*#__PURE__*/jsx("div", {
49378
49384
  className: "flex-1 overflow-y-auto min-h-0",
49379
49385
  children: /*#__PURE__*/jsxs(Sidebar.Content, {
49380
- children: [viewMode === "grouped" ? /*#__PURE__*/jsxs(Fragment, {
49386
+ children: [/*#__PURE__*/jsxs(Sidebar.Group, {
49387
+ label: "Configuration",
49388
+ children: [/*#__PURE__*/jsx(Sidebar.Item, {
49389
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
49390
+ icon: "gear",
49391
+ className: "h-3.5 w-3.5"
49392
+ }),
49393
+ active: selectedPackageKey === SETTINGS_KEY,
49394
+ onClick: function onClick() {
49395
+ return onSelectPackage(SETTINGS_KEY);
49396
+ },
49397
+ className: selectedPackageKey === SETTINGS_KEY ? "bg-white/10 opacity-100" : "",
49398
+ children: "Settings"
49399
+ }, SETTINGS_KEY), /*#__PURE__*/jsx(Sidebar.Item, {
49400
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
49401
+ icon: "circle-question",
49402
+ className: "h-3.5 w-3.5"
49403
+ }),
49404
+ active: selectedPackageKey === HELP_KEY,
49405
+ onClick: function onClick() {
49406
+ return onSelectPackage(HELP_KEY);
49407
+ },
49408
+ className: selectedPackageKey === HELP_KEY ? "bg-white/10 opacity-100" : "",
49409
+ children: "Help"
49410
+ }, HELP_KEY)]
49411
+ }), viewMode === "grouped" ? /*#__PURE__*/jsxs(Fragment, {
49381
49412
  children: [withGrants.length > 0 && /*#__PURE__*/jsx(Sidebar.Group, {
49382
49413
  label: "Has grants",
49383
49414
  children: withGrants.map(renderPackageItem)
@@ -49385,7 +49416,10 @@ var PrivacySecurityList = function PrivacySecurityList(_ref) {
49385
49416
  label: "No grants",
49386
49417
  children: withoutGrants.map(renderPackageItem)
49387
49418
  })]
49388
- }) : filtered.map(renderPackageItem), filtered.length === 0 && /*#__PURE__*/jsx("span", {
49419
+ }) : /*#__PURE__*/jsx(Sidebar.Group, {
49420
+ label: "Packages",
49421
+ children: filtered.map(renderPackageItem)
49422
+ }), filtered.length === 0 && /*#__PURE__*/jsx("span", {
49389
49423
  className: "text-sm opacity-40 py-8 text-center block",
49390
49424
  children: searchQuery ? "No packages match your search" : "No widgets installed"
49391
49425
  })]
@@ -49719,18 +49753,15 @@ var PrivacySecuritySection = function PrivacySecuritySection() {
49719
49753
  _useState12 = _slicedToArray(_useState11, 2),
49720
49754
  viewMode = _useState12[0],
49721
49755
  setViewMode = _useState12[1];
49722
- var _useState13 = useState(null),
49756
+ // Default to the Settings sidebar item so first-time visitors land
49757
+ // on something useful rather than the empty-detail placeholder.
49758
+ // "__settings__"/"__help__" are special selection keys (see
49759
+ // PrivacySecurityList); a string starting without "__" is a
49760
+ // packageId.
49761
+ var _useState13 = useState("__settings__"),
49723
49762
  _useState14 = _slicedToArray(_useState13, 2),
49724
49763
  selectedPackageKey = _useState14[0],
49725
49764
  setSelectedPackageKey = _useState14[1];
49726
- // Two top-level tabs so the inline `HowThisWorksPanel` (which carries
49727
- // example fixtures and is intentionally tall) doesn't push the
49728
- // package list/detail below the viewport. "permissions" is the
49729
- // default and contains the actual UI users came here to use.
49730
- var _useState15 = useState("permissions"),
49731
- _useState16 = _slicedToArray(_useState15, 2),
49732
- activeTab = _useState16[0],
49733
- setActiveTab = _useState16[1];
49734
49765
  var reload = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
49735
49766
  var _api$widgetMcp, api, result, _t;
49736
49767
  return _regeneratorRuntime.wrap(function (_context) {
@@ -49928,7 +49959,9 @@ var PrivacySecuritySection = function PrivacySecuritySection() {
49928
49959
  });
49929
49960
  }
49930
49961
  var packageGroups = groupRowsByPackage(rows);
49931
- var selectedGroup = selectedPackageKey == null ? null : packageGroups.find(function (g) {
49962
+ var isSettingsSelected = selectedPackageKey === "__settings__";
49963
+ var isHelpSelected = selectedPackageKey === "__help__";
49964
+ var selectedGroup = selectedPackageKey == null || isSettingsSelected || isHelpSelected ? null : packageGroups.find(function (g) {
49932
49965
  return g.packageId == null ? selectedPackageKey === "__ungrouped__" : g.packageId === selectedPackageKey;
49933
49966
  }) || null;
49934
49967
  var listContent = /*#__PURE__*/jsx(PrivacySecurityList, {
@@ -49940,60 +49973,53 @@ var PrivacySecuritySection = function PrivacySecuritySection() {
49940
49973
  viewMode: viewMode,
49941
49974
  onViewModeChange: setViewMode
49942
49975
  });
49943
- var detailContent = selectedGroup ? /*#__PURE__*/jsx(WidgetPackageDetail, {
49944
- packageGroup: selectedGroup,
49945
- onRevokeWidget: revokeWidget,
49946
- onRevokeServer: revokeServer,
49947
- onGrantManually: function onGrantManually(widgetId) {
49948
- return setManualGrantWidgetId(widgetId);
49949
- },
49950
- onRevokePackage: revokePackage
49951
- }) : null;
49976
+
49977
+ // Detail panel content varies by what the user picked in the
49978
+ // sidebar — Settings shows the toggles, Help shows the how-it-
49979
+ // works panel, a package shows its widgets. Wrapping each non-
49980
+ // package case in a scrollable container so long content (like
49981
+ // the help fixtures) stays inside the panel and doesn't push the
49982
+ // sidebar around.
49983
+ var detailContent = null;
49984
+ if (isSettingsSelected) {
49985
+ detailContent = /*#__PURE__*/jsx("div", {
49986
+ className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6",
49987
+ children: /*#__PURE__*/jsx(EnforcementToggles, {})
49988
+ });
49989
+ } else if (isHelpSelected) {
49990
+ detailContent = /*#__PURE__*/jsx("div", {
49991
+ className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6",
49992
+ children: /*#__PURE__*/jsx(HowThisWorksPanel, {})
49993
+ });
49994
+ } else if (selectedGroup) {
49995
+ detailContent = /*#__PURE__*/jsx(WidgetPackageDetail, {
49996
+ packageGroup: selectedGroup,
49997
+ onRevokeWidget: revokeWidget,
49998
+ onRevokeServer: revokeServer,
49999
+ onGrantManually: function onGrantManually(widgetId) {
50000
+ return setManualGrantWidgetId(widgetId);
50001
+ },
50002
+ onRevokePackage: revokePackage
50003
+ });
50004
+ }
49952
50005
  return /*#__PURE__*/jsxs("div", {
49953
50006
  className: "flex flex-col flex-1 min-h-0",
49954
50007
  children: [/*#__PURE__*/jsxs("div", {
49955
- className: "flex-shrink-0 flex flex-col space-y-3 px-6 pt-6 pb-3 border-b border-gray-800",
49956
- children: [/*#__PURE__*/jsxs("div", {
49957
- className: "flex flex-col space-y-2",
49958
- children: [/*#__PURE__*/jsx(SubHeading3, {
49959
- title: "Widget MCP permissions",
49960
- padding: false
49961
- }), /*#__PURE__*/jsx("span", {
49962
- className: "text-xs opacity-60",
49963
- children: "Granting access here is a trust signal about the widget \u2014 not a per-dashboard switch."
49964
- })]
49965
- }), /*#__PURE__*/jsx(Tabs3, {
49966
- value: activeTab,
49967
- onValueChange: setActiveTab,
49968
- backgroundColor: "bg-transparent",
49969
- spacing: "p-0",
49970
- children: /*#__PURE__*/jsxs(Tabs3.List, {
49971
- spacing: "p-0.5",
49972
- children: [/*#__PURE__*/jsx(Tabs3.Trigger, {
49973
- value: "permissions",
49974
- children: "Permissions"
49975
- }), /*#__PURE__*/jsx(Tabs3.Trigger, {
49976
- value: "help",
49977
- children: "Help"
49978
- })]
49979
- })
50008
+ className: "flex-shrink-0 flex flex-col space-y-2 px-6 pt-6 pb-3 border-b border-gray-800",
50009
+ children: [/*#__PURE__*/jsx(SubHeading3, {
50010
+ title: "Widget MCP permissions",
50011
+ padding: false
50012
+ }), /*#__PURE__*/jsx("span", {
50013
+ className: "text-xs opacity-60",
50014
+ children: "Granting access here is a trust signal about the widget \u2014 not a per-dashboard switch."
49980
50015
  }), error && /*#__PURE__*/jsx("div", {
49981
50016
  className: "text-xs text-red-400 bg-red-900 bg-opacity-20 border border-red-700 rounded p-3",
49982
50017
  children: error
49983
50018
  })]
49984
- }), activeTab === "permissions" ? /*#__PURE__*/jsxs("div", {
49985
- className: "flex flex-col flex-1 min-h-0",
49986
- children: [/*#__PURE__*/jsx("div", {
49987
- className: "flex-shrink-0 px-6 py-4 border-b border-gray-800",
49988
- children: /*#__PURE__*/jsx(EnforcementToggles, {})
49989
- }), /*#__PURE__*/jsx(SectionLayout, {
49990
- listContent: listContent,
49991
- detailContent: detailContent,
49992
- emptyDetailMessage: "Select a package to view its grants"
49993
- })]
49994
- }) : /*#__PURE__*/jsx("div", {
49995
- className: "flex-1 overflow-y-auto p-6",
49996
- children: /*#__PURE__*/jsx(HowThisWorksPanel, {})
50019
+ }), /*#__PURE__*/jsx(SectionLayout, {
50020
+ listContent: listContent,
50021
+ detailContent: detailContent,
50022
+ emptyDetailMessage: "Select an item from the sidebar"
49997
50023
  }), /*#__PURE__*/jsx(GrantManuallyModal, {
49998
50024
  isOpen: !!manualGrantWidgetId,
49999
50025
  setIsOpen: function setIsOpen(open) {
@@ -50030,19 +50056,19 @@ var EnforcementToggles = function EnforcementToggles() {
50030
50056
  // pendingDisable: { flag: 'enforce' | 'jit' } | null
50031
50057
  // When the user toggles a flag from ON → OFF, we open a confirm modal
50032
50058
  // before persisting. ON → ON or OFF → ON go through immediately.
50033
- var _useState17 = useState(null),
50034
- _useState18 = _slicedToArray(_useState17, 2),
50035
- pendingDisable = _useState18[0],
50036
- setPendingDisable = _useState18[1];
50059
+ var _useState15 = useState(null),
50060
+ _useState16 = _slicedToArray(_useState15, 2),
50061
+ pendingDisable = _useState16[0],
50062
+ setPendingDisable = _useState16[1];
50037
50063
 
50038
50064
  // lastTestResult: feedback for the "Test prompt" button. Tells the
50039
50065
  // user whether their JIT response was actually persisted, so they
50040
50066
  // don't have to interpret the post-grant "server not connected"
50041
50067
  // error as failure.
50042
- var _useState19 = useState(null),
50043
- _useState20 = _slicedToArray(_useState19, 2),
50044
- lastTestResult = _useState20[0],
50045
- setLastTestResult = _useState20[1];
50068
+ var _useState17 = useState(null),
50069
+ _useState18 = _slicedToArray(_useState17, 2),
50070
+ lastTestResult = _useState18[0],
50071
+ setLastTestResult = _useState18[1];
50046
50072
 
50047
50073
  // Auto-clear the test result after 30 seconds so it doesn't linger
50048
50074
  // forever after a successful test.
@@ -50443,10 +50469,10 @@ var noop = function noop() {};
50443
50469
  * users who don't want the wall of text collapse manually.
50444
50470
  */
50445
50471
  var HowThisWorksPanel = function HowThisWorksPanel() {
50446
- var _useState21 = useState(true),
50447
- _useState22 = _slicedToArray(_useState21, 2),
50448
- open = _useState22[0],
50449
- setOpen = _useState22[1];
50472
+ var _useState19 = useState(true),
50473
+ _useState20 = _slicedToArray(_useState19, 2),
50474
+ open = _useState20[0],
50475
+ setOpen = _useState20[1];
50450
50476
  return /*#__PURE__*/jsxs("div", {
50451
50477
  className: "border border-gray-700 rounded",
50452
50478
  children: [/*#__PURE__*/jsxs("button", {