@trops/dash-core 0.1.187 → 0.1.188

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.js CHANGED
@@ -14,6 +14,7 @@ var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
14
14
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
15
15
  var react = require('@headlessui/react');
16
16
  var solid = require('@heroicons/react/20/solid');
17
+ var fontawesomeSvgCore = require('@fortawesome/fontawesome-svg-core');
17
18
  var clsx = require('clsx');
18
19
  var reactDnd = require('react-dnd');
19
20
  var reactDndHtml5Backend = require('react-dnd-html5-backend');
@@ -22,7 +23,6 @@ var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
22
23
  var _inherits = require('@babel/runtime/helpers/inherits');
23
24
  var colors = require('tailwindcss/colors');
24
25
  var ReactDOM = require('react-dom');
25
- var fontawesomeSvgCore = require('@fortawesome/fontawesome-svg-core');
26
26
  var algoliasearch = require('algoliasearch');
27
27
  var reactInstantsearchHooksWeb = require('react-instantsearch-hooks-web');
28
28
  var reactRouterDom = require('react-router-dom');
@@ -5222,6 +5222,192 @@ var LayoutQuickAddMenu = function LayoutQuickAddMenu(_ref) {
5222
5222
  });
5223
5223
  };
5224
5224
 
5225
+ var CATEGORIES = [{
5226
+ key: "reporting",
5227
+ label: "Reporting",
5228
+ icon: "chart-bar",
5229
+ description: "Dashboards for data visualization and reports"
5230
+ }, {
5231
+ key: "monitoring",
5232
+ label: "Monitoring",
5233
+ icon: "heart-pulse",
5234
+ description: "System health, uptime, and performance monitoring"
5235
+ }, {
5236
+ key: "productivity",
5237
+ label: "Productivity",
5238
+ icon: "list-check",
5239
+ description: "Task tracking, calendars, and workflow management"
5240
+ }, {
5241
+ key: "development",
5242
+ label: "Development",
5243
+ icon: "code",
5244
+ description: "Code repos, CI/CD, and developer tools"
5245
+ }, {
5246
+ key: "communication",
5247
+ label: "Communication",
5248
+ icon: "comments",
5249
+ description: "Messages, channels, and team communication"
5250
+ }, {
5251
+ key: "custom",
5252
+ label: "Custom",
5253
+ icon: "grid-2",
5254
+ description: "Build a fully custom dashboard"
5255
+ }];
5256
+
5257
+ /**
5258
+ * WizardIntentStep
5259
+ *
5260
+ * Step 0 of the Dashboard Wizard. Presents category cards so the user
5261
+ * can indicate what kind of dashboard they want to build.
5262
+ * Multi-select — user can pick multiple categories.
5263
+ *
5264
+ * @param {Object} props
5265
+ * @param {Object} props.state - Wizard state from useWizardState
5266
+ * @param {Function} props.dispatch - Wizard dispatch from useWizardState
5267
+ */
5268
+ var WizardIntentStep = function WizardIntentStep(_ref) {
5269
+ var state = _ref.state,
5270
+ dispatch = _ref.dispatch;
5271
+ var handleToggle = function handleToggle(key) {
5272
+ dispatch({
5273
+ type: "TOGGLE_INTENT",
5274
+ payload: key
5275
+ });
5276
+ };
5277
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
5278
+ className: "wizard-intent-step",
5279
+ children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
5280
+ className: "wizard-step-header",
5281
+ children: "What is this dashboard for?"
5282
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
5283
+ className: "wizard-card-grid",
5284
+ children: CATEGORIES.map(function (cat) {
5285
+ return /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectableCard, {
5286
+ icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
5287
+ icon: cat.icon,
5288
+ fixedWidth: true
5289
+ }),
5290
+ label: cat.label,
5291
+ description: cat.description,
5292
+ selected: state.intent.includes(cat.key),
5293
+ onSelect: function onSelect() {
5294
+ return handleToggle(cat.key);
5295
+ }
5296
+ }, cat.key);
5297
+ })
5298
+ })]
5299
+ });
5300
+ };
5301
+
5302
+ var FALLBACK = "puzzle-piece";
5303
+
5304
+ /**
5305
+ * Resolve an icon name to a valid FontAwesome icon reference.
5306
+ * Tries solid (fas) first, then brand (fab). Returns "puzzle-piece" if
5307
+ * the icon is falsy or not found in either prefix.
5308
+ */
5309
+ var resolveIcon = function resolveIcon(iconName) {
5310
+ if (!iconName) return FALLBACK;
5311
+
5312
+ // Already an array tuple like ["fab", "github"] — pass through
5313
+ if (Array.isArray(iconName)) return iconName;
5314
+
5315
+ // Try solid
5316
+ if (fontawesomeSvgCore.findIconDefinition({
5317
+ prefix: "fas",
5318
+ iconName: iconName
5319
+ })) return iconName;
5320
+
5321
+ // Try brand
5322
+ if (fontawesomeSvgCore.findIconDefinition({
5323
+ prefix: "fab",
5324
+ iconName: iconName
5325
+ })) return ["fab", iconName];
5326
+ return FALLBACK;
5327
+ };
5328
+
5329
+ var WizardProvidersStep = function WizardProvidersStep(_ref) {
5330
+ var state = _ref.state,
5331
+ dispatch = _ref.dispatch;
5332
+ var _useContext = React.useContext(AppContext),
5333
+ providersMap = _useContext.providers;
5334
+ var providerList = React.useMemo(function () {
5335
+ if (!providersMap || _typeof(providersMap) !== "object") return [];
5336
+ return Object.values(providersMap).map(function (p) {
5337
+ return {
5338
+ key: p.type || p.name,
5339
+ name: p.name,
5340
+ type: p.type,
5341
+ icon: p.icon || p.type,
5342
+ configured: !!(p.credentials && Object.keys(p.credentials).length > 0)
5343
+ };
5344
+ });
5345
+ }, [providersMap]);
5346
+
5347
+ // Pre-check configured providers on first render
5348
+ React.useEffect(function () {
5349
+ if (state.providers.length === 0 && providerList.length > 0) {
5350
+ var configuredKeys = providerList.filter(function (p) {
5351
+ return p.configured;
5352
+ }).map(function (p) {
5353
+ return p.key;
5354
+ });
5355
+ if (configuredKeys.length > 0) {
5356
+ dispatch({
5357
+ type: "SET_PROVIDERS",
5358
+ payload: configuredKeys
5359
+ });
5360
+ }
5361
+ }
5362
+ }, [providerList, state.providers.length, dispatch]);
5363
+ var handleToggle = function handleToggle(key) {
5364
+ dispatch({
5365
+ type: "TOGGLE_PROVIDER",
5366
+ payload: key
5367
+ });
5368
+ };
5369
+ if (providerList.length === 0) {
5370
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
5371
+ className: "wizard-providers-step",
5372
+ children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
5373
+ className: "wizard-step-header",
5374
+ children: "Which tools and services do you use?"
5375
+ }), /*#__PURE__*/jsxRuntime.jsx("p", {
5376
+ className: "wizard-empty-message",
5377
+ children: "No providers configured yet. Add providers in Settings first."
5378
+ })]
5379
+ });
5380
+ }
5381
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
5382
+ className: "wizard-providers-step",
5383
+ children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
5384
+ className: "wizard-step-header",
5385
+ children: "Which tools and services do you use?"
5386
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
5387
+ className: "wizard-card-grid",
5388
+ children: providerList.map(function (provider) {
5389
+ var isSelected = state.providers.includes(provider.key);
5390
+ var needsSetup = isSelected && !provider.configured;
5391
+ return /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectableCard, {
5392
+ icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
5393
+ icon: resolveIcon(provider.icon),
5394
+ fixedWidth: true
5395
+ }),
5396
+ label: provider.name,
5397
+ description: needsSetup ? /*#__PURE__*/jsxRuntime.jsx("span", {
5398
+ className: "wizard-needs-setup-badge",
5399
+ children: "Needs setup"
5400
+ }) : null,
5401
+ selected: isSelected,
5402
+ onSelect: function onSelect() {
5403
+ return handleToggle(provider.key);
5404
+ }
5405
+ }, provider.key);
5406
+ })
5407
+ })]
5408
+ });
5409
+ };
5410
+
5225
5411
  var LayoutBuilderAddItemModal = function LayoutBuilderAddItemModal(_ref) {
5226
5412
  var workspace = _ref.workspace,
5227
5413
  open = _ref.open,
@@ -30653,33 +30839,6 @@ function loadWidgetBundle(source, widgetName) {
30653
30839
  };
30654
30840
  }
