@trops/dash-core 0.1.274 → 0.1.275
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 +10 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +51 -37
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -45260,7 +45260,7 @@ var useInstalledWidgets = function useInstalledWidgets() {
|
|
|
45260
45260
|
var uninstallWidget = useCallback(/*#__PURE__*/function () {
|
|
45261
45261
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(widgetName) {
|
|
45262
45262
|
var _window$mainApi2;
|
|
45263
|
-
var cMap, keysToRemove, _t2;
|
|
45263
|
+
var widget, packageId, cMap, keysToRemove, _t2;
|
|
45264
45264
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
45265
45265
|
while (1) switch (_context2.prev = _context2.next) {
|
|
45266
45266
|
case 0:
|
|
@@ -45271,17 +45271,22 @@ var useInstalledWidgets = function useInstalledWidgets() {
|
|
|
45271
45271
|
return _context2.abrupt("return");
|
|
45272
45272
|
case 1:
|
|
45273
45273
|
_context2.prev = 1;
|
|
45274
|
-
//
|
|
45274
|
+
// Resolve packageId — widgetName may be a CM key (e.g. "AnalogClockWidget")
|
|
45275
|
+
// but the registry is keyed by scoped package ID (e.g. "@trops/clock").
|
|
45276
|
+
widget = widgets.find(function (w) {
|
|
45277
|
+
return w.name === widgetName;
|
|
45278
|
+
});
|
|
45279
|
+
packageId = (widget === null || widget === void 0 ? void 0 : widget.packageId) || widgetName; // Remove matching ComponentManager entries so the widget
|
|
45275
45280
|
// doesn't reappear as a "builtin" ghost after uninstall.
|
|
45276
45281
|
cMap = ComponentManager.componentMap() || {};
|
|
45277
45282
|
keysToRemove = Object.keys(cMap).filter(function (key) {
|
|
45278
|
-
return cMap[key]._sourcePackage ===
|
|
45283
|
+
return cMap[key]._sourcePackage === packageId;
|
|
45279
45284
|
});
|
|
45280
45285
|
keysToRemove.forEach(function (key) {
|
|
45281
45286
|
return delete cMap[key];
|
|
45282
45287
|
});
|
|
45283
45288
|
_context2.next = 2;
|
|
45284
|
-
return window.mainApi.widgets.uninstall(
|
|
45289
|
+
return window.mainApi.widgets.uninstall(packageId);
|
|
45285
45290
|
case 2:
|
|
45286
45291
|
_context2.next = 3;
|
|
45287
45292
|
return refresh();
|
|
@@ -45301,7 +45306,7 @@ var useInstalledWidgets = function useInstalledWidgets() {
|
|
|
45301
45306
|
return function (_x) {
|
|
45302
45307
|
return _ref2.apply(this, arguments);
|
|
45303
45308
|
};
|
|
45304
|
-
}(), [refresh]);
|
|
45309
|
+
}(), [refresh, widgets]);
|
|
45305
45310
|
useEffect(function () {
|
|
45306
45311
|
refresh();
|
|
45307
45312
|
var handleWidgetsUpdated = function handleWidgetsUpdated() {
|