@trops/dash-core 0.1.420 → 0.1.422

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
@@ -8967,7 +8967,7 @@ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBu
8967
8967
  var hasPropertyDescriptors_1 = hasPropertyDescriptors;
8968
8968
 
8969
8969
  var keys = objectKeys$2;
8970
- var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
8970
+ var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
8971
8971
 
8972
8972
  var toStr$4 = Object.prototype.toString;
8973
8973
  var concat = Array.prototype.concat;
@@ -9000,7 +9000,7 @@ var defineProperty$1 = function (object, name, value, predicate) {
9000
9000
  var defineProperties$1 = function (object, map) {
9001
9001
  var predicates = arguments.length > 2 ? arguments[2] : {};
9002
9002
  var props = keys(map);
9003
- if (hasSymbols$4) {
9003
+ if (hasSymbols$5) {
9004
9004
  props = concat.call(props, Object.getOwnPropertySymbols(map));
9005
9005
  }
9006
9006
  for (var i = 0; i < props.length; i += 1) {
@@ -9066,11 +9066,11 @@ var sign$1 = function sign(number) {
9066
9066
  };
9067
9067
 
9068
9068
  var shams$1;
9069
- var hasRequiredShams$1;
9069
+ var hasRequiredShams;
9070
9070
 
9071
- function requireShams$1 () {
9072
- if (hasRequiredShams$1) return shams$1;
9073
- hasRequiredShams$1 = 1;
9071
+ function requireShams () {
9072
+ if (hasRequiredShams) return shams$1;
9073
+ hasRequiredShams = 1;
9074
9074
 
9075
9075
  /** @type {import('./shams')} */
9076
9076
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
@@ -9119,10 +9119,10 @@ function requireShams$1 () {
9119
9119
  }
9120
9120
 
9121
9121
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
9122
- var hasSymbolSham = requireShams$1();
9122
+ var hasSymbolSham = requireShams();
9123
9123
 
9124
9124
  /** @type {import('.')} */
9125
- var hasSymbols$3 = function hasNativeSymbols() {
9125
+ var hasSymbols$4 = function hasNativeSymbols() {
9126
9126
  if (typeof origSymbol !== 'function') { return false; }
9127
9127
  if (typeof Symbol !== 'function') { return false; }
9128
9128
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -9426,7 +9426,7 @@ var ThrowTypeError = $gOPD$1
9426
9426
  }())
9427
9427
  : throwTypeError;
9428
9428
 
9429
- var hasSymbols$2 = hasSymbols$3();
9429
+ var hasSymbols$3 = hasSymbols$4();
9430
9430
 
9431
9431
  var getProto$2 = getProto$3;
9432
9432
  var $ObjectGPO = requireObject_getPrototypeOf();
@@ -9444,7 +9444,7 @@ var INTRINSICS = {
9444
9444
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
9445
9445
  '%Array%': Array,
9446
9446
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
9447
- '%ArrayIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9447
+ '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9448
9448
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
9449
9449
  '%AsyncFunction%': needsEval,
9450
9450
  '%AsyncGenerator%': needsEval,
@@ -9475,10 +9475,10 @@ var INTRINSICS = {
9475
9475
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
9476
9476
  '%isFinite%': isFinite,
9477
9477
  '%isNaN%': isNaN,
9478
- '%IteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9478
+ '%IteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9479
9479
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
9480
9480
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
9481
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9481
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9482
9482
  '%Math%': Math,
9483
9483
  '%Number%': Number,
9484
9484
  '%Object%': $Object$2,
@@ -9492,11 +9492,11 @@ var INTRINSICS = {
9492
9492
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
9493
9493
  '%RegExp%': RegExp,
9494
9494
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
9495
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9495
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9496
9496
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
9497
9497
  '%String%': String,
9498
- '%StringIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9499
- '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
9498
+ '%StringIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9499
+ '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
9500
9500
  '%SyntaxError%': $SyntaxError$1,
9501
9501
  '%ThrowTypeError%': ThrowTypeError,
9502
9502
  '%TypedArray%': TypedArray,
@@ -9849,12 +9849,12 @@ var callBound$i = function callBoundIntrinsic(name, allowMissing) {
9849
9849
 
9850
9850
  // modified from https://github.com/es-shims/es6-shim
9851
9851
  var objectKeys$1 = objectKeys$2;
9852
- var hasSymbols$1 = requireShams$1()();
9852
+ var hasSymbols$2 = requireShams()();
9853
9853
  var callBound$h = callBound$i;
9854
9854
  var $Object$1 = esObjectAtoms;
9855
9855
  var $push = callBound$h('Array.prototype.push');
9856
9856
  var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
9857
- var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
9857
+ var originalGetSymbols = hasSymbols$2 ? $Object$1.getOwnPropertySymbols : null;
9858
9858
 
9859
9859
  // eslint-disable-next-line no-unused-vars
9860
9860
  var implementation$8 = function assign(target, source1) {
@@ -9868,7 +9868,7 @@ var implementation$8 = function assign(target, source1) {
9868
9868
 
9869
9869
  // step 3.a.ii:
9870
9870
  var keys = objectKeys$1(from);
9871
- var getSymbols = hasSymbols$1 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
9871
+ var getSymbols = hasSymbols$2 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
9872
9872
  if (getSymbols) {
9873
9873
  var syms = getSymbols(from);
9874
9874
  for (var j = 0; j < syms.length; ++j) {
@@ -10165,23 +10165,14 @@ var regexp_prototype_flags = flagsBound;
10165
10165
 
10166
10166
  var esGetIterator = {exports: {}};
10167
10167
 
10168
- var shams;
10169
- var hasRequiredShams;
10170
-
10171
- function requireShams () {
10172
- if (hasRequiredShams) return shams;
10173
- hasRequiredShams = 1;
10174
-
10175
- var hasSymbols = requireShams$1();
10168
+ var hasSymbols$1 = requireShams();
10176
10169
 
10177
- /** @type {import('.')} */
10178
- shams = function hasToStringTagShams() {
10179
- return hasSymbols() && !!Symbol.toStringTag;
10180
- };
10181
- return shams;
10182
- }
10170
+ /** @type {import('.')} */
10171
+ var shams = function hasToStringTagShams() {
10172
+ return hasSymbols$1() && !!Symbol.toStringTag;
10173
+ };
10183
10174
 
10184
- var hasToStringTag$7 = requireShams()();
10175
+ var hasToStringTag$7 = shams();
10185
10176
  var callBound$f = callBound$i;
10186
10177
 
10187
10178
  var $toString$7 = callBound$f('Object.prototype.toString');
@@ -11218,7 +11209,7 @@ var tryStringObject = function tryStringObject(value) {
11218
11209
  /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
11219
11210
  var $toString$6 = callBound$c('Object.prototype.toString');
11220
11211
  var strClass = '[object String]';
11221
- var hasToStringTag$6 = requireShams()();
11212
+ var hasToStringTag$6 = shams();
11222
11213
 
11223
11214
  /** @type {import('.')} */
11224
11215
  var isString$2 = function isString(value) {
@@ -11334,7 +11325,7 @@ var isSet$2 = exported$1 || function isSet(x) {
11334
11325
  var isArguments$1 = isArguments$2;
11335
11326
  var getStopIterationIterator = stopIterationIterator;
11336
11327
 
11337
- if (hasSymbols$3() || requireShams$1()()) {
11328
+ if (hasSymbols$4() || requireShams()()) {
11338
11329
  var $iterator = Symbol.iterator;
11339
11330
  // Symbol is available natively or shammed
11340
11331
  // natively:
@@ -11623,7 +11614,7 @@ var tryDateObject = function tryDateGetDayCall(value) {
11623
11614
  /** @type {(value: unknown) => string} */
11624
11615
  var toStr$2 = callBound$9('Object.prototype.toString');
11625
11616
  var dateClass = '[object Date]';
11626
- var hasToStringTag$5 = requireShams()();
11617
+ var hasToStringTag$5 = shams();
11627
11618
 
11628
11619
  /** @type {import('.')} */
11629
11620
  var isDateObject = function isDateObject(value) {
@@ -11634,7 +11625,7 @@ var isDateObject = function isDateObject(value) {
11634
11625
  };
11635
11626
 
11636
11627
  var callBound$8 = callBound$i;
11637
- var hasToStringTag$4 = requireShams()();
11628
+ var hasToStringTag$4 = shams();
11638
11629
  var hasOwn = hasown;
11639
11630
  var gOPD$1 = gopd$1;
11640
11631
 
@@ -11739,7 +11730,7 @@ var tryNumberObject = function tryNumberObject(value) {
11739
11730
  };
11740
11731
  var $toString$3 = callBound$6('Object.prototype.toString');
11741
11732
  var numClass = '[object Number]';
11742
- var hasToStringTag$3 = requireShams()();
11733
+ var hasToStringTag$3 = shams();
11743
11734
 
11744
11735
  /** @type {import('.')} */
11745
11736
  var isNumberObject = function isNumberObject(value) {
@@ -11766,7 +11757,7 @@ var tryBooleanObject = function booleanBrandCheck(value) {
11766
11757
  }
11767
11758
  };
11768
11759
  var boolClass = '[object Boolean]';
11769
- var hasToStringTag$2 = requireShams()();
11760
+ var hasToStringTag$2 = shams();
11770
11761
 
11771
11762
  /** @type {import('.')} */
11772
11763
  var isBooleanObject = function isBoolean(value) {
@@ -11808,7 +11799,7 @@ function requireSafeRegexTest () {
11808
11799
 
11809
11800
  var callBound$4 = callBound$i;
11810
11801
  var $toString$1 = callBound$4('Object.prototype.toString');
11811
- var hasSymbols = hasSymbols$3();
11802
+ var hasSymbols = hasSymbols$4();
11812
11803
  var safeRegexTest = requireSafeRegexTest();
11813
11804
 
11814
11805
  if (hasSymbols) {
@@ -12254,7 +12245,7 @@ var gOPD = gopd$1;
12254
12245
  var getProto = getProto$3;
12255
12246
 
12256
12247
  var $toString = callBound$2('Object.prototype.toString');
12257
- var hasToStringTag = requireShams()();
12248
+ var hasToStringTag = shams();
12258
12249
 
12259
12250
  var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
12260
12251
  var typedArrays = availableTypedArrays();
@@ -18803,7 +18794,32 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
18803
18794
  var isWidgetMissing = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) && !widgetConfig;
18804
18795
 
18805
18796
  // Get widget name from config or item
18806
- var widgetName = (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component);
18797
+ var widgetName = (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.displayName) || (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component);
18798
+
18799
+ // Build a scope/package subtitle so ambiguous component names like
18800
+ // `ProspectListColumn` (which might come from `@ai-built/…` or
18801
+ // `@trops/pipeline`) are disambiguated in the layout builder. Derives
18802
+ // from whatever identity the config / layout item carries:
18803
+ // - widgetConfig.id: e.g. "@ai-built/prospectlistcolumn.ProspectListColumn"
18804
+ // - widgetConfig.package: e.g. "@ai-built/prospectlistcolumn"
18805
+ // - widgetItem.workspace: fallback hint ("ai-built" / "@trops/pipeline")
18806
+ // Falls back to empty string so we can skip rendering if we have
18807
+ // nothing meaningful beyond the component name itself.
18808
+ var packageLabel = function () {
18809
+ var dropTrailingComponent = function dropTrailingComponent(s) {
18810
+ if (typeof s !== "string") return "";
18811
+ var lastDot = s.lastIndexOf(".");
18812
+ return lastDot > 0 ? s.slice(0, lastDot) : s;
18813
+ };
18814
+ var fromId = dropTrailingComponent((widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.id) || "");
18815
+ if (fromId) return fromId;
18816
+ if (widgetConfig !== null && widgetConfig !== void 0 && widgetConfig["package"]) return String(widgetConfig["package"]);
18817
+ var wsHint = widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.workspace;
18818
+ if (typeof wsHint === "string" && wsHint && wsHint !== "layout") {
18819
+ return wsHint.startsWith("@") ? wsHint : "@".concat(wsHint);
18820
+ }
18821
+ return "";
18822
+ }();
18807
18823
 
18808
18824
  // Get provider requirements from widget config (not from item directly)
18809
18825
  // Filter out providerClass: "api" so only user-configurable providers show badges
@@ -18942,11 +18958,18 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
18942
18958
  children: [/*#__PURE__*/jsx(WidgetIcon, {
18943
18959
  icon: isWidgetMissing ? "triangle-exclamation" : widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.icon,
18944
18960
  className: "h-4 w-4 flex-shrink-0 ".concat(isWidgetMissing ? "text-amber-500" : "text-white/60")
18945
- }), /*#__PURE__*/jsxs("span", {
18946
- className: "font-medium text-sm text-gray-100 truncate",
18947
- children: [widgetName || cellNumber || "Empty", isWidgetMissing && /*#__PURE__*/jsx("span", {
18948
- className: "text-amber-500/70 font-normal ml-1",
18949
- children: "(not found)"
18961
+ }), /*#__PURE__*/jsxs("div", {
18962
+ className: "flex flex-col min-w-0 leading-tight",
18963
+ children: [/*#__PURE__*/jsxs("span", {
18964
+ className: "font-medium text-sm text-gray-100 truncate",
18965
+ children: [widgetName || cellNumber || "Empty", isWidgetMissing && /*#__PURE__*/jsx("span", {
18966
+ className: "text-amber-500/70 font-normal ml-1",
18967
+ children: "(not found)"
18968
+ })]
18969
+ }), packageLabel && /*#__PURE__*/jsxs("span", {
18970
+ className: "text-[10px] text-gray-500 truncate",
18971
+ title: "".concat(packageLabel, " \xB7 ").concat((widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) || ""),
18972
+ children: [packageLabel, widgetItem !== null && widgetItem !== void 0 && widgetItem.component && widgetItem.component !== widgetName ? " \xB7 ".concat(widgetItem.component) : ""]
18950
18973
  })]
18951
18974
  })]
18952
18975
  }), (providerRequirements.length > 0 || overflowActions.length > 0 || onMoreOptions) && /*#__PURE__*/jsxs("div", {
@@ -20701,6 +20724,17 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
20701
20724
  wsRef.current = currentWorkspace;
20702
20725
  }, [currentWorkspace]);
20703
20726
 
20727
+ // Stable ref to onWorkspaceChange so the window-event handlers below can
20728
+ // propagate mutations upstream without resubscribing on every render.
20729
+ // Without this, swap/place handlers only update LayoutBuilder-local
20730
+ // state — the parent (PinnedSidebar / PageLayoutBuilder) never learns
20731
+ // about the change, so the next parent re-render reverts it via the
20732
+ // `[workspace]` useEffect above and the save path reads stale state.
20733
+ var onWorkspaceChangeRef = useRef(onWorkspaceChange);
20734
+ useEffect(function () {
20735
+ onWorkspaceChangeRef.current = onWorkspaceChange;
20736
+ }, [onWorkspaceChange]);
20737
+
20704
20738
  // Listen for AI widget builder placement — modifies layout state directly
20705
20739
  useEffect(function () {
20706
20740
  var handler = function handler(e) {
@@ -20737,6 +20771,9 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
20737
20771
  var newWorkspace = JSON.parse(JSON.stringify(ws));
20738
20772
  newWorkspace.layout = newLayout;
20739
20773
  setCurrentWorkspace(newWorkspace);
20774
+ if (typeof onWorkspaceChangeRef.current === "function") {
20775
+ onWorkspaceChangeRef.current(newWorkspace);
20776
+ }
20740
20777
  } catch (err) {
20741
20778
  }
20742
20779
  };
@@ -20771,6 +20808,9 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
20771
20808
  var newWorkspace = JSON.parse(JSON.stringify(ws));
20772
20809
  newWorkspace.layout = newLayout;
20773
20810
  setCurrentWorkspace(newWorkspace);
20811
+ if (typeof onWorkspaceChangeRef.current === "function") {
20812
+ onWorkspaceChangeRef.current(newWorkspace);
20813
+ }
20774
20814
  } catch (err) {
20775
20815
  }
20776
20816
  };
@@ -55800,13 +55840,31 @@ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t
55800
55840
  * widget currently in the workspace's layout tree. Keys drive
55801
55841
  * listener pruning; the itemId set drives provider-binding pruning
55802
55842
  * (selectedProviders is keyed by raw widgetId).
55843
+ *
55844
+ * Listener event strings are written as `${component}[${itemId}].${event}`
55845
+ * where `itemId` is whichever id-ish field the emitter had at wire time
55846
+ * (in practice `itemIdOf` prefers numeric `id`). `canonicalItemKey`'s
55847
+ * preference order (uuidString → uuid → id) doesn't match that, and
55848
+ * `LayoutModel` decorates every persisted item with a composite
55849
+ * `uuid = "${dashboardId}-${component}-${id}"` while leaving
55850
+ * `uuidString` unset — so canonicalItemKey would produce
55851
+ * `Component|{dashId}-{Component}-{123}` while the event string produces
55852
+ * `Component|123`. Record every id-ish form as a separate live key so
55853
+ * reconciliation is tolerant of whichever shape the stored binding
55854
+ * carries.
55803
55855
  */
55804
55856
  function collectLiveIdentity(workspace) {
55805
55857
  var liveCanonicalKeys = new Set();
55806
55858
  var liveItemIds = new Set();
55807
55859
  forEachWidget(workspace, function (item) {
55808
- var key = canonicalItemKey(item);
55809
- if (key) liveCanonicalKeys.add(key);
55860
+ var comp = item.component;
55861
+ if (comp) {
55862
+ if (item.id != null) liveCanonicalKeys.add("".concat(comp, "|").concat(item.id));
55863
+ if (item.uuidString) {
55864
+ liveCanonicalKeys.add("".concat(comp, "|").concat(item.uuidString));
55865
+ }
55866
+ if (item.uuid) liveCanonicalKeys.add("".concat(comp, "|").concat(item.uuid));
55867
+ }
55810
55868
  // Track every id-ish the runtime might key by. selectedProviders
55811
55869
  // uses `item.uuidString` or `item.uuid` or `item.id` depending on
55812
55870
  // when the binding was written, so accept any of them.