@trops/dash-core 0.1.565 → 0.1.567

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
@@ -59133,27 +59133,23 @@ var DashboardConfigModal = function DashboardConfigModal(_ref) {
59133
59133
  });
59134
59134
  }
59135
59135
 
59136
- // Bulk-apply: write this provider as the binding for every widget of
59137
- // this type that doesn't already have an explicit widget-level override.
59136
+ // Bulk-apply: retarget every widget of this provider type to the
59137
+ // newly-chosen provider name. The header text above the dropdown
59138
+ // says "Apply one provider to every widget of this type, or adjust
59139
+ // per-widget below" — bulk is the retarget-everything action;
59140
+ // per-row overrides happen AFTER bulk if the user wants exceptions.
59138
59141
  //
59139
- // Override-detection consults the staged state first so a freshly
59140
- // staged unset is recognised as "no override" and gets bulked. A
59141
- // non-empty staged value is treated as an explicit pick and is
59142
- // preserved (bulk skips). Without this, the user could stage an
59143
- // unset and then click Bulk and the widget they just unset would
59144
- // be skipped because the *original* layer-1 value still lived on
59145
- // `b.layoutItem.selectedProviders`.
59142
+ // Previous behavior skipped rows that already had an explicit pick,
59143
+ // which meant the dropdown was a no-op when every row already had a
59144
+ // value (the common case: every Slack widget on a dashboard inherits
59145
+ // the same Slack provider). The user changing bulk from "Slack" to
59146
+ // "Slack Dash Comms" would see zero rows update and Save stay
59147
+ // disabled. The fill-blanks-only semantics fought the UI text and
59148
+ // the user's mental model — every spreadsheet-style bulk operation
59149
+ // overrides everything, with per-row tweaks happening afterward.
59146
59150
  function stageBulk(providerType, providerName) {
59147
59151
  var affected = effectiveBindings.filter(function (b) {
59148
- var _staged$b$widgetId2, _b$layoutItem;
59149
- if (b.providerType !== providerType) return false;
59150
- var stagedValue = (_staged$b$widgetId2 = staged[b.widgetId]) === null || _staged$b$widgetId2 === void 0 ? void 0 : _staged$b$widgetId2[providerType];
59151
- if (stagedValue !== undefined) {
59152
- // Empty/null staged value → user staged an unset → include
59153
- // in bulk. Non-empty → explicit pick, preserve it.
59154
- return !stagedValue;
59155
- }
59156
- return !((_b$layoutItem = b.layoutItem) !== null && _b$layoutItem !== void 0 && (_b$layoutItem = _b$layoutItem.selectedProviders) !== null && _b$layoutItem !== void 0 && _b$layoutItem[providerType]);
59152
+ return b.providerType === providerType;
59157
59153
  });
59158
59154
  setStaged(function (prev) {
59159
59155
  var next = _objectSpread$a({}, prev);
@@ -60001,10 +59997,7 @@ function ListenersTab(_ref0) {
60001
59997
  className: "flex flex-col gap-3 h-full min-h-0",
60002
59998
  children: /*#__PURE__*/jsxs("div", {
60003
59999
  className: "flex flex-row gap-3 flex-1 min-h-0",
60004
- children: [/*#__PURE__*/jsxs(Card2, {
60005
- padding: "",
60006
- shadow: "",
60007
- rounded: "rounded-lg",
60000
+ children: [/*#__PURE__*/jsxs("div", {
60008
60001
  className: "w-56 flex-shrink-0 overflow-hidden flex flex-col",
60009
60002
  children: [/*#__PURE__*/jsx("div", {
60010
60003
  className: "px-3 py-2 text-xs font-semibold opacity-50 uppercase tracking-wider",
@@ -60049,10 +60042,7 @@ function ListenersTab(_ref0) {
60049
60042
  onAdd: onAdd,
60050
60043
  onRemove: onRemove
60051
60044
  })]
60052
- }) : /*#__PURE__*/jsx(Card2, {
60053
- padding: "",
60054
- shadow: "",
60055
- rounded: "rounded-lg",
60045
+ }) : /*#__PURE__*/jsx("div", {
60056
60046
  className: "flex-1 min-w-0 flex items-center justify-center text-sm opacity-60",
60057
60047
  children: "Pick a widget on the left to wire its handlers."
60058
60048
  })]
@@ -60087,45 +60077,47 @@ function HandlersColumn(_ref10) {
60087
60077
  }
60088
60078
  return m;
60089
60079
  }, [myWiring]);
60090
- return /*#__PURE__*/jsxs(Card2, {
60091
- padding: "",
60092
- shadow: "",
60093
- rounded: "rounded-lg",
60094
- className: "w-56 flex-shrink-0 overflow-hidden flex flex-col",
60095
- children: [/*#__PURE__*/jsx("div", {
60096
- className: "px-3 py-2 text-xs font-semibold opacity-50 uppercase tracking-wider",
60097
- children: "Event Handlers"
60098
- }), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx("div", {
60099
- className: "overflow-y-auto flex-1",
60100
- children: receiver.eventHandlers.length === 0 ? /*#__PURE__*/jsx("div", {
60101
- className: "text-xs opacity-50 text-center py-6 px-3",
60102
- children: "This widget declares no event handlers."
60103
- }) : receiver.eventHandlers.map(function (h) {
60104
- var isActive = h === selectedHandler;
60105
- var count = countsByHandler.get(h) || 0;
60106
- return /*#__PURE__*/jsxs("button", {
60107
- type: "button",
60108
- onClick: function onClick() {
60109
- return onSelectHandler(h);
60110
- },
60111
- className: "w-full text-left px-3 py-2 text-sm flex items-center justify-between gap-2 border-l-2 ".concat(isActive ? "bg-indigo-900/30 border-indigo-400" : "border-transparent hover:bg-white/5"),
60112
- children: [/*#__PURE__*/jsxs("span", {
60113
- className: "flex items-center gap-2 min-w-0",
60114
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
60115
- icon: "bolt",
60116
- className: "h-3 w-3 opacity-60 flex-shrink-0"
60117
- }), /*#__PURE__*/jsx("code", {
60118
- className: "truncate",
60119
- children: h
60080
+ return (
60081
+ /*#__PURE__*/
60082
+ // Plain <div> wrapper — Card2 reads as washed-out against the
60083
+ // modal's dark chrome. See ListenersTab + ProvidersTab fix.
60084
+ jsxs("div", {
60085
+ className: "w-56 flex-shrink-0 overflow-hidden flex flex-col",
60086
+ children: [/*#__PURE__*/jsx("div", {
60087
+ className: "px-3 py-2 text-xs font-semibold opacity-50 uppercase tracking-wider",
60088
+ children: "Event Handlers"
60089
+ }), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx("div", {
60090
+ className: "overflow-y-auto flex-1",
60091
+ children: receiver.eventHandlers.length === 0 ? /*#__PURE__*/jsx("div", {
60092
+ className: "text-xs opacity-50 text-center py-6 px-3",
60093
+ children: "This widget declares no event handlers."
60094
+ }) : receiver.eventHandlers.map(function (h) {
60095
+ var isActive = h === selectedHandler;
60096
+ var count = countsByHandler.get(h) || 0;
60097
+ return /*#__PURE__*/jsxs("button", {
60098
+ type: "button",
60099
+ onClick: function onClick() {
60100
+ return onSelectHandler(h);
60101
+ },
60102
+ className: "w-full text-left px-3 py-2 text-sm flex items-center justify-between gap-2 border-l-2 ".concat(isActive ? "bg-indigo-900/30 border-indigo-400" : "border-transparent hover:bg-white/5"),
60103
+ children: [/*#__PURE__*/jsxs("span", {
60104
+ className: "flex items-center gap-2 min-w-0",
60105
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
60106
+ icon: "bolt",
60107
+ className: "h-3 w-3 opacity-60 flex-shrink-0"
60108
+ }), /*#__PURE__*/jsx("code", {
60109
+ className: "truncate",
60110
+ children: h
60111
+ })]
60112
+ }), /*#__PURE__*/jsx("span", {
60113
+ className: "text-xs opacity-60 flex-shrink-0",
60114
+ children: count
60120
60115
  })]
60121
- }), /*#__PURE__*/jsx("span", {
60122
- className: "text-xs opacity-60 flex-shrink-0",
60123
- children: count
60124
- })]
60125
- }, h);
60126
- })
60127
- })]
60128
- });
60116
+ }, h);
60117
+ })
60118
+ })]
60119
+ })
60120
+ );
60129
60121
  }
60130
60122
 
60131
60123
  /**
@@ -60176,10 +60168,7 @@ function EventsColumn(_ref11) {
60176
60168
  return w.isOrphan;
60177
60169
  });
60178
60170
  if (!handlerName) {
60179
- return /*#__PURE__*/jsx(Card2, {
60180
- padding: "",
60181
- shadow: "",
60182
- rounded: "rounded-lg",
60171
+ return /*#__PURE__*/jsx("div", {
60183
60172
  className: "flex-1 min-w-0 flex items-center justify-center text-sm opacity-60",
60184
60173
  children: "Select a handler to view available events."
60185
60174
  });
@@ -60208,63 +60197,64 @@ function EventsColumn(_ref11) {
60208
60197
  var emittersForList = emitters.filter(function (e) {
60209
60198
  return !(e.component === receiver.component && String(e.itemId) === String(receiver.itemId));
60210
60199
  });
60211
- return /*#__PURE__*/jsxs(Card2, {
60212
- padding: "",
60213
- shadow: "",
60214
- rounded: "rounded-lg",
60215
- className: "flex-1 min-w-0 overflow-hidden flex flex-col",
60216
- children: [/*#__PURE__*/jsxs("div", {
60217
- className: "flex-shrink-0 px-4 py-2 text-xs opacity-60",
60218
- children: ["Check an event to fire ", /*#__PURE__*/jsx("code", {
60219
- className: "text-xs",
60220
- children: handlerName
60221
- }), " on", " ", /*#__PURE__*/jsx("span", {
60222
- className: "font-medium",
60223
- children: receiver.label
60224
- }), "."]
60225
- }), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx("div", {
60226
- className: "flex-1 overflow-y-auto p-4 space-y-5",
60227
- children: emittersForList.length === 0 ? /*#__PURE__*/jsx("div", {
60228
- className: "text-sm opacity-60",
60229
- children: "No other widgets in this dashboard emit events."
60230
- }) : emittersForList.map(function (e) {
60231
- return /*#__PURE__*/jsxs("div", {
60232
- className: "space-y-1",
60233
- children: [/*#__PURE__*/jsxs("div", {
60234
- className: "flex flex-col gap-0.5 mb-1",
60235
- children: [/*#__PURE__*/jsx("div", {
60236
- className: "text-sm font-semibold",
60237
- children: e.label
60238
- }), (e.widgetRef || e.component) && /*#__PURE__*/jsx(Caption, {
60239
- block: true,
60240
- className: "font-mono truncate",
60241
- children: (e.widgetRef || e.component) + (e.itemId != null ? "[".concat(e.itemId, "]") : "")
60242
- })]
60243
- }), e.events.map(function (eventName) {
60244
- var key = "".concat(e.component, "|").concat(e.itemId, "|").concat(eventName);
60245
- var selected = wiredKeys.has(key);
60246
- return /*#__PURE__*/jsxs("label", {
60247
- className: "flex items-center gap-3 px-3 py-1.5 rounded-md cursor-pointer text-sm ".concat(selected ? "opacity-100" : "opacity-70 hover:opacity-100"),
60248
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
60249
- icon: selected ? "square-check" : "square",
60250
- className: "h-4 w-4 flex-shrink-0",
60251
- onClick: function onClick(ev) {
60252
- ev.preventDefault();
60253
- toggle({
60254
- sourceComponent: e.component,
60255
- sourceItemId: e.itemId,
60256
- eventName: eventName
60257
- });
60258
- }
60259
- }), /*#__PURE__*/jsx("span", {
60260
- children: eventName
60200
+ return (
60201
+ /*#__PURE__*/
60202
+ // Plain <div> — Card2's washed-out fill clashes with the modal chrome.
60203
+ jsxs("div", {
60204
+ className: "flex-1 min-w-0 overflow-hidden flex flex-col",
60205
+ children: [/*#__PURE__*/jsxs("div", {
60206
+ className: "flex-shrink-0 px-4 py-2 text-xs opacity-60",
60207
+ children: ["Check an event to fire ", /*#__PURE__*/jsx("code", {
60208
+ className: "text-xs",
60209
+ children: handlerName
60210
+ }), " on", " ", /*#__PURE__*/jsx("span", {
60211
+ className: "font-medium",
60212
+ children: receiver.label
60213
+ }), "."]
60214
+ }), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx("div", {
60215
+ className: "flex-1 overflow-y-auto p-4 space-y-5",
60216
+ children: emittersForList.length === 0 ? /*#__PURE__*/jsx("div", {
60217
+ className: "text-sm opacity-60",
60218
+ children: "No other widgets in this dashboard emit events."
60219
+ }) : emittersForList.map(function (e) {
60220
+ return /*#__PURE__*/jsxs("div", {
60221
+ className: "space-y-1",
60222
+ children: [/*#__PURE__*/jsxs("div", {
60223
+ className: "flex flex-col gap-0.5 mb-1",
60224
+ children: [/*#__PURE__*/jsx("div", {
60225
+ className: "text-sm font-semibold",
60226
+ children: e.label
60227
+ }), (e.widgetRef || e.component) && /*#__PURE__*/jsx(Caption, {
60228
+ block: true,
60229
+ className: "font-mono truncate",
60230
+ children: (e.widgetRef || e.component) + (e.itemId != null ? "[".concat(e.itemId, "]") : "")
60261
60231
  })]
60262
- }, key);
60263
- })]
60264
- }, e.key || "".concat(e.component, "|").concat(e.itemId));
60265
- })
60266
- })]
60267
- });
60232
+ }), e.events.map(function (eventName) {
60233
+ var key = "".concat(e.component, "|").concat(e.itemId, "|").concat(eventName);
60234
+ var selected = wiredKeys.has(key);
60235
+ return /*#__PURE__*/jsxs("label", {
60236
+ className: "flex items-center gap-3 px-3 py-1.5 rounded-md cursor-pointer text-sm ".concat(selected ? "opacity-100" : "opacity-70 hover:opacity-100"),
60237
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
60238
+ icon: selected ? "square-check" : "square",
60239
+ className: "h-4 w-4 flex-shrink-0",
60240
+ onClick: function onClick(ev) {
60241
+ ev.preventDefault();
60242
+ toggle({
60243
+ sourceComponent: e.component,
60244
+ sourceItemId: e.itemId,
60245
+ eventName: eventName
60246
+ });
60247
+ }
60248
+ }), /*#__PURE__*/jsx("span", {
60249
+ children: eventName
60250
+ })]
60251
+ }, key);
60252
+ })]
60253
+ }, e.key || "".concat(e.component, "|").concat(e.itemId));
60254
+ })
60255
+ })]
60256
+ })
60257
+ );
60268
60258
  }
60269
60259
 
60270
60260
  function ownKeys$9(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; }