@trops/dash-core 0.1.264 → 0.1.266
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/electron/index.js +26 -3
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +51 -42
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +83 -83
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -45051,7 +45051,7 @@ var useInstalledWidgets = function useInstalledWidgets() {
|
|
|
45051
45051
|
error = _useState6[0],
|
|
45052
45052
|
setError = _useState6[1];
|
|
45053
45053
|
var refresh = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
45054
|
-
var _window$mainApi, cMap, builtinWidgets,
|
|
45054
|
+
var _window$mainApi, cMap, builtinWidgets, registryByName, list, installedFromCM, cmSourcePackages, fallbackInstalled, _t;
|
|
45055
45055
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
45056
45056
|
while (1) switch (_context.prev = _context.next) {
|
|
45057
45057
|
case 0:
|
|
@@ -45062,6 +45062,8 @@ var useInstalledWidgets = function useInstalledWidgets() {
|
|
|
45062
45062
|
cMap = ComponentManager.componentMap() || {};
|
|
45063
45063
|
builtinWidgets = Object.keys(cMap).filter(function (key) {
|
|
45064
45064
|
return cMap[key].type === "widget";
|
|
45065
|
+
}).filter(function (key) {
|
|
45066
|
+
return !cMap[key]._sourcePackage;
|
|
45065
45067
|
}).map(function (key) {
|
|
45066
45068
|
var config = cMap[key];
|
|
45067
45069
|
return {
|
|
@@ -45078,11 +45080,11 @@ var useInstalledWidgets = function useInstalledWidgets() {
|
|
|
45078
45080
|
workspace: config.workspace || null,
|
|
45079
45081
|
componentNames: [key]
|
|
45080
45082
|
};
|
|
45081
|
-
}); // ── Installed widgets from
|
|
45082
|
-
//
|
|
45083
|
-
//
|
|
45084
|
-
//
|
|
45085
|
-
|
|
45083
|
+
}); // ── Installed widgets from ComponentManager + Registry ───
|
|
45084
|
+
// CM entries with _sourcePackage are registry-installed widgets.
|
|
45085
|
+
// Show each as an individual "installed" entry, enriched with
|
|
45086
|
+
// registry-level metadata (version, path, packageId).
|
|
45087
|
+
registryByName = {};
|
|
45086
45088
|
if (!((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && _window$mainApi.widgets)) {
|
|
45087
45089
|
_context.next = 3;
|
|
45088
45090
|
break;
|
|
@@ -45091,50 +45093,57 @@ var useInstalledWidgets = function useInstalledWidgets() {
|
|
|
45091
45093
|
return window.mainApi.widgets.list();
|
|
45092
45094
|
case 2:
|
|
45093
45095
|
list = _context.sent;
|
|
45094
|
-
|
|
45095
|
-
|
|
45096
|
-
|
|
45097
|
-
|
|
45098
|
-
|
|
45099
|
-
|
|
45100
|
-
|
|
45101
|
-
|
|
45102
|
-
|
|
45103
|
-
|
|
45104
|
-
|
|
45096
|
+
(list || []).forEach(function (w) {
|
|
45097
|
+
registryByName[w.name] = w;
|
|
45098
|
+
});
|
|
45099
|
+
case 3:
|
|
45100
|
+
installedFromCM = Object.keys(cMap).filter(function (key) {
|
|
45101
|
+
return cMap[key].type === "widget" && !!cMap[key]._sourcePackage;
|
|
45102
|
+
}).map(function (key) {
|
|
45103
|
+
var config = cMap[key];
|
|
45104
|
+
var reg = registryByName[config._sourcePackage] || {};
|
|
45105
|
+
return {
|
|
45106
|
+
name: key,
|
|
45107
|
+
displayName: config.name || key,
|
|
45108
|
+
author: config.author || reg.author || null,
|
|
45109
|
+
"package": config["package"] || null,
|
|
45110
|
+
description: config.description || null,
|
|
45111
|
+
icon: config.icon || null,
|
|
45112
|
+
version: reg.version || null,
|
|
45113
|
+
path: reg.path || null,
|
|
45114
|
+
source: "installed",
|
|
45115
|
+
providers: config.providers || [],
|
|
45116
|
+
workspace: config.workspace || null,
|
|
45117
|
+
componentNames: [key],
|
|
45118
|
+
packageId: reg.packageId || config._sourcePackage
|
|
45119
|
+
};
|
|
45120
|
+
}); // Fallback: registry packages whose components never loaded
|
|
45121
|
+
// into CM (e.g. compile failure). Show the package-level entry.
|
|
45122
|
+
cmSourcePackages = new Set(Object.values(cMap).filter(function (c) {
|
|
45123
|
+
return c._sourcePackage;
|
|
45124
|
+
}).map(function (c) {
|
|
45125
|
+
return c._sourcePackage;
|
|
45126
|
+
}));
|
|
45127
|
+
fallbackInstalled = Object.values(registryByName).filter(function (w) {
|
|
45128
|
+
return !cmSourcePackages.has(w.name);
|
|
45129
|
+
}).map(function (w) {
|
|
45105
45130
|
return {
|
|
45106
45131
|
name: w.name,
|
|
45107
|
-
displayName: w.displayName ||
|
|
45108
|
-
author: w.author ||
|
|
45109
|
-
"package": w["package"] ||
|
|
45110
|
-
description: w.description ||
|
|
45111
|
-
icon: w.icon ||
|
|
45132
|
+
displayName: w.displayName || w.name,
|
|
45133
|
+
author: w.author || null,
|
|
45134
|
+
"package": w["package"] || null,
|
|
45135
|
+
description: w.description || null,
|
|
45136
|
+
icon: w.icon || null,
|
|
45112
45137
|
version: w.version || null,
|
|
45113
45138
|
path: w.path || null,
|
|
45114
45139
|
source: "installed",
|
|
45115
|
-
providers:
|
|
45116
|
-
workspace: w.workspace ||
|
|
45117
|
-
componentNames: w.componentNames ||
|
|
45140
|
+
providers: w.providers || [],
|
|
45141
|
+
workspace: w.workspace || null,
|
|
45142
|
+
componentNames: w.componentNames || [],
|
|
45118
45143
|
packageId: w.packageId || w.name
|
|
45119
45144
|
};
|
|
45120
45145
|
});
|
|
45121
|
-
|
|
45122
|
-
// ── Merge: installed wins on name collision ──────────────
|
|
45123
|
-
// Also remove builtin entries whose _sourcePackage matches an
|
|
45124
|
-
// installed widget name (e.g. builtin "WeatherWidget" with
|
|
45125
|
-
// _sourcePackage "weather-widget" is the same as installed
|
|
45126
|
-
// "weather-widget").
|
|
45127
|
-
installedNames = new Set(installedWidgets.map(function (w) {
|
|
45128
|
-
return w.name;
|
|
45129
|
-
}));
|
|
45130
|
-
deduped = builtinWidgets.filter(function (w) {
|
|
45131
|
-
var _cMap$w$name;
|
|
45132
|
-
if (installedNames.has(w.name)) return false;
|
|
45133
|
-
var sp = (_cMap$w$name = cMap[w.name]) === null || _cMap$w$name === void 0 ? void 0 : _cMap$w$name._sourcePackage;
|
|
45134
|
-
if (sp && installedNames.has(sp)) return false;
|
|
45135
|
-
return true;
|
|
45136
|
-
});
|
|
45137
|
-
setWidgets([].concat(_toConsumableArray(deduped), _toConsumableArray(installedWidgets)));
|
|
45146
|
+
setWidgets([].concat(_toConsumableArray(builtinWidgets), _toConsumableArray(installedFromCM), _toConsumableArray(fallbackInstalled)));
|
|
45138
45147
|
_context.next = 5;
|
|
45139
45148
|
break;
|
|
45140
45149
|
case 4:
|