@trops/dash-core 0.1.276 → 0.1.278

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import * as DashReact from '@trops/dash-react';
3
- import { isObject, ThemeContext, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, FontAwesomeIcon, Tag, Modal, Sidebar, Paragraph, Panel, Stepper, Tag2, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorInline, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, DropdownPanel, MenuItem2, ButtonIcon2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, Button2, Button3, MenuItem, ButtonIcon3, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, ThemeFromUrlPane, TextArea, Icon2, AlgoliaSearchBox, CommandPalette, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
3
+ import { isObject, ThemeContext, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, FontAwesomeIcon, Tag, Modal, Sidebar, Paragraph, Panel, Stepper, Tag2, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorInline, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, DropdownPanel, MenuItem2, ButtonIcon2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, Button2, Button3, MenuItem, ButtonIcon3, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, ThemeFromUrlPane, TextArea, Icon2, AlgoliaSearchBox, CommandPalette, useSidebar, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
4
4
  export * from '@trops/dash-react';
5
5
  export { ThemeContext } from '@trops/dash-react';
6
6
  import _typeof from '@babel/runtime/helpers/typeof';
@@ -29432,6 +29432,11 @@ var ComponentManager = {
29432
29432
  // otherwise fall back to the provided widgetKey for backward compatibility
29433
29433
  var registrationKey = config.id || widgetKey;
29434
29434
  tempComponentMap[registrationKey] = ComponentConfigModel(config);
29435
+ // Also register under plain component name for backward compat
29436
+ // (dashboards may reference "SlackWidget" instead of "trops.slack.SlackWidget")
29437
+ if (config.id && config.id !== widgetKey && !tempComponentMap[widgetKey]) {
29438
+ tempComponentMap[widgetKey] = tempComponentMap[registrationKey];
29439
+ }
29435
29440
  this.setComponentMap(tempComponentMap);
29436
29441
  },
29437
29442
  /**
@@ -47963,27 +47968,33 @@ var DashTabBar = function DashTabBar(_ref) {
47963
47968
  });
47964
47969
  };
47965
47970
 
47966
- var DashSidebar = function DashSidebar(_ref) {
47967
- var collapsed = _ref.collapsed,
47968
- onCollapsedChange = _ref.onCollapsedChange,
47969
- _ref$workspaces = _ref.workspaces,
47970
- workspaces = _ref$workspaces === void 0 ? [] : _ref$workspaces,
47971
- _ref$menuItems = _ref.menuItems,
47972
- menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
47973
- _ref$activeTabId = _ref.activeTabId,
47974
- activeTabId = _ref$activeTabId === void 0 ? null : _ref$activeTabId,
47975
- _ref$recentDashboards = _ref.recentDashboards,
47976
- recentDashboards = _ref$recentDashboards === void 0 ? [] : _ref$recentDashboards,
47977
- _ref$authStatus = _ref.authStatus,
47978
- authStatus = _ref$authStatus === void 0 ? "loading" : _ref$authStatus,
47979
- _ref$authProfile = _ref.authProfile,
47980
- authProfile = _ref$authProfile === void 0 ? null : _ref$authProfile,
47981
- onOpenWorkspace = _ref.onOpenWorkspace,
47982
- onNewDashboard = _ref.onNewDashboard,
47983
- onOpenSettings = _ref.onOpenSettings,
47984
- onOpenCommandPalette = _ref.onOpenCommandPalette,
47985
- onSignIn = _ref.onSignIn,
47986
- onSignOut = _ref.onSignOut;
47971
+ var CollapsibleContent = function CollapsibleContent(_ref) {
47972
+ var children = _ref.children;
47973
+ var _useSidebar = useSidebar(),
47974
+ collapsed = _useSidebar.collapsed;
47975
+ return collapsed ? null : children;
47976
+ };
47977
+ var DashSidebar = function DashSidebar(_ref2) {
47978
+ var collapsed = _ref2.collapsed,
47979
+ onCollapsedChange = _ref2.onCollapsedChange,
47980
+ _ref2$workspaces = _ref2.workspaces,
47981
+ workspaces = _ref2$workspaces === void 0 ? [] : _ref2$workspaces,
47982
+ _ref2$menuItems = _ref2.menuItems,
47983
+ menuItems = _ref2$menuItems === void 0 ? [] : _ref2$menuItems,
47984
+ _ref2$activeTabId = _ref2.activeTabId,
47985
+ activeTabId = _ref2$activeTabId === void 0 ? null : _ref2$activeTabId,
47986
+ _ref2$recentDashboard = _ref2.recentDashboards,
47987
+ recentDashboards = _ref2$recentDashboard === void 0 ? [] : _ref2$recentDashboard,
47988
+ _ref2$authStatus = _ref2.authStatus,
47989
+ authStatus = _ref2$authStatus === void 0 ? "loading" : _ref2$authStatus,
47990
+ _ref2$authProfile = _ref2.authProfile,
47991
+ authProfile = _ref2$authProfile === void 0 ? null : _ref2$authProfile,
47992
+ onOpenWorkspace = _ref2.onOpenWorkspace,
47993
+ onNewDashboard = _ref2.onNewDashboard,
47994
+ onOpenSettings = _ref2.onOpenSettings,
47995
+ onOpenCommandPalette = _ref2.onOpenCommandPalette,
47996
+ onSignIn = _ref2.onSignIn,
47997
+ onSignOut = _ref2.onSignOut;
47987
47998
  var _useContext = useContext(ThemeContext),
47988
47999
  themeVariant = _useContext.themeVariant,
47989
48000
  changeThemeVariant = _useContext.changeThemeVariant;
@@ -48013,9 +48024,11 @@ var DashSidebar = function DashSidebar(_ref) {
48013
48024
  children: [/*#__PURE__*/jsx(Sidebar.Header, {
48014
48025
  children: /*#__PURE__*/jsxs("div", {
48015
48026
  className: "flex items-center justify-between",
48016
- children: [!collapsed && /*#__PURE__*/jsx("span", {
48017
- className: "font-bold text-lg tracking-tight opacity-80",
48018
- children: "Dash."
48027
+ children: [/*#__PURE__*/jsx(CollapsibleContent, {
48028
+ children: /*#__PURE__*/jsx("span", {
48029
+ className: "font-bold text-lg tracking-tight opacity-80",
48030
+ children: "Dash."
48031
+ })
48019
48032
  }), /*#__PURE__*/jsx(Sidebar.Trigger, {})]
48020
48033
  })
48021
48034
  }), /*#__PURE__*/jsxs(Sidebar.Content, {
@@ -48026,25 +48039,27 @@ var DashSidebar = function DashSidebar(_ref) {
48026
48039
  }),
48027
48040
  onClick: onOpenCommandPalette,
48028
48041
  children: "Search"
48029
- }), !collapsed && visibleRecents.length > 0 && /*#__PURE__*/jsx(Sidebar.Group, {
48030
- label: "Recents",
48031
- children: visibleRecents.map(function (recent) {
48032
- var ws = workspaces.find(function (w) {
48033
- return w.id === recent.workspaceId;
48034
- });
48035
- return /*#__PURE__*/jsx(Sidebar.Item, {
48036
- icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
48037
- icon: "clock-rotate-left",
48038
- className: "h-3.5 w-3.5"
48039
- }),
48040
- active: recent.workspaceId === activeTabId,
48041
- onClick: function onClick() {
48042
- return ws && onOpenWorkspace(ws);
48043
- },
48044
- children: (recent.name || "Untitled").replace(/^./, function (c) {
48045
- return c.toUpperCase();
48046
- })
48047
- }, recent.workspaceId);
48042
+ }), /*#__PURE__*/jsx(CollapsibleContent, {
48043
+ children: visibleRecents.length > 0 && /*#__PURE__*/jsx(Sidebar.Group, {
48044
+ label: "Recents",
48045
+ children: visibleRecents.map(function (recent) {
48046
+ var ws = workspaces.find(function (w) {
48047
+ return w.id === recent.workspaceId;
48048
+ });
48049
+ return /*#__PURE__*/jsx(Sidebar.Item, {
48050
+ icon: /*#__PURE__*/jsx(FontAwesomeIcon, {
48051
+ icon: "clock-rotate-left",
48052
+ className: "h-3.5 w-3.5"
48053
+ }),
48054
+ active: recent.workspaceId === activeTabId,
48055
+ onClick: function onClick() {
48056
+ return ws && onOpenWorkspace(ws);
48057
+ },
48058
+ children: (recent.name || "Untitled").replace(/^./, function (c) {
48059
+ return c.toUpperCase();
48060
+ })
48061
+ }, recent.workspaceId);
48062
+ })
48048
48063
  })
48049
48064
  }), /*#__PURE__*/jsx(Sidebar.Group, {
48050
48065
  label: "Dashboards",
@@ -48056,7 +48071,7 @@ var DashSidebar = function DashSidebar(_ref) {
48056
48071
  onClick: onNewDashboard,
48057
48072
  children: "New Dashboard"
48058
48073
  })
48059
- }), !collapsed && /*#__PURE__*/jsxs(Fragment, {
48074
+ }), /*#__PURE__*/jsxs(CollapsibleContent, {
48060
48075
  children: [menuItems.map(function (menuItem) {
48061
48076
  var folderWorkspaces = workspacesForFolder(menuItem.id);
48062
48077
  var folderIcon = menuItem.icon || menuItem.folder || "folder";
@@ -48112,15 +48127,15 @@ var DashSidebar = function DashSidebar(_ref) {
48112
48127
  })]
48113
48128
  });
48114
48129
  };
48115
- var FooterPopover = function FooterPopover(_ref2) {
48116
- var collapsed = _ref2.collapsed,
48117
- themeVariant = _ref2.themeVariant,
48118
- changeThemeVariant = _ref2.changeThemeVariant,
48119
- authStatus = _ref2.authStatus,
48120
- authProfile = _ref2.authProfile,
48121
- onOpenSettings = _ref2.onOpenSettings,
48122
- onSignIn = _ref2.onSignIn,
48123
- onSignOut = _ref2.onSignOut;
48130
+ var FooterPopover = function FooterPopover(_ref3) {
48131
+ var collapsed = _ref3.collapsed,
48132
+ themeVariant = _ref3.themeVariant,
48133
+ changeThemeVariant = _ref3.changeThemeVariant,
48134
+ authStatus = _ref3.authStatus,
48135
+ authProfile = _ref3.authProfile,
48136
+ onOpenSettings = _ref3.onOpenSettings,
48137
+ onSignIn = _ref3.onSignIn,
48138
+ onSignOut = _ref3.onSignOut;
48124
48139
  var buttonRef = useRef(null);
48125
48140
  var _useState = useState(false),
48126
48141
  _useState2 = _slicedToArray(_useState, 2),
@@ -48164,10 +48179,10 @@ var FooterPopover = function FooterPopover(_ref2) {
48164
48179
  }
48165
48180
  return /*#__PURE__*/jsx(Popover, {
48166
48181
  className: "relative",
48167
- children: function children(_ref3) {
48182
+ children: function children(_ref4) {
48168
48183
  var _rect$left;
48169
- var open = _ref3.open,
48170
- close = _ref3.close;
48184
+ var open = _ref4.open,
48185
+ close = _ref4.close;
48171
48186
  var rect = open && buttonRef.current ? buttonRef.current.getBoundingClientRect() : null;
48172
48187
  return /*#__PURE__*/jsxs(Fragment, {
48173
48188
  children: [/*#__PURE__*/jsxs(Popover.Button, {
@@ -48248,12 +48263,12 @@ var FooterPopover = function FooterPopover(_ref2) {
48248
48263
  }
48249
48264
  });
48250
48265
  };
48251
- var PopoverItem = function PopoverItem(_ref4) {
48252
- var icon = _ref4.icon,
48253
- label = _ref4.label,
48254
- onClick = _ref4.onClick,
48255
- _ref4$active = _ref4.active,
48256
- active = _ref4$active === void 0 ? false : _ref4$active;
48266
+ var PopoverItem = function PopoverItem(_ref5) {
48267
+ var icon = _ref5.icon,
48268
+ label = _ref5.label,
48269
+ onClick = _ref5.onClick,
48270
+ _ref5$active = _ref5.active,
48271
+ active = _ref5$active === void 0 ? false : _ref5$active;
48257
48272
  return /*#__PURE__*/jsxs("button", {
48258
48273
  type: "button",
48259
48274
  onClick: onClick,