@trops/dash-core 0.1.470 → 0.1.472

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
@@ -9393,7 +9393,7 @@ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBu
9393
9393
  var hasPropertyDescriptors_1 = hasPropertyDescriptors;
9394
9394
 
9395
9395
  var keys = objectKeys$2;
9396
- var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
9396
+ var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
9397
9397
 
9398
9398
  var toStr$4 = Object.prototype.toString;
9399
9399
  var concat = Array.prototype.concat;
@@ -9426,7 +9426,7 @@ var defineProperty$1 = function (object, name, value, predicate) {
9426
9426
  var defineProperties$1 = function (object, map) {
9427
9427
  var predicates = arguments.length > 2 ? arguments[2] : {};
9428
9428
  var props = keys(map);
9429
- if (hasSymbols$4) {
9429
+ if (hasSymbols$5) {
9430
9430
  props = concat.call(props, Object.getOwnPropertySymbols(map));
9431
9431
  }
9432
9432
  for (var i = 0; i < props.length; i += 1) {
@@ -9492,11 +9492,11 @@ var sign$1 = function sign(number) {
9492
9492
  };
9493
9493
 
9494
9494
  var shams$1;
9495
- var hasRequiredShams$1;
9495
+ var hasRequiredShams;
9496
9496
 
9497
- function requireShams$1 () {
9498
- if (hasRequiredShams$1) return shams$1;
9499
- hasRequiredShams$1 = 1;
9497
+ function requireShams () {
9498
+ if (hasRequiredShams) return shams$1;
9499
+ hasRequiredShams = 1;
9500
9500
 
9501
9501
  /** @type {import('./shams')} */
9502
9502
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
@@ -9545,10 +9545,10 @@ function requireShams$1 () {
9545
9545
  }
9546
9546
 
9547
9547
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
9548
- var hasSymbolSham = requireShams$1();
9548
+ var hasSymbolSham = requireShams();
9549
9549
 
9550
9550
  /** @type {import('.')} */
9551
- var hasSymbols$3 = function hasNativeSymbols() {
9551
+ var hasSymbols$4 = function hasNativeSymbols() {
9552
9552
  if (typeof origSymbol !== 'function') { return false; }
9553
9553
  if (typeof Symbol !== 'function') { return false; }
9554
9554
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -9852,7 +9852,7 @@ var ThrowTypeError = $gOPD$1
9852
9852
  }())
9853
9853
  : throwTypeError;
9854
9854
 
9855
- var hasSymbols$2 = hasSymbols$3();
9855
+ var hasSymbols$3 = hasSymbols$4();
9856
9856
 
9857
9857
  var getProto$2 = getProto$3;
9858
9858
  var $ObjectGPO = requireObject_getPrototypeOf();
@@ -9870,7 +9870,7 @@ var INTRINSICS = {
9870
9870
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
9871
9871
  '%Array%': Array,
9872
9872
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
9873
- '%ArrayIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9873
+ '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9874
9874
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
9875
9875
  '%AsyncFunction%': needsEval,
9876
9876
  '%AsyncGenerator%': needsEval,
@@ -9901,10 +9901,10 @@ var INTRINSICS = {
9901
9901
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
9902
9902
  '%isFinite%': isFinite,
9903
9903
  '%isNaN%': isNaN,
9904
- '%IteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9904
+ '%IteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9905
9905
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
9906
9906
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
9907
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9907
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9908
9908
  '%Math%': Math,
9909
9909
  '%Number%': Number,
9910
9910
  '%Object%': $Object$2,
@@ -9918,11 +9918,11 @@ var INTRINSICS = {
9918
9918
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
9919
9919
  '%RegExp%': RegExp,
9920
9920
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
9921
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9921
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9922
9922
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
9923
9923
  '%String%': String,
9924
- '%StringIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9925
- '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
9924
+ '%StringIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9925
+ '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
9926
9926
  '%SyntaxError%': $SyntaxError$1,
9927
9927
  '%ThrowTypeError%': ThrowTypeError,
9928
9928
  '%TypedArray%': TypedArray,
@@ -10275,12 +10275,12 @@ var callBound$i = function callBoundIntrinsic(name, allowMissing) {
10275
10275
 
10276
10276
  // modified from https://github.com/es-shims/es6-shim
10277
10277
  var objectKeys$1 = objectKeys$2;
10278
- var hasSymbols$1 = requireShams$1()();
10278
+ var hasSymbols$2 = requireShams()();
10279
10279
  var callBound$h = callBound$i;
10280
10280
  var $Object$1 = esObjectAtoms;
10281
10281
  var $push = callBound$h('Array.prototype.push');
10282
10282
  var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
10283
- var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
10283
+ var originalGetSymbols = hasSymbols$2 ? $Object$1.getOwnPropertySymbols : null;
10284
10284
 
10285
10285
  // eslint-disable-next-line no-unused-vars
10286
10286
  var implementation$8 = function assign(target, source1) {
@@ -10294,7 +10294,7 @@ var implementation$8 = function assign(target, source1) {
10294
10294
 
10295
10295
  // step 3.a.ii:
10296
10296
  var keys = objectKeys$1(from);
10297
- var getSymbols = hasSymbols$1 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
10297
+ var getSymbols = hasSymbols$2 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
10298
10298
  if (getSymbols) {
10299
10299
  var syms = getSymbols(from);
10300
10300
  for (var j = 0; j < syms.length; ++j) {
@@ -10591,23 +10591,14 @@ var regexp_prototype_flags = flagsBound;
10591
10591
 
10592
10592
  var esGetIterator = {exports: {}};
10593
10593
 
10594
- var shams;
10595
- var hasRequiredShams;
10594
+ var hasSymbols$1 = requireShams();
10596
10595
 
10597
- function requireShams () {
10598
- if (hasRequiredShams) return shams;
10599
- hasRequiredShams = 1;
10600
-
10601
- var hasSymbols = requireShams$1();
10602
-
10603
- /** @type {import('.')} */
10604
- shams = function hasToStringTagShams() {
10605
- return hasSymbols() && !!Symbol.toStringTag;
10606
- };
10607
- return shams;
10608
- }
10596
+ /** @type {import('.')} */
10597
+ var shams = function hasToStringTagShams() {
10598
+ return hasSymbols$1() && !!Symbol.toStringTag;
10599
+ };
10609
10600
 
10610
- var hasToStringTag$7 = requireShams()();
10601
+ var hasToStringTag$7 = shams();
10611
10602
  var callBound$f = callBound$i;
10612
10603
 
10613
10604
  var $toString$7 = callBound$f('Object.prototype.toString');
@@ -11644,7 +11635,7 @@ var tryStringObject = function tryStringObject(value) {
11644
11635
  /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
11645
11636
  var $toString$6 = callBound$c('Object.prototype.toString');
11646
11637
  var strClass = '[object String]';
11647
- var hasToStringTag$6 = requireShams()();
11638
+ var hasToStringTag$6 = shams();
11648
11639
 
11649
11640
  /** @type {import('.')} */
11650
11641
  var isString$2 = function isString(value) {
@@ -11760,7 +11751,7 @@ var isSet$2 = exported$1 || function isSet(x) {
11760
11751
  var isArguments$1 = isArguments$2;
11761
11752
  var getStopIterationIterator = stopIterationIterator;
11762
11753
 
11763
- if (hasSymbols$3() || requireShams$1()()) {
11754
+ if (hasSymbols$4() || requireShams()()) {
11764
11755
  var $iterator = Symbol.iterator;
11765
11756
  // Symbol is available natively or shammed
11766
11757
  // natively:
@@ -12049,7 +12040,7 @@ var tryDateObject = function tryDateGetDayCall(value) {
12049
12040
  /** @type {(value: unknown) => string} */
12050
12041
  var toStr$2 = callBound$9('Object.prototype.toString');
12051
12042
  var dateClass = '[object Date]';
12052
- var hasToStringTag$5 = requireShams()();
12043
+ var hasToStringTag$5 = shams();
12053
12044
 
12054
12045
  /** @type {import('.')} */
12055
12046
  var isDateObject = function isDateObject(value) {
@@ -12060,7 +12051,7 @@ var isDateObject = function isDateObject(value) {
12060
12051
  };
12061
12052
 
12062
12053
  var callBound$8 = callBound$i;
12063
- var hasToStringTag$4 = requireShams()();
12054
+ var hasToStringTag$4 = shams();
12064
12055
  var hasOwn = hasown;
12065
12056
  var gOPD$1 = gopd$1;
12066
12057
 
@@ -12165,7 +12156,7 @@ var tryNumberObject = function tryNumberObject(value) {
12165
12156
  };
12166
12157
  var $toString$3 = callBound$6('Object.prototype.toString');
12167
12158
  var numClass = '[object Number]';
12168
- var hasToStringTag$3 = requireShams()();
12159
+ var hasToStringTag$3 = shams();
12169
12160
 
12170
12161
  /** @type {import('.')} */
12171
12162
  var isNumberObject = function isNumberObject(value) {
@@ -12192,7 +12183,7 @@ var tryBooleanObject = function booleanBrandCheck(value) {
12192
12183
  }
12193
12184
  };
12194
12185
  var boolClass = '[object Boolean]';
12195
- var hasToStringTag$2 = requireShams()();
12186
+ var hasToStringTag$2 = shams();
12196
12187
 
12197
12188
  /** @type {import('.')} */
12198
12189
  var isBooleanObject = function isBoolean(value) {
@@ -12234,7 +12225,7 @@ function requireSafeRegexTest () {
12234
12225
 
12235
12226
  var callBound$4 = callBound$i;
12236
12227
  var $toString$1 = callBound$4('Object.prototype.toString');
12237
- var hasSymbols = hasSymbols$3();
12228
+ var hasSymbols = hasSymbols$4();
12238
12229
  var safeRegexTest = requireSafeRegexTest();
12239
12230
 
12240
12231
  if (hasSymbols) {
@@ -12680,7 +12671,7 @@ var gOPD = gopd$1;
12680
12671
  var getProto = getProto$3;
12681
12672
 
12682
12673
  var $toString = callBound$2('Object.prototype.toString');
12683
- var hasToStringTag = requireShams()();
12674
+ var hasToStringTag = shams();
12684
12675
 
12685
12676
  var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
12686
12677
  var typedArrays = availableTypedArrays();
@@ -52901,11 +52892,12 @@ var EditField = function EditField(_ref7) {
52901
52892
 
52902
52893
  function ownKeys$h(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
52903
52894
  function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
52895
+ var GLOBAL_KEY = "__global__";
52904
52896
  var NotificationsSection = function NotificationsSection(_ref) {
52905
52897
  var _ref$workspaces = _ref.workspaces,
52906
52898
  workspaces = _ref$workspaces === void 0 ? [] : _ref$workspaces;
52907
- var appContext = React.useContext(AppContext);
52908
- appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
52899
+ React.useContext(AppContext);
52900
+
52909
52901
  var _useState = React.useState(true),
52910
52902
  _useState2 = _slicedToArray(_useState, 2),
52911
52903
  globalEnabled = _useState2[0],
@@ -52922,6 +52914,22 @@ var NotificationsSection = function NotificationsSection(_ref) {
52922
52914
  _useState8 = _slicedToArray(_useState7, 2),
52923
52915
  loading = _useState8[0],
52924
52916
  setLoading = _useState8[1];
52917
+ var _useState9 = React.useState(""),
52918
+ _useState0 = _slicedToArray(_useState9, 2),
52919
+ searchQuery = _useState0[0],
52920
+ setSearchQuery = _useState0[1];
52921
+ var _useState1 = React.useState(GLOBAL_KEY),
52922
+ _useState10 = _slicedToArray(_useState1, 2),
52923
+ selectedKey = _useState10[0],
52924
+ setSelectedKey = _useState10[1];
52925
+ var _useState11 = React.useState("all"),
52926
+ _useState12 = _slicedToArray(_useState11, 2),
52927
+ filterDashboard = _useState12[0],
52928
+ setFilterDashboard = _useState12[1];
52929
+ var _useState13 = React.useState("all"),
52930
+ _useState14 = _slicedToArray(_useState13, 2),
52931
+ filterPackage = _useState14[0],
52932
+ setFilterPackage = _useState14[1];
52925
52933
 
52926
52934
  // Load preferences on mount
52927
52935
  React.useEffect(function () {
@@ -52938,38 +52946,79 @@ var NotificationsSection = function NotificationsSection(_ref) {
52938
52946
  });
52939
52947
  }, []);
52940
52948
 
52941
- // Collect all widget instances with notifications from workspaces.
52942
- // Route through `ComponentManager.resolve` so a legacy layout
52943
- // referencing a bare component name still finds its registered
52944
- // scoped form (post-v0.1.432). Direct `componentMap[item.component]`
52945
- // returns undefined for bare names after the migration.
52946
- var widgetInstances = [];
52947
- workspaces.forEach(function (ws) {
52948
- var items = flattenLayout(ws.layout);
52949
- items.forEach(function (item) {
52950
- var _config$notifications;
52951
- var config = ComponentManager.resolve(item.component, item);
52952
- if ((config === null || config === void 0 || (_config$notifications = config.notifications) === null || _config$notifications === void 0 ? void 0 : _config$notifications.length) > 0) {
52953
- var _item$userPrefs;
52954
- widgetInstances.push({
52955
- uuid: item.uuid || item.uuidString,
52956
- componentName: item.component,
52957
- title: ((_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title) || config.displayName || item.component,
52958
- workspaceName: ws.name || ws.id,
52959
- notifications: config.notifications,
52960
- "package": config["package"]
52961
- });
52962
- }
52949
+ // Collect every widget instance with notifications, alphabetized
52950
+ // by display title. Route through `ComponentManager.resolve` so a
52951
+ // legacy layout referencing a bare component name still finds the
52952
+ // registered scoped form.
52953
+ var widgetInstances = React.useMemo(function () {
52954
+ var out = [];
52955
+ workspaces.forEach(function (ws) {
52956
+ var items = flattenLayout(ws.layout);
52957
+ items.forEach(function (item) {
52958
+ var _config$notifications;
52959
+ var config = ComponentManager.resolve(item.component, item);
52960
+ if ((config === null || config === void 0 || (_config$notifications = config.notifications) === null || _config$notifications === void 0 ? void 0 : _config$notifications.length) > 0) {
52961
+ var _item$userPrefs;
52962
+ out.push({
52963
+ uuid: item.uuid || item.uuidString,
52964
+ componentName: item.component,
52965
+ title: ((_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title) || config.displayName || item.component,
52966
+ workspaceName: ws.name || ws.id,
52967
+ notifications: config.notifications,
52968
+ "package": config["package"] || "Other"
52969
+ });
52970
+ }
52971
+ });
52963
52972
  });
52964
- });
52973
+ return out.sort(function (a, b) {
52974
+ return String(a.title).localeCompare(String(b.title), undefined, {
52975
+ sensitivity: "base"
52976
+ });
52977
+ });
52978
+ }, [workspaces]);
52965
52979
 
52966
- // Group by package
52967
- var grouped = {};
52968
- widgetInstances.forEach(function (wi) {
52969
- var pkg = wi["package"] || "Other";
52970
- if (!grouped[pkg]) grouped[pkg] = [];
52971
- grouped[pkg].push(wi);
52972
- });
52980
+ // Derive dropdown option lists. Both sorted alphabetically so the
52981
+ // dropdowns don't shuffle as the underlying list changes order.
52982
+ var dashboardOptions = React.useMemo(function () {
52983
+ var set = new Set();
52984
+ widgetInstances.forEach(function (wi) {
52985
+ if (wi.workspaceName) set.add(wi.workspaceName);
52986
+ });
52987
+ return _toConsumableArray(set).sort(function (a, b) {
52988
+ return String(a).localeCompare(String(b), undefined, {
52989
+ sensitivity: "base"
52990
+ });
52991
+ });
52992
+ }, [widgetInstances]);
52993
+ var packageOptions = React.useMemo(function () {
52994
+ var set = new Set();
52995
+ widgetInstances.forEach(function (wi) {
52996
+ if (wi["package"]) set.add(wi["package"]);
52997
+ });
52998
+ return _toConsumableArray(set).sort(function (a, b) {
52999
+ return String(a).localeCompare(String(b), undefined, {
53000
+ sensitivity: "base"
53001
+ });
53002
+ });
53003
+ }, [widgetInstances]);
53004
+ var hasActiveFilters = searchQuery.trim() !== "" || filterDashboard !== "all" || filterPackage !== "all";
53005
+ var clearFilters = function clearFilters() {
53006
+ setSearchQuery("");
53007
+ setFilterDashboard("all");
53008
+ setFilterPackage("all");
53009
+ };
53010
+
53011
+ // Filter by search + dashboard + package (composed AND).
53012
+ var filteredInstances = React.useMemo(function () {
53013
+ var q = searchQuery.trim().toLowerCase();
53014
+ return widgetInstances.filter(function (wi) {
53015
+ if (filterDashboard !== "all" && wi.workspaceName !== filterDashboard) return false;
53016
+ if (filterPackage !== "all" && wi["package"] !== filterPackage) return false;
53017
+ if (!q) return true;
53018
+ var hay = [wi.title, wi["package"], wi.workspaceName, wi.componentName].filter(Boolean).join(" ").toLowerCase();
53019
+ return hay.includes(q);
53020
+ });
53021
+ }, [widgetInstances, searchQuery, filterDashboard, filterPackage]);
52973
53022
  function handleGlobalToggle(value) {
52974
53023
  var _window$mainApi2;
52975
53024
  setGlobalEnabled(value);
@@ -53003,16 +53052,126 @@ var NotificationsSection = function NotificationsSection(_ref) {
53003
53052
  children: "Loading notification preferences..."
53004
53053
  });
53005
53054
  }
53006
- return /*#__PURE__*/jsxRuntime.jsx("div", {
53007
- className: "flex-1 overflow-y-auto p-6",
53008
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
53009
- className: "flex flex-col space-y-6",
53010
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
53055
+
53056
+ // ── Left list ──────────────────────────────────────────────────────
53057
+ var listContent = /*#__PURE__*/jsxRuntime.jsxs("div", {
53058
+ className: "flex flex-col h-full",
53059
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
53060
+ className: "flex flex-col gap-2 px-3 py-2 flex-shrink-0 border-b border-white/10",
53061
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SearchInput, {
53062
+ value: searchQuery,
53063
+ onChange: setSearchQuery,
53064
+ placeholder: "Search widgets...",
53065
+ inputClassName: "py-1.5 text-xs"
53066
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
53067
+ className: "grid grid-cols-2 gap-1.5",
53068
+ children: [/*#__PURE__*/jsxRuntime.jsxs("select", {
53069
+ value: filterDashboard,
53070
+ onChange: function onChange(e) {
53071
+ return setFilterDashboard(e.target.value);
53072
+ },
53073
+ className: "w-full px-2 py-1 text-xs bg-gray-800/50 border border-white/10 rounded text-gray-200 focus:outline-none",
53074
+ children: [/*#__PURE__*/jsxRuntime.jsx("option", {
53075
+ value: "all",
53076
+ children: "All Dashboards"
53077
+ }), dashboardOptions.map(function (d) {
53078
+ return /*#__PURE__*/jsxRuntime.jsx("option", {
53079
+ value: d,
53080
+ children: d
53081
+ }, d);
53082
+ })]
53083
+ }), /*#__PURE__*/jsxRuntime.jsxs("select", {
53084
+ value: filterPackage,
53085
+ onChange: function onChange(e) {
53086
+ return setFilterPackage(e.target.value);
53087
+ },
53088
+ className: "w-full px-2 py-1 text-xs bg-gray-800/50 border border-white/10 rounded text-gray-200 focus:outline-none",
53089
+ children: [/*#__PURE__*/jsxRuntime.jsx("option", {
53090
+ value: "all",
53091
+ children: "All Packages"
53092
+ }), packageOptions.map(function (p) {
53093
+ return /*#__PURE__*/jsxRuntime.jsx("option", {
53094
+ value: p,
53095
+ children: p
53096
+ }, p);
53097
+ })]
53098
+ })]
53099
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
53100
+ className: "flex items-center justify-between text-[10px] px-0.5",
53101
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
53102
+ className: "opacity-50",
53103
+ children: hasActiveFilters ? "".concat(filteredInstances.length, " of ").concat(widgetInstances.length, " widgets") : "".concat(widgetInstances.length, " widget").concat(widgetInstances.length === 1 ? "" : "s")
53104
+ }), hasActiveFilters && /*#__PURE__*/jsxRuntime.jsx("button", {
53105
+ type: "button",
53106
+ onClick: clearFilters,
53107
+ className: "opacity-60 hover:opacity-100 transition-opacity text-gray-300 hover:bg-white/10 px-1.5 py-0.5 rounded",
53108
+ children: "Clear"
53109
+ })]
53110
+ })]
53111
+ }), /*#__PURE__*/jsxRuntime.jsxs(DashReact.Sidebar.Content, {
53112
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
53113
+ icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
53114
+ icon: globalEnabled ? "bell" : "bell-slash",
53115
+ className: "h-3.5 w-3.5"
53116
+ }),
53117
+ active: selectedKey === GLOBAL_KEY,
53118
+ onClick: function onClick() {
53119
+ return setSelectedKey(GLOBAL_KEY);
53120
+ },
53121
+ children: /*#__PURE__*/jsxRuntime.jsxs("span", {
53122
+ className: "flex flex-col",
53123
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
53124
+ className: "font-medium",
53125
+ children: "Global"
53126
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
53127
+ className: "text-[10px] opacity-40",
53128
+ children: "Master switch + Do Not Disturb"
53129
+ })]
53130
+ })
53131
+ }), filteredInstances.length === 0 && widgetInstances.length === 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
53132
+ className: "px-3 py-2 text-xs opacity-50",
53133
+ children: "No widgets with notification support found. Add widgets that declare notifications to see per-type controls here."
53134
+ }), filteredInstances.length === 0 && widgetInstances.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
53135
+ className: "px-3 py-2 text-xs opacity-50",
53136
+ children: ["No widgets match \"", searchQuery, "\"."]
53137
+ }), filteredInstances.map(function (wi) {
53138
+ var isActive = selectedKey === wi.uuid;
53139
+ return /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
53140
+ icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
53141
+ icon: "bell",
53142
+ className: "h-3.5 w-3.5"
53143
+ }),
53144
+ active: isActive,
53145
+ onClick: function onClick() {
53146
+ return setSelectedKey(wi.uuid);
53147
+ },
53148
+ className: isActive ? "bg-white/10 opacity-100" : "",
53149
+ children: /*#__PURE__*/jsxRuntime.jsxs("span", {
53150
+ className: "flex flex-col",
53151
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
53152
+ className: "font-medium truncate",
53153
+ children: wi.title
53154
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
53155
+ className: "text-[10px] opacity-40 truncate",
53156
+ children: [wi["package"], wi.workspaceName ? " \xB7 ".concat(wi.workspaceName) : ""]
53157
+ })]
53158
+ })
53159
+ }, wi.uuid);
53160
+ })]
53161
+ })]
53162
+ });
53163
+
53164
+ // ── Right detail ───────────────────────────────────────────────────
53165
+ var detailContent;
53166
+ if (selectedKey === GLOBAL_KEY) {
53167
+ detailContent = /*#__PURE__*/jsxRuntime.jsxs("div", {
53168
+ className: "flex flex-col p-6 space-y-6",
53169
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
53170
+ title: "Global",
53171
+ padding: false
53172
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
53011
53173
  className: "flex flex-col space-y-3",
53012
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
53013
- title: "Global",
53014
- padding: false
53015
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
53174
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
53016
53175
  className: "flex flex-row items-center justify-between py-2",
53017
53176
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
53018
53177
  className: "flex flex-col",
@@ -53043,49 +53202,59 @@ var NotificationsSection = function NotificationsSection(_ref) {
53043
53202
  onChange: handleDndToggle
53044
53203
  })]
53045
53204
  })]
53046
- }), Object.keys(grouped).length > 0 ? Object.entries(grouped).map(function (_ref2) {
53047
- var _ref3 = _slicedToArray(_ref2, 2),
53048
- pkg = _ref3[0],
53049
- widgets = _ref3[1];
53050
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
53051
- className: "flex flex-col space-y-3",
53205
+ })]
53206
+ });
53207
+ } else {
53208
+ var wi = widgetInstances.find(function (w) {
53209
+ return w.uuid === selectedKey;
53210
+ });
53211
+ if (!wi) {
53212
+ detailContent = /*#__PURE__*/jsxRuntime.jsx("div", {
53213
+ className: "flex-1 p-6 text-sm opacity-50",
53214
+ children: "Select a widget on the left to configure its notifications."
53215
+ });
53216
+ } else {
53217
+ detailContent = /*#__PURE__*/jsxRuntime.jsxs("div", {
53218
+ className: "flex flex-col p-6 space-y-4",
53219
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
53220
+ className: "flex flex-col space-y-1",
53052
53221
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
53053
- title: pkg,
53222
+ title: wi.title,
53054
53223
  padding: false
53055
- }), widgets.map(function (wi) {
53224
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
53225
+ className: "text-xs opacity-50",
53226
+ children: [wi["package"], wi.workspaceName ? " \xB7 ".concat(wi.workspaceName) : ""]
53227
+ })]
53228
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
53229
+ className: "flex flex-col space-y-3",
53230
+ children: wi.notifications.map(function (notif) {
53056
53231
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
53057
- className: "flex flex-col space-y-2 pl-2 border-l-2 border-white/10",
53058
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
53059
- className: "text-sm font-medium opacity-80",
53060
- children: wi.title
53061
- }), wi.notifications.map(function (notif) {
53062
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
53063
- className: "flex flex-row items-center justify-between py-1 pl-2",
53064
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
53065
- className: "flex flex-col",
53066
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
53067
- className: "text-sm",
53068
- children: notif.displayName
53069
- }), notif.description && /*#__PURE__*/jsxRuntime.jsx("span", {
53070
- className: "text-xs opacity-50",
53071
- children: notif.description
53072
- })]
53073
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Switch, {
53074
- checked: getTypeEnabled(wi.uuid, notif.key, notif.defaultEnabled),
53075
- onChange: function onChange(value) {
53076
- return handleTypeToggle(wi.uuid, notif.key, value);
53077
- }
53078
- })]
53079
- }, notif.key);
53232
+ className: "flex flex-row items-center justify-between py-1",
53233
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
53234
+ className: "flex flex-col",
53235
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
53236
+ className: "text-sm",
53237
+ children: notif.displayName
53238
+ }), notif.description && /*#__PURE__*/jsxRuntime.jsx("span", {
53239
+ className: "text-xs opacity-50",
53240
+ children: notif.description
53241
+ })]
53242
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Switch, {
53243
+ checked: getTypeEnabled(wi.uuid, notif.key, notif.defaultEnabled),
53244
+ onChange: function onChange(value) {
53245
+ return handleTypeToggle(wi.uuid, notif.key, value);
53246
+ }
53080
53247
  })]
53081
- }, wi.uuid);
53082
- })]
53083
- }, pkg);
53084
- }) : /*#__PURE__*/jsxRuntime.jsx("div", {
53085
- className: "text-sm opacity-50",
53086
- children: "No widgets with notification support found. Add widgets that declare notifications to see per-type controls here."
53087
- })]
53088
- })
53248
+ }, notif.key);
53249
+ })
53250
+ })]
53251
+ });
53252
+ }
53253
+ }
53254
+ return /*#__PURE__*/jsxRuntime.jsx(SectionLayout, {
53255
+ listContent: listContent,
53256
+ detailContent: detailContent,
53257
+ emptyDetailMessage: "Select a widget to configure notifications"
53089
53258
  });
53090
53259
  };
53091
53260