@trops/dash-core 0.1.353 → 0.1.355
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 +85 -48
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +53 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53729,13 +53729,27 @@ var WidgetPopoutInner = function WidgetPopoutInner(_ref2) {
|
|
|
53729
53729
|
}
|
|
53730
53730
|
setWorkspace(target);
|
|
53731
53731
|
|
|
53732
|
-
// `widgetId` carries the layout item's uuid
|
|
53733
|
-
//
|
|
53734
|
-
//
|
|
53735
|
-
//
|
|
53736
|
-
//
|
|
53732
|
+
// `widgetId` carries the layout item's uuid. That uuid is
|
|
53733
|
+
// `${dashboardId}-${component}-${id}`
|
|
53734
|
+
// but the dashboardId prefix can differ between the main
|
|
53735
|
+
// window's LayoutModel instance and the one rebuilt here,
|
|
53736
|
+
// so we match on several shapes to be robust:
|
|
53737
|
+
//
|
|
53738
|
+
// 1. full uuid match (preferred)
|
|
53739
|
+
// 2. trailing `component-id` suffix (strip dashboardId)
|
|
53740
|
+
// 3. bare numeric id (legacy callers that pre-date uuid)
|
|
53741
|
+
//
|
|
53742
|
+
// Extract the suffix once: everything after the first "-"
|
|
53743
|
+
// when the string starts with a dashboard-looking prefix.
|
|
53744
|
+
var tail = String(widgetId).split("-").slice(-2).join("-");
|
|
53737
53745
|
var matches = function matches(item) {
|
|
53738
|
-
|
|
53746
|
+
if (item.uuid === widgetId) return true;
|
|
53747
|
+
if (item.uuid && item.uuid.endsWith("-" + tail)) return true;
|
|
53748
|
+
var itemTail = "".concat(item.component, "-").concat(item.id);
|
|
53749
|
+
if (itemTail === widgetId) return true;
|
|
53750
|
+
if (itemTail === tail) return true;
|
|
53751
|
+
if (item.id === widgetId) return true;
|
|
53752
|
+
return false;
|
|
53739
53753
|
};
|
|
53740
53754
|
var widget = target.layout.find(matches);
|
|
53741
53755
|
if (!widget && target.pages && Array.isArray(target.pages)) {
|
|
@@ -53759,7 +53773,39 @@ var WidgetPopoutInner = function WidgetPopoutInner(_ref2) {
|
|
|
53759
53773
|
widget = target.sidebarLayout.find(matches);
|
|
53760
53774
|
}
|
|
53761
53775
|
if (!widget) {
|
|
53762
|
-
|
|
53776
|
+
// Diagnostic dump — helps pinpoint id/uuid mismatches when
|
|
53777
|
+
// the user reports a "Widget not available" popout.
|
|
53778
|
+
var dump = {
|
|
53779
|
+
searchedFor: widgetId,
|
|
53780
|
+
suffix: tail,
|
|
53781
|
+
mainLayout: (target.layout || []).map(function (i) {
|
|
53782
|
+
return {
|
|
53783
|
+
id: i.id,
|
|
53784
|
+
uuid: i.uuid,
|
|
53785
|
+
component: i.component
|
|
53786
|
+
};
|
|
53787
|
+
}),
|
|
53788
|
+
pages: (target.pages || []).map(function (p) {
|
|
53789
|
+
return {
|
|
53790
|
+
pageId: p.id,
|
|
53791
|
+
items: (p.layout || []).map(function (i) {
|
|
53792
|
+
return {
|
|
53793
|
+
id: i.id,
|
|
53794
|
+
uuid: i.uuid,
|
|
53795
|
+
component: i.component
|
|
53796
|
+
};
|
|
53797
|
+
})
|
|
53798
|
+
};
|
|
53799
|
+
}),
|
|
53800
|
+
sidebar: (target.sidebarLayout || []).map(function (i) {
|
|
53801
|
+
return {
|
|
53802
|
+
id: i.id,
|
|
53803
|
+
uuid: i.uuid,
|
|
53804
|
+
component: i.component
|
|
53805
|
+
};
|
|
53806
|
+
})
|
|
53807
|
+
};
|
|
53808
|
+
setError("Widget not found \u2014 searched for \"".concat(widgetId, "\". Check console for details."));
|
|
53763
53809
|
return;
|
|
53764
53810
|
}
|
|
53765
53811
|
|