@trops/dash-core 0.1.351 → 0.1.353

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
@@ -8736,7 +8736,7 @@ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBu
8736
8736
  var hasPropertyDescriptors_1 = hasPropertyDescriptors;
8737
8737
 
8738
8738
  var keys = objectKeys$2;
8739
- var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
8739
+ var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
8740
8740
 
8741
8741
  var toStr$4 = Object.prototype.toString;
8742
8742
  var concat = Array.prototype.concat;
@@ -8769,7 +8769,7 @@ var defineProperty$1 = function (object, name, value, predicate) {
8769
8769
  var defineProperties$1 = function (object, map) {
8770
8770
  var predicates = arguments.length > 2 ? arguments[2] : {};
8771
8771
  var props = keys(map);
8772
- if (hasSymbols$5) {
8772
+ if (hasSymbols$4) {
8773
8773
  props = concat.call(props, Object.getOwnPropertySymbols(map));
8774
8774
  }
8775
8775
  for (var i = 0; i < props.length; i += 1) {
@@ -8835,11 +8835,11 @@ var sign$1 = function sign(number) {
8835
8835
  };
8836
8836
 
8837
8837
  var shams$1;
8838
- var hasRequiredShams;
8838
+ var hasRequiredShams$1;
8839
8839
 
8840
- function requireShams () {
8841
- if (hasRequiredShams) return shams$1;
8842
- hasRequiredShams = 1;
8840
+ function requireShams$1 () {
8841
+ if (hasRequiredShams$1) return shams$1;
8842
+ hasRequiredShams$1 = 1;
8843
8843
 
8844
8844
  /** @type {import('./shams')} */
8845
8845
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
@@ -8888,10 +8888,10 @@ function requireShams () {
8888
8888
  }
8889
8889
 
8890
8890
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
8891
- var hasSymbolSham = requireShams();
8891
+ var hasSymbolSham = requireShams$1();
8892
8892
 
8893
8893
  /** @type {import('.')} */
8894
- var hasSymbols$4 = function hasNativeSymbols() {
8894
+ var hasSymbols$3 = function hasNativeSymbols() {
8895
8895
  if (typeof origSymbol !== 'function') { return false; }
8896
8896
  if (typeof Symbol !== 'function') { return false; }
8897
8897
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -9195,7 +9195,7 @@ var ThrowTypeError = $gOPD$1
9195
9195
  }())
9196
9196
  : throwTypeError;
9197
9197
 
9198
- var hasSymbols$3 = hasSymbols$4();
9198
+ var hasSymbols$2 = hasSymbols$3();
9199
9199
 
9200
9200
  var getProto$2 = getProto$3;
9201
9201
  var $ObjectGPO = requireObject_getPrototypeOf();
@@ -9213,7 +9213,7 @@ var INTRINSICS = {
9213
9213
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
9214
9214
  '%Array%': Array,
9215
9215
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
9216
- '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9216
+ '%ArrayIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
9217
9217
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
9218
9218
  '%AsyncFunction%': needsEval,
9219
9219
  '%AsyncGenerator%': needsEval,
@@ -9244,10 +9244,10 @@ var INTRINSICS = {
9244
9244
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
9245
9245
  '%isFinite%': isFinite,
9246
9246
  '%isNaN%': isNaN,
9247
- '%IteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9247
+ '%IteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
9248
9248
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
9249
9249
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
9250
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9250
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
9251
9251
  '%Math%': Math,
9252
9252
  '%Number%': Number,
9253
9253
  '%Object%': $Object$2,
@@ -9261,11 +9261,11 @@ var INTRINSICS = {
9261
9261
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
9262
9262
  '%RegExp%': RegExp,
9263
9263
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
9264
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9264
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
9265
9265
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
9266
9266
  '%String%': String,
9267
- '%StringIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9268
- '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
9267
+ '%StringIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
9268
+ '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
9269
9269
  '%SyntaxError%': $SyntaxError$1,
9270
9270
  '%ThrowTypeError%': ThrowTypeError,
9271
9271
  '%TypedArray%': TypedArray,
@@ -9618,12 +9618,12 @@ var callBound$i = function callBoundIntrinsic(name, allowMissing) {
9618
9618
 
9619
9619
  // modified from https://github.com/es-shims/es6-shim
9620
9620
  var objectKeys$1 = objectKeys$2;
9621
- var hasSymbols$2 = requireShams()();
9621
+ var hasSymbols$1 = requireShams$1()();
9622
9622
  var callBound$h = callBound$i;
9623
9623
  var $Object$1 = esObjectAtoms;
9624
9624
  var $push = callBound$h('Array.prototype.push');
9625
9625
  var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
9626
- var originalGetSymbols = hasSymbols$2 ? $Object$1.getOwnPropertySymbols : null;
9626
+ var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
9627
9627
 
9628
9628
  // eslint-disable-next-line no-unused-vars
9629
9629
  var implementation$8 = function assign(target, source1) {
@@ -9637,7 +9637,7 @@ var implementation$8 = function assign(target, source1) {
9637
9637
 
9638
9638
  // step 3.a.ii:
9639
9639
  var keys = objectKeys$1(from);
9640
- var getSymbols = hasSymbols$2 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
9640
+ var getSymbols = hasSymbols$1 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
9641
9641
  if (getSymbols) {
9642
9642
  var syms = getSymbols(from);
9643
9643
  for (var j = 0; j < syms.length; ++j) {
@@ -9934,14 +9934,23 @@ var regexp_prototype_flags = flagsBound;
9934
9934
 
9935
9935
  var esGetIterator = {exports: {}};
9936
9936
 
9937
- var hasSymbols$1 = requireShams();
9937
+ var shams;
9938
+ var hasRequiredShams;
9938
9939
 
9939
- /** @type {import('.')} */
9940
- var shams = function hasToStringTagShams() {
9941
- return hasSymbols$1() && !!Symbol.toStringTag;
9942
- };
9940
+ function requireShams () {
9941
+ if (hasRequiredShams) return shams;
9942
+ hasRequiredShams = 1;
9943
+
9944
+ var hasSymbols = requireShams$1();
9943
9945
 
9944
- var hasToStringTag$7 = shams();
9946
+ /** @type {import('.')} */
9947
+ shams = function hasToStringTagShams() {
9948
+ return hasSymbols() && !!Symbol.toStringTag;
9949
+ };
9950
+ return shams;
9951
+ }
9952
+
9953
+ var hasToStringTag$7 = requireShams()();
9945
9954
  var callBound$f = callBound$i;
9946
9955
 
9947
9956
  var $toString$7 = callBound$f('Object.prototype.toString');
@@ -10978,7 +10987,7 @@ var tryStringObject = function tryStringObject(value) {
10978
10987
  /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
10979
10988
  var $toString$6 = callBound$c('Object.prototype.toString');
10980
10989
  var strClass = '[object String]';
10981
- var hasToStringTag$6 = shams();
10990
+ var hasToStringTag$6 = requireShams()();
10982
10991
 
10983
10992
  /** @type {import('.')} */
10984
10993
  var isString$2 = function isString(value) {
@@ -11094,7 +11103,7 @@ var isSet$2 = exported$1 || function isSet(x) {
11094
11103
  var isArguments$1 = isArguments$2;
11095
11104
  var getStopIterationIterator = stopIterationIterator;
11096
11105
 
11097
- if (hasSymbols$4() || requireShams()()) {
11106
+ if (hasSymbols$3() || requireShams$1()()) {
11098
11107
  var $iterator = Symbol.iterator;
11099
11108
  // Symbol is available natively or shammed
11100
11109
  // natively:
@@ -11383,7 +11392,7 @@ var tryDateObject = function tryDateGetDayCall(value) {
11383
11392
  /** @type {(value: unknown) => string} */
11384
11393
  var toStr$2 = callBound$9('Object.prototype.toString');
11385
11394
  var dateClass = '[object Date]';
11386
- var hasToStringTag$5 = shams();
11395
+ var hasToStringTag$5 = requireShams()();
11387
11396
 
11388
11397
  /** @type {import('.')} */
11389
11398
  var isDateObject = function isDateObject(value) {
@@ -11394,7 +11403,7 @@ var isDateObject = function isDateObject(value) {
11394
11403
  };
11395
11404
 
11396
11405
  var callBound$8 = callBound$i;
11397
- var hasToStringTag$4 = shams();
11406
+ var hasToStringTag$4 = requireShams()();
11398
11407
  var hasOwn = hasown;
11399
11408
  var gOPD$1 = gopd$1;
11400
11409
 
@@ -11499,7 +11508,7 @@ var tryNumberObject = function tryNumberObject(value) {
11499
11508
  };
11500
11509
  var $toString$3 = callBound$6('Object.prototype.toString');
11501
11510
  var numClass = '[object Number]';
11502
- var hasToStringTag$3 = shams();
11511
+ var hasToStringTag$3 = requireShams()();
11503
11512
 
11504
11513
  /** @type {import('.')} */
11505
11514
  var isNumberObject = function isNumberObject(value) {
@@ -11526,7 +11535,7 @@ var tryBooleanObject = function booleanBrandCheck(value) {
11526
11535
  }
11527
11536
  };
11528
11537
  var boolClass = '[object Boolean]';
11529
- var hasToStringTag$2 = shams();
11538
+ var hasToStringTag$2 = requireShams()();
11530
11539
 
11531
11540
  /** @type {import('.')} */
11532
11541
  var isBooleanObject = function isBoolean(value) {
@@ -11568,7 +11577,7 @@ function requireSafeRegexTest () {
11568
11577
 
11569
11578
  var callBound$4 = callBound$i;
11570
11579
  var $toString$1 = callBound$4('Object.prototype.toString');
11571
- var hasSymbols = hasSymbols$4();
11580
+ var hasSymbols = hasSymbols$3();
11572
11581
  var safeRegexTest = requireSafeRegexTest();
11573
11582
 
11574
11583
  if (hasSymbols) {
@@ -12014,7 +12023,7 @@ var gOPD = gopd$1;
12014
12023
  var getProto = getProto$3;
12015
12024
 
12016
12025
  var $toString = callBound$2('Object.prototype.toString');
12017
- var hasToStringTag = shams();
12026
+ var hasToStringTag = requireShams()();
12018
12027
 
12019
12028
  var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
12020
12029
  var typedArrays = availableTypedArrays();
@@ -25328,9 +25337,15 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
25328
25337
  }
25329
25338
  var rendered = renderComponent(cellComponent.component, cellComponent.id, cellComponent, null);
25330
25339
  if (onWidgetPopout && cellComponent.component) {
25340
+ // Prefer uuid over id — uuid is `${dashboardId}-${component}-${id}`
25341
+ // which is globally unique, while id is only unique within a
25342
+ // single page/container. Passing bare id causes WidgetPopoutStage
25343
+ // to find-first-match across layout/pages and render the wrong
25344
+ // widget when two pages share the same numeric id.
25345
+ var popoutKey = cellComponent.uuid || cellComponent.id;
25331
25346
  return /*#__PURE__*/jsx(PopoutOverlay, {
25332
25347
  onPopout: function onPopout() {
25333
- return onWidgetPopout(cellComponent.id);
25348
+ return onWidgetPopout(popoutKey);
25334
25349
  },
25335
25350
  children: rendered
25336
25351
  });
@@ -47719,7 +47734,7 @@ var PackageItem = function PackageItem(_ref6) {
47719
47734
  }
47720
47735
  function _handleSave2() {
47721
47736
  _handleSave2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
47722
- var _window$mainApi3, updates, result;
47737
+ var _window$mainApi4, updates, result;
47723
47738
  return _regeneratorRuntime.wrap(function (_context3) {
47724
47739
  while (1) switch (_context3.prev = _context3.next) {
47725
47740
  case 0:
@@ -47735,7 +47750,7 @@ var PackageItem = function PackageItem(_ref6) {
47735
47750
  visibility: form.visibility
47736
47751
  };
47737
47752
  _context3.next = 2;
47738
- return (_window$mainApi3 = window.mainApi) === null || _window$mainApi3 === void 0 || (_window$mainApi3 = _window$mainApi3.registryAuth) === null || _window$mainApi3 === void 0 ? void 0 : _window$mainApi3.updatePackage(pkg.scope, pkg.name, updates);
47753
+ return (_window$mainApi4 = window.mainApi) === null || _window$mainApi4 === void 0 || (_window$mainApi4 = _window$mainApi4.registryAuth) === null || _window$mainApi4 === void 0 ? void 0 : _window$mainApi4.updatePackage(pkg.scope, pkg.name, updates);
47739
47754
  case 2:
47740
47755
  result = _context3.sent;
47741
47756
  if (result) {
@@ -47763,14 +47778,14 @@ var PackageItem = function PackageItem(_ref6) {
47763
47778
  }
47764
47779
  function _handleDelete() {
47765
47780
  _handleDelete = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
47766
- var _window$mainApi4, result;
47781
+ var _window$mainApi5, result;
47767
47782
  return _regeneratorRuntime.wrap(function (_context4) {
47768
47783
  while (1) switch (_context4.prev = _context4.next) {
47769
47784
  case 0:
47770
47785
  setDeleting(true);
47771
47786
  _context4.prev = 1;
47772
47787
  _context4.next = 2;
47773
- return (_window$mainApi4 = window.mainApi) === null || _window$mainApi4 === void 0 || (_window$mainApi4 = _window$mainApi4.registryAuth) === null || _window$mainApi4 === void 0 ? void 0 : _window$mainApi4.deletePackage(pkg.scope, pkg.name);
47788
+ 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);
47774
47789
  case 2:
47775
47790
  result = _context4.sent;
47776
47791
  if (result) {
@@ -47897,6 +47912,16 @@ var PackageItem = function PackageItem(_ref6) {
47897
47912
  })]
47898
47913
  });
47899
47914
  }
47915
+ var isPrivate = pkg.visibility === "private";
47916
+ function openAccessPage(e) {
47917
+ var _window$mainApi3;
47918
+ e.stopPropagation();
47919
+ // Registry web URL. If we ever move off Amplify Hosting's default
47920
+ // domain this centralizes nicely into a config, but hardcoded is
47921
+ // consistent with how other files in the app already reference it.
47922
+ var url = "https://main.d919rwhuzp7rj.amplifyapp.com/package/".concat(encodeURIComponent(pkg.scope), "/").concat(encodeURIComponent(pkg.name), "/access");
47923
+ (_window$mainApi3 = window.mainApi) === null || _window$mainApi3 === void 0 || (_window$mainApi3 = _window$mainApi3.shell) === null || _window$mainApi3 === void 0 || _window$mainApi3.openExternal(url);
47924
+ }
47900
47925
  return /*#__PURE__*/jsx("div", {
47901
47926
  onClick: onEdit,
47902
47927
  className: "bg-white/5 rounded-lg p-3 cursor-pointer hover:bg-white/10 transition-colors",
@@ -47911,8 +47936,14 @@ var PackageItem = function PackageItem(_ref6) {
47911
47936
  className: "text-[10px] px-1.5 py-0.5 rounded bg-white/10 opacity-60",
47912
47937
  children: ["v", pkg.version]
47913
47938
  }), /*#__PURE__*/jsx("span", {
47914
- className: "text-[10px] px-1.5 py-0.5 rounded ".concat(pkg.visibility === "private" ? "bg-amber-500/20 text-amber-300" : "bg-emerald-500/20 text-emerald-300"),
47939
+ className: "text-[10px] px-1.5 py-0.5 rounded ".concat(isPrivate ? "bg-amber-500/20 text-amber-300" : "bg-emerald-500/20 text-emerald-300"),
47915
47940
  children: pkg.visibility || "public"
47941
+ }), isPrivate && /*#__PURE__*/jsx("button", {
47942
+ type: "button",
47943
+ onClick: openAccessPage,
47944
+ title: "Open the access management page in your browser",
47945
+ className: "ml-auto text-[10px] px-2 py-0.5 rounded border border-indigo-500/40 text-indigo-300 hover:text-white hover:bg-indigo-600/20 transition-colors",
47946
+ children: "Manage access \u2192"
47916
47947
  })]
47917
47948
  }), pkg.description && /*#__PURE__*/jsx("p", {
47918
47949
  className: "text-xs opacity-50 truncate",
@@ -53689,10 +53720,15 @@ var WidgetPopoutInner = function WidgetPopoutInner(_ref2) {
53689
53720
  }
53690
53721
  setWorkspace(target);
53691
53722
 
53692
- // Find the widget across all layout locations
53693
- var widget = target.layout.find(function (item) {
53694
- return item.id === widgetId;
53695
- });
53723
+ // `widgetId` carries the layout item's uuid (globally unique
53724
+ // across pages/containers) but older callers may still pass a
53725
+ // bare numeric id. Match uuid first, then fall back to id.
53726
+ // Without the uuid match, widgets on a non-first page get
53727
+ // masked by same-numeric-id widgets in the main layout.
53728
+ var matches = function matches(item) {
53729
+ return item.uuid === widgetId || item.id === widgetId;
53730
+ };
53731
+ var widget = target.layout.find(matches);
53696
53732
  if (!widget && target.pages && Array.isArray(target.pages)) {
53697
53733
  var _iterator = _createForOfIteratorHelper$2(target.pages),
53698
53734
  _step;
@@ -53700,9 +53736,7 @@ var WidgetPopoutInner = function WidgetPopoutInner(_ref2) {
53700
53736
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
53701
53737
  var page = _step.value;
53702
53738
  if (page.layout && Array.isArray(page.layout)) {
53703
- widget = page.layout.find(function (item) {
53704
- return item.id === widgetId;
53705
- });
53739
+ widget = page.layout.find(matches);
53706
53740
  if (widget) break;
53707
53741
  }
53708
53742
  }
@@ -53713,9 +53747,7 @@ var WidgetPopoutInner = function WidgetPopoutInner(_ref2) {
53713
53747
  }
53714
53748
  }
53715
53749
  if (!widget && target.sidebarLayout && Array.isArray(target.sidebarLayout)) {
53716
- widget = target.sidebarLayout.find(function (item) {
53717
- return item.id === widgetId;
53718
- });
53750
+ widget = target.sidebarLayout.find(matches);
53719
53751
  }
53720
53752
  if (!widget) {
53721
53753
  setError("Widget not found in workspace");