@trops/dash-core 0.1.277 → 0.1.279
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 +78 -71
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +77 -70
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29446,15 +29446,10 @@ var ComponentManager = {
|
|
|
29446
29446
|
var tempComponentMap = this.componentMap();
|
|
29447
29447
|
// Handle both module exports (widgetConfig.default) and direct config objects
|
|
29448
29448
|
var config = widgetConfig["default"] || widgetConfig;
|
|
29449
|
-
//
|
|
29450
|
-
// otherwise
|
|
29449
|
+
// Register under a single canonical key: config.id (scoped widget ID) if
|
|
29450
|
+
// available, otherwise the provided widgetKey. No aliases — one widget, one key.
|
|
29451
29451
|
var registrationKey = config.id || widgetKey;
|
|
29452
29452
|
tempComponentMap[registrationKey] = ComponentConfigModel(config);
|
|
29453
|
-
// Also register under plain component name for backward compat
|
|
29454
|
-
// (dashboards may reference "SlackWidget" instead of "trops.slack.SlackWidget")
|
|
29455
|
-
if (config.id && config.id !== widgetKey && !tempComponentMap[widgetKey]) {
|
|
29456
|
-
tempComponentMap[widgetKey] = tempComponentMap[registrationKey];
|
|
29457
|
-
}
|
|
29458
29453
|
this.setComponentMap(tempComponentMap);
|
|
29459
29454
|
},
|
|
29460
29455
|
/**
|
|
@@ -33789,8 +33784,10 @@ function extractWidgetConfigs(bundleExports) {
|
|
|
33789
33784
|
|
|
33790
33785
|
// Must have a component function and a recognized type
|
|
33791
33786
|
if (typeof entry.component === "function" && (entry.type === "widget" || entry.type === "workspace")) {
|
|
33787
|
+
// Use the canonical widget ID from config if available,
|
|
33788
|
+
// otherwise fall back to the CJS export key
|
|
33792
33789
|
configs.push({
|
|
33793
|
-
key: key,
|
|
33790
|
+
key: entry.id || key,
|
|
33794
33791
|
config: entry
|
|
33795
33792
|
});
|
|
33796
33793
|
}
|
|
@@ -47986,27 +47983,33 @@ var DashTabBar = function DashTabBar(_ref) {
|
|
|
47986
47983
|
});
|
|
47987
47984
|
};
|
|
47988
47985
|
|
|
47989
|
-
var
|
|
47990
|
-
var
|
|
47991
|
-
|
|
47992
|
-
|
|
47993
|
-
|
|
47994
|
-
|
|
47995
|
-
|
|
47996
|
-
|
|
47997
|
-
|
|
47998
|
-
|
|
47999
|
-
|
|
48000
|
-
|
|
48001
|
-
|
|
48002
|
-
|
|
48003
|
-
|
|
48004
|
-
|
|
48005
|
-
|
|
48006
|
-
|
|
48007
|
-
|
|
48008
|
-
|
|
48009
|
-
|
|
47986
|
+
var CollapsibleContent = function CollapsibleContent(_ref) {
|
|
47987
|
+
var children = _ref.children;
|
|
47988
|
+
var _useSidebar = DashReact.useSidebar(),
|
|
47989
|
+
collapsed = _useSidebar.collapsed;
|
|
47990
|
+
return collapsed ? null : children;
|
|
47991
|
+
};
|
|
47992
|
+
var DashSidebar = function DashSidebar(_ref2) {
|
|
47993
|
+
var collapsed = _ref2.collapsed,
|
|
47994
|
+
onCollapsedChange = _ref2.onCollapsedChange,
|
|
47995
|
+
_ref2$workspaces = _ref2.workspaces,
|
|
47996
|
+
workspaces = _ref2$workspaces === void 0 ? [] : _ref2$workspaces,
|
|
47997
|
+
_ref2$menuItems = _ref2.menuItems,
|
|
47998
|
+
menuItems = _ref2$menuItems === void 0 ? [] : _ref2$menuItems,
|
|
47999
|
+
_ref2$activeTabId = _ref2.activeTabId,
|
|
48000
|
+
activeTabId = _ref2$activeTabId === void 0 ? null : _ref2$activeTabId,
|
|
48001
|
+
_ref2$recentDashboard = _ref2.recentDashboards,
|
|
48002
|
+
recentDashboards = _ref2$recentDashboard === void 0 ? [] : _ref2$recentDashboard,
|
|
48003
|
+
_ref2$authStatus = _ref2.authStatus,
|
|
48004
|
+
authStatus = _ref2$authStatus === void 0 ? "loading" : _ref2$authStatus,
|
|
48005
|
+
_ref2$authProfile = _ref2.authProfile,
|
|
48006
|
+
authProfile = _ref2$authProfile === void 0 ? null : _ref2$authProfile,
|
|
48007
|
+
onOpenWorkspace = _ref2.onOpenWorkspace,
|
|
48008
|
+
onNewDashboard = _ref2.onNewDashboard,
|
|
48009
|
+
onOpenSettings = _ref2.onOpenSettings,
|
|
48010
|
+
onOpenCommandPalette = _ref2.onOpenCommandPalette,
|
|
48011
|
+
onSignIn = _ref2.onSignIn,
|
|
48012
|
+
onSignOut = _ref2.onSignOut;
|
|
48010
48013
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
48011
48014
|
themeVariant = _useContext.themeVariant,
|
|
48012
48015
|
changeThemeVariant = _useContext.changeThemeVariant;
|
|
@@ -48036,9 +48039,11 @@ var DashSidebar = function DashSidebar(_ref) {
|
|
|
48036
48039
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Header, {
|
|
48037
48040
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48038
48041
|
className: "flex items-center justify-between",
|
|
48039
|
-
children: [
|
|
48040
|
-
|
|
48041
|
-
|
|
48042
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CollapsibleContent, {
|
|
48043
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
48044
|
+
className: "font-bold text-lg tracking-tight opacity-80",
|
|
48045
|
+
children: "Dash."
|
|
48046
|
+
})
|
|
48042
48047
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Trigger, {})]
|
|
48043
48048
|
})
|
|
48044
48049
|
}), /*#__PURE__*/jsxRuntime.jsxs(DashReact.Sidebar.Content, {
|
|
@@ -48049,25 +48054,27 @@ var DashSidebar = function DashSidebar(_ref) {
|
|
|
48049
48054
|
}),
|
|
48050
48055
|
onClick: onOpenCommandPalette,
|
|
48051
48056
|
children: "Search"
|
|
48052
|
-
}),
|
|
48053
|
-
|
|
48054
|
-
|
|
48055
|
-
|
|
48056
|
-
|
|
48057
|
-
|
|
48058
|
-
|
|
48059
|
-
|
|
48060
|
-
icon:
|
|
48061
|
-
|
|
48062
|
-
|
|
48063
|
-
|
|
48064
|
-
|
|
48065
|
-
|
|
48066
|
-
|
|
48067
|
-
|
|
48068
|
-
|
|
48069
|
-
|
|
48070
|
-
|
|
48057
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CollapsibleContent, {
|
|
48058
|
+
children: visibleRecents.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Group, {
|
|
48059
|
+
label: "Recents",
|
|
48060
|
+
children: visibleRecents.map(function (recent) {
|
|
48061
|
+
var ws = workspaces.find(function (w) {
|
|
48062
|
+
return w.id === recent.workspaceId;
|
|
48063
|
+
});
|
|
48064
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
|
|
48065
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
48066
|
+
icon: "clock-rotate-left",
|
|
48067
|
+
className: "h-3.5 w-3.5"
|
|
48068
|
+
}),
|
|
48069
|
+
active: recent.workspaceId === activeTabId,
|
|
48070
|
+
onClick: function onClick() {
|
|
48071
|
+
return ws && onOpenWorkspace(ws);
|
|
48072
|
+
},
|
|
48073
|
+
children: (recent.name || "Untitled").replace(/^./, function (c) {
|
|
48074
|
+
return c.toUpperCase();
|
|
48075
|
+
})
|
|
48076
|
+
}, recent.workspaceId);
|
|
48077
|
+
})
|
|
48071
48078
|
})
|
|
48072
48079
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Group, {
|
|
48073
48080
|
label: "Dashboards",
|
|
@@ -48079,7 +48086,7 @@ var DashSidebar = function DashSidebar(_ref) {
|
|
|
48079
48086
|
onClick: onNewDashboard,
|
|
48080
48087
|
children: "New Dashboard"
|
|
48081
48088
|
})
|
|
48082
|
-
}),
|
|
48089
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(CollapsibleContent, {
|
|
48083
48090
|
children: [menuItems.map(function (menuItem) {
|
|
48084
48091
|
var folderWorkspaces = workspacesForFolder(menuItem.id);
|
|
48085
48092
|
var folderIcon = menuItem.icon || menuItem.folder || "folder";
|
|
@@ -48135,15 +48142,15 @@ var DashSidebar = function DashSidebar(_ref) {
|
|
|
48135
48142
|
})]
|
|
48136
48143
|
});
|
|
48137
48144
|
};
|
|
48138
|
-
var FooterPopover = function FooterPopover(
|
|
48139
|
-
var collapsed =
|
|
48140
|
-
themeVariant =
|
|
48141
|
-
changeThemeVariant =
|
|
48142
|
-
authStatus =
|
|
48143
|
-
authProfile =
|
|
48144
|
-
onOpenSettings =
|
|
48145
|
-
onSignIn =
|
|
48146
|
-
onSignOut =
|
|
48145
|
+
var FooterPopover = function FooterPopover(_ref3) {
|
|
48146
|
+
var collapsed = _ref3.collapsed,
|
|
48147
|
+
themeVariant = _ref3.themeVariant,
|
|
48148
|
+
changeThemeVariant = _ref3.changeThemeVariant,
|
|
48149
|
+
authStatus = _ref3.authStatus,
|
|
48150
|
+
authProfile = _ref3.authProfile,
|
|
48151
|
+
onOpenSettings = _ref3.onOpenSettings,
|
|
48152
|
+
onSignIn = _ref3.onSignIn,
|
|
48153
|
+
onSignOut = _ref3.onSignOut;
|
|
48147
48154
|
var buttonRef = React.useRef(null);
|
|
48148
48155
|
var _useState = React.useState(false),
|
|
48149
48156
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -48187,10 +48194,10 @@ var FooterPopover = function FooterPopover(_ref2) {
|
|
|
48187
48194
|
}
|
|
48188
48195
|
return /*#__PURE__*/jsxRuntime.jsx(react.Popover, {
|
|
48189
48196
|
className: "relative",
|
|
48190
|
-
children: function children(
|
|
48197
|
+
children: function children(_ref4) {
|
|
48191
48198
|
var _rect$left;
|
|
48192
|
-
var open =
|
|
48193
|
-
close =
|
|
48199
|
+
var open = _ref4.open,
|
|
48200
|
+
close = _ref4.close;
|
|
48194
48201
|
var rect = open && buttonRef.current ? buttonRef.current.getBoundingClientRect() : null;
|
|
48195
48202
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
48196
48203
|
children: [/*#__PURE__*/jsxRuntime.jsxs(react.Popover.Button, {
|
|
@@ -48271,12 +48278,12 @@ var FooterPopover = function FooterPopover(_ref2) {
|
|
|
48271
48278
|
}
|
|
48272
48279
|
});
|
|
48273
48280
|
};
|
|
48274
|
-
var PopoverItem = function PopoverItem(
|
|
48275
|
-
var icon =
|
|
48276
|
-
label =
|
|
48277
|
-
onClick =
|
|
48278
|
-
|
|
48279
|
-
active =
|
|
48281
|
+
var PopoverItem = function PopoverItem(_ref5) {
|
|
48282
|
+
var icon = _ref5.icon,
|
|
48283
|
+
label = _ref5.label,
|
|
48284
|
+
onClick = _ref5.onClick,
|
|
48285
|
+
_ref5$active = _ref5.active,
|
|
48286
|
+
active = _ref5$active === void 0 ? false : _ref5$active;
|
|
48280
48287
|
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
48281
48288
|
type: "button",
|
|
48282
48289
|
onClick: onClick,
|