@trops/dash-core 0.1.414 → 0.1.416

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
@@ -8985,7 +8985,7 @@ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBu
8985
8985
  var hasPropertyDescriptors_1 = hasPropertyDescriptors;
8986
8986
 
8987
8987
  var keys = objectKeys$2;
8988
- var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
8988
+ var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
8989
8989
 
8990
8990
  var toStr$4 = Object.prototype.toString;
8991
8991
  var concat = Array.prototype.concat;
@@ -9018,7 +9018,7 @@ var defineProperty$1 = function (object, name, value, predicate) {
9018
9018
  var defineProperties$1 = function (object, map) {
9019
9019
  var predicates = arguments.length > 2 ? arguments[2] : {};
9020
9020
  var props = keys(map);
9021
- if (hasSymbols$5) {
9021
+ if (hasSymbols$4) {
9022
9022
  props = concat.call(props, Object.getOwnPropertySymbols(map));
9023
9023
  }
9024
9024
  for (var i = 0; i < props.length; i += 1) {
@@ -9084,11 +9084,11 @@ var sign$1 = function sign(number) {
9084
9084
  };
9085
9085
 
9086
9086
  var shams$1;
9087
- var hasRequiredShams;
9087
+ var hasRequiredShams$1;
9088
9088
 
9089
- function requireShams () {
9090
- if (hasRequiredShams) return shams$1;
9091
- hasRequiredShams = 1;
9089
+ function requireShams$1 () {
9090
+ if (hasRequiredShams$1) return shams$1;
9091
+ hasRequiredShams$1 = 1;
9092
9092
 
9093
9093
  /** @type {import('./shams')} */
9094
9094
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
@@ -9137,10 +9137,10 @@ function requireShams () {
9137
9137
  }
9138
9138
 
9139
9139
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
9140
- var hasSymbolSham = requireShams();
9140
+ var hasSymbolSham = requireShams$1();
9141
9141
 
9142
9142
  /** @type {import('.')} */
9143
- var hasSymbols$4 = function hasNativeSymbols() {
9143
+ var hasSymbols$3 = function hasNativeSymbols() {
9144
9144
  if (typeof origSymbol !== 'function') { return false; }
9145
9145
  if (typeof Symbol !== 'function') { return false; }
9146
9146
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -9444,7 +9444,7 @@ var ThrowTypeError = $gOPD$1
9444
9444
  }())
9445
9445
  : throwTypeError;
9446
9446
 
9447
- var hasSymbols$3 = hasSymbols$4();
9447
+ var hasSymbols$2 = hasSymbols$3();
9448
9448
 
9449
9449
  var getProto$2 = getProto$3;
9450
9450
  var $ObjectGPO = requireObject_getPrototypeOf();
@@ -9462,7 +9462,7 @@ var INTRINSICS = {
9462
9462
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
9463
9463
  '%Array%': Array,
9464
9464
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
9465
- '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9465
+ '%ArrayIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9466
9466
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
9467
9467
  '%AsyncFunction%': needsEval,
9468
9468
  '%AsyncGenerator%': needsEval,
@@ -9493,10 +9493,10 @@ var INTRINSICS = {
9493
9493
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
9494
9494
  '%isFinite%': isFinite,
9495
9495
  '%isNaN%': isNaN,
9496
- '%IteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9496
+ '%IteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9497
9497
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
9498
9498
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
9499
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9499
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9500
9500
  '%Math%': Math,
9501
9501
  '%Number%': Number,
9502
9502
  '%Object%': $Object$2,
@@ -9510,11 +9510,11 @@ var INTRINSICS = {
9510
9510
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
9511
9511
  '%RegExp%': RegExp,
9512
9512
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
9513
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9513
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9514
9514
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
9515
9515
  '%String%': String,
9516
- '%StringIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9517
- '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
9516
+ '%StringIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9517
+ '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
9518
9518
  '%SyntaxError%': $SyntaxError$1,
9519
9519
  '%ThrowTypeError%': ThrowTypeError,
9520
9520
  '%TypedArray%': TypedArray,
@@ -9867,12 +9867,12 @@ var callBound$i = function callBoundIntrinsic(name, allowMissing) {
9867
9867
 
9868
9868
  // modified from https://github.com/es-shims/es6-shim
9869
9869
  var objectKeys$1 = objectKeys$2;
9870
- var hasSymbols$2 = requireShams()();
9870
+ var hasSymbols$1 = requireShams$1()();
9871
9871
  var callBound$h = callBound$i;
9872
9872
  var $Object$1 = esObjectAtoms;
9873
9873
  var $push = callBound$h('Array.prototype.push');
9874
9874
  var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
9875
- var originalGetSymbols = hasSymbols$2 ? $Object$1.getOwnPropertySymbols : null;
9875
+ var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
9876
9876
 
9877
9877
  // eslint-disable-next-line no-unused-vars
9878
9878
  var implementation$8 = function assign(target, source1) {
@@ -9886,7 +9886,7 @@ var implementation$8 = function assign(target, source1) {
9886
9886
 
9887
9887
  // step 3.a.ii:
9888
9888
  var keys = objectKeys$1(from);
9889
- var getSymbols = hasSymbols$2 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
9889
+ var getSymbols = hasSymbols$1 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
9890
9890
  if (getSymbols) {
9891
9891
  var syms = getSymbols(from);
9892
9892
  for (var j = 0; j < syms.length; ++j) {
@@ -10183,14 +10183,23 @@ var regexp_prototype_flags = flagsBound;
10183
10183
 
10184
10184
  var esGetIterator = {exports: {}};
10185
10185
 
10186
- var hasSymbols$1 = requireShams();
10186
+ var shams;
10187
+ var hasRequiredShams;
10187
10188
 
10188
- /** @type {import('.')} */
10189
- var shams = function hasToStringTagShams() {
10190
- return hasSymbols$1() && !!Symbol.toStringTag;
10191
- };
10189
+ function requireShams () {
10190
+ if (hasRequiredShams) return shams;
10191
+ hasRequiredShams = 1;
10192
+
10193
+ var hasSymbols = requireShams$1();
10194
+
10195
+ /** @type {import('.')} */
10196
+ shams = function hasToStringTagShams() {
10197
+ return hasSymbols() && !!Symbol.toStringTag;
10198
+ };
10199
+ return shams;
10200
+ }
10192
10201
 
10193
- var hasToStringTag$7 = shams();
10202
+ var hasToStringTag$7 = requireShams()();
10194
10203
  var callBound$f = callBound$i;
10195
10204
 
10196
10205
  var $toString$7 = callBound$f('Object.prototype.toString');
@@ -11227,7 +11236,7 @@ var tryStringObject = function tryStringObject(value) {
11227
11236
  /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
11228
11237
  var $toString$6 = callBound$c('Object.prototype.toString');
11229
11238
  var strClass = '[object String]';
11230
- var hasToStringTag$6 = shams();
11239
+ var hasToStringTag$6 = requireShams()();
11231
11240
 
11232
11241
  /** @type {import('.')} */
11233
11242
  var isString$2 = function isString(value) {
@@ -11343,7 +11352,7 @@ var isSet$2 = exported$1 || function isSet(x) {
11343
11352
  var isArguments$1 = isArguments$2;
11344
11353
  var getStopIterationIterator = stopIterationIterator;
11345
11354
 
11346
- if (hasSymbols$4() || requireShams()()) {
11355
+ if (hasSymbols$3() || requireShams$1()()) {
11347
11356
  var $iterator = Symbol.iterator;
11348
11357
  // Symbol is available natively or shammed
11349
11358
  // natively:
@@ -11632,7 +11641,7 @@ var tryDateObject = function tryDateGetDayCall(value) {
11632
11641
  /** @type {(value: unknown) => string} */
11633
11642
  var toStr$2 = callBound$9('Object.prototype.toString');
11634
11643
  var dateClass = '[object Date]';
11635
- var hasToStringTag$5 = shams();
11644
+ var hasToStringTag$5 = requireShams()();
11636
11645
 
11637
11646
  /** @type {import('.')} */
11638
11647
  var isDateObject = function isDateObject(value) {
@@ -11643,7 +11652,7 @@ var isDateObject = function isDateObject(value) {
11643
11652
  };
11644
11653
 
11645
11654
  var callBound$8 = callBound$i;
11646
- var hasToStringTag$4 = shams();
11655
+ var hasToStringTag$4 = requireShams()();
11647
11656
  var hasOwn = hasown;
11648
11657
  var gOPD$1 = gopd$1;
11649
11658
 
@@ -11748,7 +11757,7 @@ var tryNumberObject = function tryNumberObject(value) {
11748
11757
  };
11749
11758
  var $toString$3 = callBound$6('Object.prototype.toString');
11750
11759
  var numClass = '[object Number]';
11751
- var hasToStringTag$3 = shams();
11760
+ var hasToStringTag$3 = requireShams()();
11752
11761
 
11753
11762
  /** @type {import('.')} */
11754
11763
  var isNumberObject = function isNumberObject(value) {
@@ -11775,7 +11784,7 @@ var tryBooleanObject = function booleanBrandCheck(value) {
11775
11784
  }
11776
11785
  };
11777
11786
  var boolClass = '[object Boolean]';
11778
- var hasToStringTag$2 = shams();
11787
+ var hasToStringTag$2 = requireShams()();
11779
11788
 
11780
11789
  /** @type {import('.')} */
11781
11790
  var isBooleanObject = function isBoolean(value) {
@@ -11817,7 +11826,7 @@ function requireSafeRegexTest () {
11817
11826
 
11818
11827
  var callBound$4 = callBound$i;
11819
11828
  var $toString$1 = callBound$4('Object.prototype.toString');
11820
- var hasSymbols = hasSymbols$4();
11829
+ var hasSymbols = hasSymbols$3();
11821
11830
  var safeRegexTest = requireSafeRegexTest();
11822
11831
 
11823
11832
  if (hasSymbols) {
@@ -12263,7 +12272,7 @@ var gOPD = gopd$1;
12263
12272
  var getProto = getProto$3;
12264
12273
 
12265
12274
  var $toString = callBound$2('Object.prototype.toString');
12266
- var hasToStringTag = shams();
12275
+ var hasToStringTag = requireShams()();
12267
12276
 
12268
12277
  var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
12269
12278
  var typedArrays = availableTypedArrays();
@@ -50497,6 +50506,13 @@ var PackageItem = function PackageItem(_ref6) {
50497
50506
  _useState18 = _slicedToArray(_useState17, 2),
50498
50507
  deleting = _useState18[0],
50499
50508
  setDeleting = _useState18[1];
50509
+ // Last delete-attempt error. Rendered inline next to the delete
50510
+ // button so a failed attempt surfaces its cause (auth expired, 404,
50511
+ // server 500, network) instead of silently resetting.
50512
+ var _useState19 = React.useState(null),
50513
+ _useState20 = _slicedToArray(_useState19, 2),
50514
+ deleteError = _useState20[0],
50515
+ setDeleteError = _useState20[1];
50500
50516
  function handleSave() {
50501
50517
  return _handleSave2.apply(this, arguments);
50502
50518
  }
@@ -50546,34 +50562,44 @@ var PackageItem = function PackageItem(_ref6) {
50546
50562
  }
50547
50563
  function _handleDelete() {
50548
50564
  _handleDelete = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
50549
- var _window$mainApi5, result;
50565
+ var _window$mainApi5, result, _t4;
50550
50566
  return _regeneratorRuntime.wrap(function (_context4) {
50551
50567
  while (1) switch (_context4.prev = _context4.next) {
50552
50568
  case 0:
50553
50569
  setDeleting(true);
50570
+ setDeleteError(null);
50554
50571
  _context4.prev = 1;
50555
50572
  _context4.next = 2;
50556
50573
  return (_window$mainApi5 = window.mainApi) === null || _window$mainApi5 === void 0 || (_window$mainApi5 = _window$mainApi5.registryAuth) === null || _window$mainApi5 === void 0 ? void 0 : _window$mainApi5.deletePackage(pkg.scope, pkg.name);
50557
50574
  case 2:
50558
50575
  result = _context4.sent;
50559
- if (result) {
50560
- onDeleted === null || onDeleted === void 0 || onDeleted();
50576
+ if (!(result !== null && result !== void 0 && result.success)) {
50577
+ _context4.next = 3;
50578
+ break;
50561
50579
  }
50562
- _context4.next = 4;
50563
- break;
50580
+ onDeleted === null || onDeleted === void 0 || onDeleted();
50581
+ return _context4.abrupt("return");
50564
50582
  case 3:
50565
- _context4.prev = 3;
50566
- _context4["catch"](1);
50583
+ // New error-surface format: `{ success, error, status }`. Show
50584
+ // the server-reported reason so the user (or the next bug
50585
+ // reporter) knows exactly why the delete failed.
50586
+ setDeleteError((result === null || result === void 0 ? void 0 : result.error) || (result !== null && result !== void 0 && result.status ? "Delete failed (".concat(result.status, ")") : "Delete failed — no response from registry."));
50587
+ _context4.next = 5;
50588
+ break;
50567
50589
  case 4:
50568
50590
  _context4.prev = 4;
50591
+ _t4 = _context4["catch"](1);
50592
+ setDeleteError("Unexpected error: ".concat((_t4 === null || _t4 === void 0 ? void 0 : _t4.message) || String(_t4)));
50593
+ case 5:
50594
+ _context4.prev = 5;
50569
50595
  setDeleting(false);
50570
50596
  setConfirmingDelete(false);
50571
- return _context4.finish(4);
50572
- case 5:
50597
+ return _context4.finish(5);
50598
+ case 6:
50573
50599
  case "end":
50574
50600
  return _context4.stop();
50575
50601
  }
50576
- }, _callee4, null, [[1, 3, 4, 5]]);
50602
+ }, _callee4, null, [[1, 4, 5, 6]]);
50577
50603
  }));
50578
50604
  return _handleDelete.apply(this, arguments);
50579
50605
  }
@@ -50639,8 +50665,9 @@ var PackageItem = function PackageItem(_ref6) {
50639
50665
  })]
50640
50666
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
50641
50667
  className: "flex items-center justify-between",
50642
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
50643
- children: confirmingDelete ? /*#__PURE__*/jsxRuntime.jsxs("div", {
50668
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
50669
+ className: "flex items-center gap-3",
50670
+ children: [confirmingDelete ? /*#__PURE__*/jsxRuntime.jsxs("div", {
50644
50671
  className: "flex items-center gap-2",
50645
50672
  children: [/*#__PURE__*/jsxRuntime.jsx("button", {
50646
50673
  type: "button",
@@ -50651,7 +50678,8 @@ var PackageItem = function PackageItem(_ref6) {
50651
50678
  }), /*#__PURE__*/jsxRuntime.jsx("button", {
50652
50679
  type: "button",
50653
50680
  onClick: function onClick() {
50654
- return setConfirmingDelete(false);
50681
+ setConfirmingDelete(false);
50682
+ setDeleteError(null);
50655
50683
  },
50656
50684
  className: "text-xs opacity-50 hover:opacity-80 cursor-pointer",
50657
50685
  children: "Cancel"
@@ -50659,11 +50687,16 @@ var PackageItem = function PackageItem(_ref6) {
50659
50687
  }) : /*#__PURE__*/jsxRuntime.jsx("button", {
50660
50688
  type: "button",
50661
50689
  onClick: function onClick() {
50662
- return setConfirmingDelete(true);
50690
+ setConfirmingDelete(true);
50691
+ setDeleteError(null);
50663
50692
  },
50664
50693
  className: "text-xs text-red-400/70 hover:text-red-400 cursor-pointer",
50665
50694
  children: "Delete"
50666
- })
50695
+ }), deleteError && /*#__PURE__*/jsxRuntime.jsx("span", {
50696
+ className: "text-[11px] text-red-400 max-w-sm truncate",
50697
+ title: deleteError,
50698
+ children: deleteError
50699
+ })]
50667
50700
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
50668
50701
  className: "flex items-center gap-2",
50669
50702
  children: [/*#__PURE__*/jsxRuntime.jsx("button", {
@@ -54360,6 +54393,24 @@ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r
54360
54393
  function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
54361
54394
  var ALL_WIDGETS_ID = "__ALL__";
54362
54395
 
54396
+ /**
54397
+ * Build the scoped registry identifier for a widget. Surfaces the
54398
+ * `scope.packageName.component` triple in the settings UI so users
54399
+ * can verify what a widget's registry identity is — useful when
54400
+ * diagnosing dashboard-install warnings ("why didn't this widget
54401
+ * install?" → scoped id in the warning vs scoped id shown here).
54402
+ * Returns just the component name when scope/package metadata is
54403
+ * unavailable (e.g. bare built-ins).
54404
+ */
54405
+ function buildScopedId(widget) {
54406
+ if (!(widget !== null && widget !== void 0 && widget.component)) return null;
54407
+ var scope = widget.scope ? String(widget.scope).replace(/^@/, "") : null;
54408
+ var pkg = widget.packageName ? scope ? String(widget.packageName).replace(new RegExp("^@?".concat(scope, "/")), "") : String(widget.packageName).replace(/^@/, "") : null;
54409
+ if (scope && pkg) return "".concat(scope, ".").concat(pkg, ".").concat(widget.component);
54410
+ if (pkg) return "".concat(pkg, ".").concat(widget.component);
54411
+ return widget.component;
54412
+ }
54413
+
54363
54414
  /**
54364
54415
  * WidgetsTab
54365
54416
  *
@@ -54407,7 +54458,12 @@ var WidgetsTab = function WidgetsTab(_ref) {
54407
54458
  displayName: item.name || cfg.name || cfg.displayName || item.component,
54408
54459
  section: section,
54409
54460
  userConfig: cfg.userConfig || {},
54410
- userPrefs: item.userPrefs || {}
54461
+ userPrefs: item.userPrefs || {},
54462
+ // Identity fields for the registry-identifier label. Prefer
54463
+ // values from the widget's component manager entry since the
54464
+ // layout item itself often doesn't carry scope/packageName.
54465
+ scope: cfg.scope || item.scope || null,
54466
+ packageName: cfg.packageName || cfg.name || item.packageName || null
54411
54467
  });
54412
54468
  };
54413
54469
  };
@@ -54575,6 +54631,7 @@ function SingleWidgetPane(_ref4) {
54575
54631
  effectivePrefs = _ref4.effectivePrefs,
54576
54632
  onFieldChange = _ref4.onFieldChange;
54577
54633
  var hasFields = Object.keys(widget.userConfig).length > 0;
54634
+ var scopedId = buildScopedId(widget);
54578
54635
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
54579
54636
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
54580
54637
  className: "mb-3",
@@ -54584,6 +54641,10 @@ function SingleWidgetPane(_ref4) {
54584
54641
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
54585
54642
  className: "text-xs text-gray-500",
54586
54643
  children: [widget.component, " \xB7 ", widget.section]
54644
+ }), scopedId && scopedId !== widget.component && /*#__PURE__*/jsxRuntime.jsx("code", {
54645
+ className: "block mt-1 text-[11px] text-gray-500 font-mono truncate",
54646
+ title: scopedId,
54647
+ children: scopedId
54587
54648
  })]
54588
54649
  }), hasFields ? /*#__PURE__*/jsxRuntime.jsx(PanelEditForm, {
54589
54650
  userConfig: widget.userConfig,