30655
30841
 
30656
- var FALLBACK = "puzzle-piece";
30657
-
30658
- /**
30659
- * Resolve an icon name to a valid FontAwesome icon reference.
30660
- * Tries solid (fas) first, then brand (fab). Returns "puzzle-piece" if
30661
- * the icon is falsy or not found in either prefix.
30662
- */
30663
- var resolveIcon = function resolveIcon(iconName) {
30664
- if (!iconName) return FALLBACK;
30665
-
30666
- // Already an array tuple like ["fab", "github"] — pass through
30667
- if (Array.isArray(iconName)) return iconName;
30668
-
30669
- // Try solid
30670
- if (fontawesomeSvgCore.findIconDefinition({
30671
- prefix: "fas",
30672
- iconName: iconName
30673
- })) return iconName;
30674
-
30675
- // Try brand
30676
- if (fontawesomeSvgCore.findIconDefinition({
30677
- prefix: "fab",
30678
- iconName: iconName
30679
- })) return ["fab", iconName];
30680
- return FALLBACK;
30681
- };
30682
-
30683
30842
  function _createForOfIteratorHelper$5(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$5(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
30684
30843
  function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; } }
30685
30844
  function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -48520,6 +48679,8 @@ exports.WidgetFactory = WidgetFactory;
48520
48679
  exports.WidgetPopoutStage = WidgetPopoutStage;
48521
48680
  exports.WidgetProviderWrapper = WidgetProviderWrapper;
48522
48681
  exports.WidgetSidebar = WidgetSidebar;
48682
+ exports.WizardIntentStep = WizardIntentStep;
48683
+ exports.WizardProvidersStep = WizardProvidersStep;
48523
48684
  exports.Workspace = Workspace;
48524
48685
  exports.WorkspaceContext = WorkspaceContext;
48525
48686
  exports.WorkspaceFooter = WorkspaceFooter;