@trops/dash-core 0.1.264 → 0.1.265
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 +2 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -30097,6 +30097,12 @@ function findWidgetsDir$1(widgetPath) {
|
|
|
30097
30097
|
return direct;
|
|
30098
30098
|
}
|
|
30099
30099
|
|
|
30100
|
+
// Check configs/widgets/ (packageZip.js nests .dash.js files here)
|
|
30101
|
+
const configsWidgets = path$5.join(widgetPath, "configs", "widgets");
|
|
30102
|
+
if (fs$2.existsSync(configsWidgets)) {
|
|
30103
|
+
return configsWidgets;
|
|
30104
|
+
}
|
|
30105
|
+
|
|
30100
30106
|
// Check configs/ directory (used by packageZip.js for distributed widgets)
|
|
30101
30107
|
const configs = path$5.join(widgetPath, "configs");
|
|
30102
30108
|
if (fs$2.existsSync(configs)) {
|
|
@@ -31615,6 +31621,23 @@ var schedulerController_1 = schedulerController$2;
|
|
|
31615
31621
|
// Store canonical package ID for update matching
|
|
31616
31622
|
widgetEntry.packageId = widgetName;
|
|
31617
31623
|
|
|
31624
|
+
// Derive displayName from authoritative sources instead of trusting dash.json
|
|
31625
|
+
if (config.widgets?.length > 0) {
|
|
31626
|
+
const pkgNames = [
|
|
31627
|
+
...new Set(config.widgets.map((w) => w.package).filter(Boolean)),
|
|
31628
|
+
];
|
|
31629
|
+
if (pkgNames.length === 1) {
|
|
31630
|
+
widgetEntry.displayName = pkgNames[0];
|
|
31631
|
+
}
|
|
31632
|
+
}
|
|
31633
|
+
if (!widgetEntry.displayName || widgetEntry.displayName === config.name) {
|
|
31634
|
+
const bare = widgetName.replace(/^@[^/]+\//, "");
|
|
31635
|
+
widgetEntry.displayName = bare
|
|
31636
|
+
.split("-")
|
|
31637
|
+
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
31638
|
+
.join(" ");
|
|
31639
|
+
}
|
|
31640
|
+
|
|
31618
31641
|
this.widgets.set(widgetName, widgetEntry);
|
|
31619
31642
|
this.saveRegistry();
|
|
31620
31643
|
console.log(`[WidgetRegistry] Registered widget: ${widgetName}`);
|
|
@@ -31655,7 +31678,9 @@ var schedulerController_1 = schedulerController$2;
|
|
|
31655
31678
|
// Store component names as displayName on the registry entry
|
|
31656
31679
|
// so settings UI shows "WeatherWidget" instead of "weather-widget"
|
|
31657
31680
|
if (components.length > 0 && existingEntry) {
|
|
31658
|
-
existingEntry.displayName
|
|
31681
|
+
if (!existingEntry.displayName) {
|
|
31682
|
+
existingEntry.displayName = components.join(", ");
|
|
31683
|
+
}
|
|
31659
31684
|
existingEntry.componentNames = components;
|
|
31660
31685
|
registryUpdated = true;
|
|
31661
31686
|
}
|
|
@@ -31675,8 +31700,6 @@ var schedulerController_1 = schedulerController$2;
|
|
|
31675
31700
|
// has full display data without needing ComponentManager.
|
|
31676
31701
|
if (result?.config && existingEntry) {
|
|
31677
31702
|
const cfg = result.config;
|
|
31678
|
-
if (cfg.displayName) existingEntry.displayName = cfg.displayName;
|
|
31679
|
-
if (cfg.description) existingEntry.description = cfg.description;
|
|
31680
31703
|
if (cfg.scope && !existingEntry.scope)
|
|
31681
31704
|
existingEntry.scope = cfg.scope;
|
|
31682
31705
|
if (cfg.icon && !existingEntry.icon) existingEntry.icon = cfg.icon;
|