@burdenoff/microfe-bigconsole 2026.1008.11 → 2026.1008.12

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.
Files changed (131) hide show
  1. package/dist/bigconsole/BigConsoleRoutes.d.ts.map +1 -1
  2. package/dist/bigconsole/BigConsoleRoutes.js +136 -127
  3. package/dist/bigconsole/BigConsoleRoutes.js.map +1 -1
  4. package/dist/bigconsole/assistant/assistantProduct.d.ts.map +1 -1
  5. package/dist/bigconsole/assistant/assistantProduct.js +3 -1
  6. package/dist/bigconsole/assistant/assistantProduct.js.map +1 -1
  7. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
  8. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
  9. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js.map +1 -1
  10. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
  11. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  12. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
  13. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +15 -15
  14. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
  15. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
  16. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
  17. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
  18. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +110 -110
  19. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js.map +1 -1
  20. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
  21. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
  22. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +91 -91
  23. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js.map +1 -1
  24. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
  25. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js.map +1 -1
  26. package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
  27. package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
  28. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
  29. package/dist/bigconsole/components/dashboard/WidgetPalette.js +46 -46
  30. package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
  31. package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
  32. package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
  33. package/dist/bigconsole/components/datasink/DataSinkCard.js +29 -29
  34. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
  35. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
  36. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
  37. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
  38. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
  39. package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
  40. package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
  41. package/dist/bigconsole/components/parser/ImportParserDialog.js.map +1 -1
  42. package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
  43. package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
  44. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +27 -27
  45. package/dist/bigconsole/components/preview/AiPreviewPanel.js +30 -30
  46. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
  47. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
  48. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js.map +1 -1
  49. package/dist/bigconsole/components/widgets/PropertiesPanel.d.ts.map +1 -1
  50. package/dist/bigconsole/components/widgets/PropertiesPanel.js +280 -273
  51. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  52. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
  53. package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
  54. package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
  55. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
  56. package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
  57. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
  58. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
  59. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
  60. package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
  61. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
  62. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
  63. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
  64. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
  65. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
  66. package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
  67. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
  68. package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
  69. package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
  70. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +9 -9
  71. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +67 -67
  72. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js.map +1 -1
  73. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +15 -0
  74. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts.map +1 -0
  75. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +34 -0
  76. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js.map +1 -0
  77. package/dist/bigconsole/hooks/useDrilldown.js +3 -3
  78. package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
  79. package/dist/bigconsole/pages/AdminPage.js +130 -130
  80. package/dist/bigconsole/pages/DashboardBuilderPage.d.ts.map +1 -1
  81. package/dist/bigconsole/pages/DashboardBuilderPage.js +72 -60
  82. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  83. package/dist/bigconsole/pages/DashboardViewPage.js +1 -1
  84. package/dist/bigconsole/pages/DataSinkAlertsPage.d.ts.map +1 -1
  85. package/dist/bigconsole/pages/DataSinkAlertsPage.js +30 -23
  86. package/dist/bigconsole/pages/DataSinkAlertsPage.js.map +1 -1
  87. package/dist/bigconsole/pages/DataSinkBuilderPage.d.ts.map +1 -1
  88. package/dist/bigconsole/pages/DataSinkBuilderPage.js +272 -263
  89. package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
  90. package/dist/bigconsole/pages/DataSinkViewPage.js +1 -1
  91. package/dist/bigconsole/pages/DataSinksPage.js +1 -1
  92. package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
  93. package/dist/bigconsole/pages/InsightsPage.js +181 -181
  94. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  95. package/dist/bigconsole/pages/OverviewPage.js +47 -47
  96. package/dist/bigconsole/pages/OverviewPage.js.map +1 -1
  97. package/dist/bigconsole/pages/ParserBuilderPage.d.ts.map +1 -1
  98. package/dist/bigconsole/pages/ParserBuilderPage.js +227 -211
  99. package/dist/bigconsole/pages/ParserBuilderPage.js.map +1 -1
  100. package/dist/bigconsole/pages/ParserViewPage.js +97 -97
  101. package/dist/bigconsole/pages/PipelineBuilderPage.d.ts.map +1 -1
  102. package/dist/bigconsole/pages/PipelineBuilderPage.js +256 -214
  103. package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
  104. package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
  105. package/dist/bigconsole/pages/PipelinesPage.js +88 -88
  106. package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
  107. package/dist/bigconsole/pages/SettingsPage.d.ts.map +1 -1
  108. package/dist/bigconsole/pages/SettingsPage.js +179 -173
  109. package/dist/bigconsole/pages/SettingsPage.js.map +1 -1
  110. package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
  111. package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
  112. package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
  113. package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
  114. package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
  115. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +34 -34
  116. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +79 -79
  117. package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
  118. package/dist/bigconsole/store/widgetStore.d.ts +12 -0
  119. package/dist/bigconsole/store/widgetStore.d.ts.map +1 -1
  120. package/dist/bigconsole/store/widgetStore.js +3 -1
  121. package/dist/bigconsole/store/widgetStore.js.map +1 -1
  122. package/dist/bigconsole/utils/formDirty.d.ts +83 -0
  123. package/dist/bigconsole/utils/formDirty.d.ts.map +1 -0
  124. package/dist/bigconsole/utils/formDirty.js +23 -0
  125. package/dist/bigconsole/utils/formDirty.js.map +1 -0
  126. package/dist/bigconsole/utils/layoutBaseline.d.ts +131 -0
  127. package/dist/bigconsole/utils/layoutBaseline.d.ts.map +1 -0
  128. package/dist/bigconsole/utils/layoutBaseline.js +98 -0
  129. package/dist/bigconsole/utils/layoutBaseline.js.map +1 -0
  130. package/dist/translations/en.d.ts.map +1 -1
  131. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"assistantProduct.js","names":[],"sources":["../../../src/bigconsole/assistant/assistantProduct.ts"],"sourcesContent":["/**\n * BigConsole's answers to the shared assistant's product seam, as one value.\n *\n * ★★ Every capability field on fe-libs' `AssistantProductProvider` is OPTIONAL,\n * and a missing one does not throw — it degrades SILENTLY. No `gatherPageContext`\n * sends every turn with no page context; no `buildPrompt` drops both the\n * confirm-before-mutate guardrail and the language directive; no\n * `storageFolders` starts a second folder beside the one holding every saved\n * attachment.\n *\n * So the value is typed `Required<…>` over the provider's own props: forgetting\n * a field, or fe-libs ADDING one, is a type error in this file rather than a\n * quiet regression in production.\n */\nimport type { LocalUiCommandOptions } from '@burdenoff/fe-libs/shared/assistant/localUiCommands';\nimport type { AssistantEntityRoute } from '@burdenoff/fe-libs/shared/assistant/uiActions/entityRoutes';\nimport type { AssistantProductProviderProps } from '@burdenoff/fe-libs/shared/assistant/product';\n\nimport { buildPromptForMode } from './assistantPrompt';\nimport { BIGCONSOLE_RECORD_ADAPTERS } from './recordAdapters';\nimport { BIGCONSOLE_ASSISTANT_MODES } from './modes';\nimport { describeCurrentPage, gatherPageContext } from './pageContext';\nimport { BIGCONSOLE_PRODUCT } from './product';\n\n/**\n * Where this product's assistant files land in the workspace file library.\n *\n * ★★ Capitalised as a DISPLAY name while the product id is `bigconsole`, which\n * is exactly why fe-libs cannot derive it: its fallback is\n * `/${product}/AI Assistant/…` → `/bigconsole/AI Assistant/…`.\n *\n * These strings become load-bearing the moment anything is saved. A wrong value\n * does not fail loudly — it quietly starts a SECOND folder beside the first and\n * orphans everything in the original. Today nothing can be orphaned: BigConsole's\n * legacy transport extracts uploaded files into the prompt and saves nothing to\n * the library, so no `/BigConsole/AI Assistant/*` path exists yet. That makes\n * this a free choice now and an expensive one the moment BC4 ships attachments.\n */\nexport const STORAGE_FOLDERS = {\n attachments: '/BigConsole/AI Assistant/Attachments',\n artifacts: '/BigConsole/AI Assistant/Artifacts',\n} as const;\n\n/**\n * The pages of ONE record that no sidebar entry names (BOFF-8060 N1b), so \"take me\n * there\" can open them from a link in the assistant's own reply.\n *\n * ★★ `exclude` lists the router's STATIC siblings of each `:id` segment\n * (`BigConsoleRoutes.tsx`): `datasinks/new` is the builder, not a data source.\n * `entityRoutes.test.ts` resolves every template through the real route table and\n * checks every static sibling against them, so the two lists cannot drift from the\n * router unnoticed.\n *\n * ★ A workflow's address is `workflows/workflow/<key>/<version>` (a slug key such\n * as `github_user_profile` or a UUID, plus `v1`); the version-less\n * `workflows/:workflowId` is a different page and is deliberately not declared.\n *\n * ★ `/integrations/connections` is the app shell's Connected Systems page, shown\n * to whoever can see the Integrations entry.\n */\nexport const ENTITY_ROUTES: readonly AssistantEntityRoute[] = [\n {\n id: 'bigconsole-datasink',\n pattern: '/bigconsole/datasinks/:id',\n params: { id: { kind: 'id', exclude: ['new'] } },\n visibleWith: 'bigconsole-datasinks',\n noun: { key: 'entity.datasink', fallback: 'data source' },\n },\n {\n id: 'bigconsole-dashboard',\n pattern: '/bigconsole/dashboards/:id',\n params: { id: { kind: 'id' } },\n visibleWith: 'bigconsole-dashboards',\n noun: { key: 'entity.dashboard', fallback: 'dashboard' },\n },\n {\n id: 'bigconsole-parser',\n pattern: '/bigconsole/parsers/:id',\n params: { id: { kind: 'id', exclude: ['new'] } },\n visibleWith: 'bigconsole-parsers',\n noun: { key: 'entity.parser', fallback: 'parser' },\n },\n {\n id: 'bigconsole-workflow',\n pattern: '/bigconsole/workflows/workflow/:key/:version',\n params: { key: { kind: 'slug' }, version: { kind: 'slug' } },\n visibleWith: 'bigconsole-workflows-list',\n noun: { key: 'entity.workflow', fallback: 'workflow' },\n },\n {\n id: 'bigconsole-connections',\n pattern: '/integrations/connections',\n params: {},\n visibleWith: 'integrations',\n noun: { key: 'entity.connections', fallback: 'Connected Systems' },\n },\n];\n\n/**\n * How the panel reads a UI command it carries out itself (BOFF-7802), for\n * BigConsole.\n *\n * ★★ `mode-only` because BigConsole's CONTENT has themes of its own: a\n * dashboard has a theme, so \"use the dark theme\" in a dashboard builder is a\n * request about the dashboard, and must reach the model rather than flip the\n * app. fe-libs names this exact case (`LocalUiCommandOptions.themeWords`). Only\n * \"<name> mode\" (\"dark mode\") or a theme qualified as the app's (\"change the\n * app theme to dark\") still changes the app locally, with no turn.\n *\n * ★ Its own exported constant so the seam test can pin the field by identity,\n * like every other field on the seam value.\n */\nexport const LOCAL_UI_COMMANDS: LocalUiCommandOptions = {\n themeWords: 'mode-only',\n entityRoutes: ENTITY_ROUTES,\n // BOFF-8060 N1b: \"open the Coffee Shop Sales dashboard\" / data source, by name.\n records: BIGCONSOLE_RECORD_ADAPTERS,\n /**\n * ★ BOFF-8060 N2 (opt-in): each turn also offers the model the pages this\n * person may be taken to (fe-libs `buildUiCatalogue`): built ONLY from the\n * RBAC-filtered sidebar once its permissions have settled, never while they\n * load, after a failed permission fetch, or for a simulated role; capped at\n * 120 entries and 8 KB; labels and paths only, no record data.\n *\n * It is a body key on the sandbox prompt request. An AI runtime without N2\n * ignores an unknown key (the `conversationId` / `writeReply` precedent), so\n * this is inert on the prod runtime pinned today (2026.928.98) and active\n * where the N2 runtime runs (alpha, 2026.1007.103). Turning it off is this\n * one line.\n */\n uiCatalogue: true,\n};\n\n/**\n * Every seam field, required — the provider's props minus its children, and\n * minus the two answers BigConsole deliberately does not give.\n *\n * ★★ `reportTokenUsage` is omitted ON EVIDENCE, not by oversight, and this\n * `Omit` member is the only place that decision is expressed in the type system.\n * `wspace-bigconsole-svc` declares NO token-usage mutation at all, and nothing in\n * this MFE reports one today. The obvious \"fix\" — wiring fe-libs' shared\n * reporter — would bill VibeControls for BigConsole turns: `reportAiTokenUsage`\n * is declared only in `wspace-vibecontrols-svc`, against the\n * `vibecontrols.ai.credits` quota. Metering BigConsole is a backend change.\n *\n * Note that BigConsole's `bigconsole.*` quotas are a different mechanism —\n * they cap entity counts, not AI spend — so their presence is not evidence that\n * turns are metered.\n *\n * ★★ `confirmWrite` is omitted so a HIGH-risk write proposal is confirmed in\n * fe-libs' shared `AssistantWriteConfirmDialog` (BOFF-7803 5a). That is the\n * documented default when a product has no dialog of its own, and BigConsole\n * has none. A product dialog must meet the whole contract fe-libs sets for it\n * (readback, target count, consequences, the exact confirm label, sensitive\n * values masked, never `window.confirm`), and the shared one already does, so a\n * BigConsole copy would only be a second place for that to go wrong. The\n * bigconsole-app ambient declaration of this value mirrors this `Omit`.\n */\nexport type BigConsoleAssistantProduct = Required<\n Omit<AssistantProductProviderProps, 'children' | 'reportTokenUsage' | 'confirmWrite'>\n>;\n\n/**\n * ★ Each field points at a product-owned implementation BY IDENTITY — no inline\n * arrow wrappers. The seam guard asserts `toBe`, because a wrapper is how a\n * function silently stops being the one the tests cover.\n *\n * ★ `writeAccess` is deliberately absent: it is a PROP on the shared panel, not\n * a seam field, so it belongs to BC4's panel mount rather than here. Same for\n * the preview controller, which the panel takes as `panelProps.preview`.\n */\nexport const BIGCONSOLE_ASSISTANT_PRODUCT: BigConsoleAssistantProduct = {\n product: BIGCONSOLE_PRODUCT,\n modes: BIGCONSOLE_ASSISTANT_MODES,\n describeCurrentPage,\n gatherPageContext,\n buildPrompt: buildPromptForMode,\n storageFolders: STORAGE_FOLDERS,\n localUiCommands: LOCAL_UI_COMMANDS,\n /**\n * ★ On. That is fe-libs' own default (on unless `false`, BOFF-7801) and\n * what BigConsole does today: this seam never set the field, so its turns\n * have been reported by default. The reports carry timings and coarse\n * dimensions only, and BigConsole is the first proposal-v1 product, so its\n * latency is the measurement the rollout needs.\n */\n reportTurnTimings: true,\n /**\n * ★★★ BigConsole is the FIRST proposal-v1 product (BOFF-7803 5a). At\n * `'proposal-v1'` fe-libs provisions Ask and Build (`api-calls`) through the\n * `assistant:use`-gated `provisionAssistantSandbox`, requests the proposal\n * flow for Build, and lets a spoken Build turn through when the sandbox's\n * own `/health` also says v1. Every change then waits for the button on its\n * card; the sandbox and wspace-sandbox-svc decide whether it runs.\n *\n * ★★ That provisioning path has NO `createSandbox` fallback: while\n * wspace-sandbox-svc answers it with 503 (its session relay switched off),\n * BigConsole's assistant cannot start at all. This flag reaches users only\n * when bigconsole-app pins the microfe version that carries it, so the app\n * bump is the release switch, and it waits for the relay.\n */\n writeApproval: 'proposal-v1',\n};\n"],"mappings":";;;;;;AAsCA,IAAa,IAAkB;CAC7B,aAAa;CACb,WAAW;CACZ,EAkIY,IAA2D;CACtE,SAAS;CACT,OAAO;CACP;CACA;CACA,aAAa;CACb,gBAAgB;CAChB,iBAlEsD;EACtD,YAAY;EACZ,cAtD4D;GAC5D;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE,IAAI;KAAE,MAAM;KAAM,SAAS,CAAC,MAAM;KAAE,EAAE;IAChD,aAAa;IACb,MAAM;KAAE,KAAK;KAAmB,UAAU;KAAe;IAC1D;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,EAAE;IAC9B,aAAa;IACb,MAAM;KAAE,KAAK;KAAoB,UAAU;KAAa;IACzD;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE,IAAI;KAAE,MAAM;KAAM,SAAS,CAAC,MAAM;KAAE,EAAE;IAChD,aAAa;IACb,MAAM;KAAE,KAAK;KAAiB,UAAU;KAAU;IACnD;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ;KAAE,KAAK,EAAE,MAAM,QAAQ;KAAE,SAAS,EAAE,MAAM,QAAQ;KAAE;IAC5D,aAAa;IACb,MAAM;KAAE,KAAK;KAAmB,UAAU;KAAY;IACvD;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE;IACV,aAAa;IACb,MAAM;KAAE,KAAK;KAAsB,UAAU;KAAqB;IACnE;GACF;EAoBC,SAAS;EAcT,aAAa;EACd;CAuDC,mBAAmB;CAenB,eAAe;CAChB"}
1
+ {"version":3,"file":"assistantProduct.js","names":[],"sources":["../../../src/bigconsole/assistant/assistantProduct.ts"],"sourcesContent":["/**\n * BigConsole's answers to the shared assistant's product seam, as one value.\n *\n * ★★ Every capability field on fe-libs' `AssistantProductProvider` is OPTIONAL,\n * and a missing one does not throw — it degrades SILENTLY. No `gatherPageContext`\n * sends every turn with no page context; no `buildPrompt` drops both the\n * confirm-before-mutate guardrail and the language directive; no\n * `storageFolders` starts a second folder beside the one holding every saved\n * attachment.\n *\n * So the value is typed `Required<…>` over the provider's own props: forgetting\n * a field, or fe-libs ADDING one, is a type error in this file rather than a\n * quiet regression in production.\n */\nimport type { LocalUiCommandOptions } from '@burdenoff/fe-libs/shared/assistant/localUiCommands';\nimport type { AssistantEntityRoute } from '@burdenoff/fe-libs/shared/assistant/uiActions/entityRoutes';\nimport type { AssistantProductProviderProps } from '@burdenoff/fe-libs/shared/assistant/product';\n\nimport { buildPromptForMode } from './assistantPrompt';\nimport { BIGCONSOLE_RECORD_ADAPTERS } from './recordAdapters';\nimport { BIGCONSOLE_ASSISTANT_MODES } from './modes';\nimport { describeCurrentPage, gatherPageContext } from './pageContext';\nimport { BIGCONSOLE_PRODUCT } from './product';\n\n/**\n * Where this product's assistant files land in the workspace file library.\n *\n * ★★ Capitalised as a DISPLAY name while the product id is `bigconsole`, which\n * is exactly why fe-libs cannot derive it: its fallback is\n * `/${product}/AI Assistant/…` → `/bigconsole/AI Assistant/…`.\n *\n * These strings become load-bearing the moment anything is saved. A wrong value\n * does not fail loudly — it quietly starts a SECOND folder beside the first and\n * orphans everything in the original. Today nothing can be orphaned: BigConsole's\n * legacy transport extracts uploaded files into the prompt and saves nothing to\n * the library, so no `/BigConsole/AI Assistant/*` path exists yet. That makes\n * this a free choice now and an expensive one the moment BC4 ships attachments.\n */\nexport const STORAGE_FOLDERS = {\n attachments: '/BigConsole/AI Assistant/Attachments',\n artifacts: '/BigConsole/AI Assistant/Artifacts',\n} as const;\n\n/**\n * The pages of ONE record that no sidebar entry names (BOFF-8060 N1b), so \"take me\n * there\" can open them from a link in the assistant's own reply.\n *\n * ★★ `exclude` lists the router's STATIC siblings of each `:id` segment\n * (`BigConsoleRoutes.tsx`): `datasinks/new` is the builder, not a data source.\n * `entityRoutes.test.ts` resolves every template through the real route table and\n * checks every static sibling against them, so the two lists cannot drift from the\n * router unnoticed.\n *\n * ★ A workflow's address is `workflows/workflow/<key>/<version>` (a slug key such\n * as `github_user_profile` or a UUID, plus `v1`); the version-less\n * `workflows/:workflowId` is a different page and is deliberately not declared.\n *\n * ★ `/integrations/connections` is the app shell's Connected Systems page, shown\n * to whoever can see the Integrations entry.\n */\nexport const ENTITY_ROUTES: readonly AssistantEntityRoute[] = [\n {\n id: 'bigconsole-datasink',\n pattern: '/bigconsole/datasinks/:id',\n params: { id: { kind: 'id', exclude: ['new'] } },\n visibleWith: 'bigconsole-datasinks',\n noun: { key: 'entity.datasink', fallback: 'data source' },\n },\n {\n id: 'bigconsole-dashboard',\n pattern: '/bigconsole/dashboards/:id',\n params: { id: { kind: 'id' } },\n visibleWith: 'bigconsole-dashboards',\n noun: { key: 'entity.dashboard', fallback: 'dashboard' },\n },\n {\n id: 'bigconsole-parser',\n pattern: '/bigconsole/parsers/:id',\n params: { id: { kind: 'id', exclude: ['new'] } },\n visibleWith: 'bigconsole-parsers',\n noun: { key: 'entity.parser', fallback: 'parser' },\n },\n {\n id: 'bigconsole-workflow',\n pattern: '/bigconsole/workflows/workflow/:key/:version',\n params: { key: { kind: 'slug' }, version: { kind: 'slug' } },\n visibleWith: 'bigconsole-workflows-list',\n noun: { key: 'entity.workflow', fallback: 'workflow' },\n },\n {\n id: 'bigconsole-connections',\n pattern: '/integrations/connections',\n params: {},\n visibleWith: 'integrations',\n noun: { key: 'entity.connections', fallback: 'Connected Systems' },\n },\n];\n\n/**\n * How the panel reads a UI command it carries out itself (BOFF-7802), for\n * BigConsole.\n *\n * ★★ `mode-only` because BigConsole's CONTENT has themes of its own: a\n * dashboard has a theme, so \"use the dark theme\" in a dashboard builder is a\n * request about the dashboard, and must reach the model rather than flip the\n * app. fe-libs names this exact case (`LocalUiCommandOptions.themeWords`). Only\n * \"<name> mode\" (\"dark mode\") or a theme qualified as the app's (\"change the\n * app theme to dark\") still changes the app locally, with no turn.\n *\n * ★ Its own exported constant so the seam test can pin the field by identity,\n * like every other field on the seam value.\n */\nexport const LOCAL_UI_COMMANDS: LocalUiCommandOptions = {\n themeWords: 'mode-only',\n entityRoutes: ENTITY_ROUTES,\n // BOFF-8060 N1b: \"open the Coffee Shop Sales dashboard\" / data source, by name.\n records: BIGCONSOLE_RECORD_ADAPTERS,\n /**\n * ★ BOFF-8060 N2 (opt-in): each turn also offers the model the pages this\n * person may be taken to (fe-libs `buildUiCatalogue`): built ONLY from the\n * RBAC-filtered sidebar once its permissions have settled, never while they\n * load, after a failed permission fetch, or for a simulated role; capped at\n * 120 entries and 8 KB; labels and paths only, no record data.\n *\n * It is a body key on the sandbox prompt request. An AI runtime without N2\n * ignores an unknown key (the `conversationId` / `writeReply` precedent), so\n * this is inert on the prod runtime pinned today (2026.928.98) and active\n * where the N2 runtime runs (alpha, 2026.1007.103). Turning it off is this\n * one line.\n */\n uiCatalogue: true,\n /**\n * ★★ BOFF-8060 N3 + N4 (release gate): draw an \"Open {page}\" link under a reply\n * that offers one (`uiOffers`) AND attest that every editor which can hold a\n * draft reports it to the leave guard (`leaveGuard`). The two are one release\n * and travel only together: with `uiOffers` alone a typed or spoken \"yes\"\n * would leave a dirty editor and lose the draft. A tap on \"Open page\" is never\n * refused (sidebar parity); typed or spoken go-to, \"yes\" and \"take me there\"\n * are refused while an editor below is dirty.\n *\n * Attesting editors (each calls `useUnsavedChanges({ id, label, dirty })`):\n * dashboard-editor DashboardBuilderPage layout baseline (floats until the first placement)\n * dashboard-widget-properties PropertiesPanel the panel's own unsaved-changes flag\n * datasink-editor DataSinkBuilderPage whole-form compare against a baseline\n * parser-editor ParserBuilderPage form compare, seeded once per parser\n * pipeline-editor PipelineBuilderPage five-state compare against a baseline\n * bigconsole-settings SettingsPage settings compare against the last saved\n * datasink-alert-rule DataSinkAlertsPage the draft rule JSON against the original\n * workflow-editor embedded FluidGrids builder, FAIL-CLOSED: reported dirty while\n * mounted, because the SDK cannot report it (see BigConsoleRoutes)\n *\n * ★ NAMED GAPS (not adopted, so a draft in them is not protected from a typed\n * go-to): the modal dialog forms (CreateDashboardDialog, ParserFormDialog, the\n * Import*Dialogs, PublishToStoreDialog, EmbedTab, FilterEditor,\n * ActionConfigDialog, DrilldownConfigPanel, SavedViewsDropdown) and real dirty\n * tracking for the workflow builder (the interim registration over-refuses\n * after a save). Follow-ups are tracked separately.\n *\n * ★ `tests/unsavedChangesAdoption.test.ts` enforces the gate: every editor\n * route in BigConsoleRoutes.tsx must map to a registered editor id, or this\n * flag fails the build. It is inert until the AI runtime serves offers (prod\n * pin held), but the N4 refusal of assistant-initiated moves from a dirty\n * editor is live as soon as this ships.\n */\n uiOffers: true,\n leaveGuard: true,\n};\n\n/**\n * Every seam field, required — the provider's props minus its children, and\n * minus the two answers BigConsole deliberately does not give.\n *\n * ★★ `reportTokenUsage` is omitted ON EVIDENCE, not by oversight, and this\n * `Omit` member is the only place that decision is expressed in the type system.\n * `wspace-bigconsole-svc` declares NO token-usage mutation at all, and nothing in\n * this MFE reports one today. The obvious \"fix\" — wiring fe-libs' shared\n * reporter — would bill VibeControls for BigConsole turns: `reportAiTokenUsage`\n * is declared only in `wspace-vibecontrols-svc`, against the\n * `vibecontrols.ai.credits` quota. Metering BigConsole is a backend change.\n *\n * Note that BigConsole's `bigconsole.*` quotas are a different mechanism —\n * they cap entity counts, not AI spend — so their presence is not evidence that\n * turns are metered.\n *\n * ★★ `confirmWrite` is omitted so a HIGH-risk write proposal is confirmed in\n * fe-libs' shared `AssistantWriteConfirmDialog` (BOFF-7803 5a). That is the\n * documented default when a product has no dialog of its own, and BigConsole\n * has none. A product dialog must meet the whole contract fe-libs sets for it\n * (readback, target count, consequences, the exact confirm label, sensitive\n * values masked, never `window.confirm`), and the shared one already does, so a\n * BigConsole copy would only be a second place for that to go wrong. The\n * bigconsole-app ambient declaration of this value mirrors this `Omit`.\n */\nexport type BigConsoleAssistantProduct = Required<\n Omit<AssistantProductProviderProps, 'children' | 'reportTokenUsage' | 'confirmWrite'>\n>;\n\n/**\n * ★ Each field points at a product-owned implementation BY IDENTITY — no inline\n * arrow wrappers. The seam guard asserts `toBe`, because a wrapper is how a\n * function silently stops being the one the tests cover.\n *\n * ★ `writeAccess` is deliberately absent: it is a PROP on the shared panel, not\n * a seam field, so it belongs to BC4's panel mount rather than here. Same for\n * the preview controller, which the panel takes as `panelProps.preview`.\n */\nexport const BIGCONSOLE_ASSISTANT_PRODUCT: BigConsoleAssistantProduct = {\n product: BIGCONSOLE_PRODUCT,\n modes: BIGCONSOLE_ASSISTANT_MODES,\n describeCurrentPage,\n gatherPageContext,\n buildPrompt: buildPromptForMode,\n storageFolders: STORAGE_FOLDERS,\n localUiCommands: LOCAL_UI_COMMANDS,\n /**\n * ★ On. That is fe-libs' own default (on unless `false`, BOFF-7801) and\n * what BigConsole does today: this seam never set the field, so its turns\n * have been reported by default. The reports carry timings and coarse\n * dimensions only, and BigConsole is the first proposal-v1 product, so its\n * latency is the measurement the rollout needs.\n */\n reportTurnTimings: true,\n /**\n * ★★★ BigConsole is the FIRST proposal-v1 product (BOFF-7803 5a). At\n * `'proposal-v1'` fe-libs provisions Ask and Build (`api-calls`) through the\n * `assistant:use`-gated `provisionAssistantSandbox`, requests the proposal\n * flow for Build, and lets a spoken Build turn through when the sandbox's\n * own `/health` also says v1. Every change then waits for the button on its\n * card; the sandbox and wspace-sandbox-svc decide whether it runs.\n *\n * ★★ That provisioning path has NO `createSandbox` fallback: while\n * wspace-sandbox-svc answers it with 503 (its session relay switched off),\n * BigConsole's assistant cannot start at all. This flag reaches users only\n * when bigconsole-app pins the microfe version that carries it, so the app\n * bump is the release switch, and it waits for the relay.\n */\n writeApproval: 'proposal-v1',\n};\n"],"mappings":";;;;;;AAsCA,IAAa,IAAkB;CAC7B,aAAa;CACb,WAAW;CACZ,EAqKY,IAA2D;CACtE,SAAS;CACT,OAAO;CACP;CACA;CACA,aAAa;CACb,gBAAgB;CAChB,iBArGsD;EACtD,YAAY;EACZ,cAtD4D;GAC5D;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE,IAAI;KAAE,MAAM;KAAM,SAAS,CAAC,MAAM;KAAE,EAAE;IAChD,aAAa;IACb,MAAM;KAAE,KAAK;KAAmB,UAAU;KAAe;IAC1D;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,EAAE;IAC9B,aAAa;IACb,MAAM;KAAE,KAAK;KAAoB,UAAU;KAAa;IACzD;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE,IAAI;KAAE,MAAM;KAAM,SAAS,CAAC,MAAM;KAAE,EAAE;IAChD,aAAa;IACb,MAAM;KAAE,KAAK;KAAiB,UAAU;KAAU;IACnD;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ;KAAE,KAAK,EAAE,MAAM,QAAQ;KAAE,SAAS,EAAE,MAAM,QAAQ;KAAE;IAC5D,aAAa;IACb,MAAM;KAAE,KAAK;KAAmB,UAAU;KAAY;IACvD;GACD;IACE,IAAI;IACJ,SAAS;IACT,QAAQ,EAAE;IACV,aAAa;IACb,MAAM;KAAE,KAAK;KAAsB,UAAU;KAAqB;IACnE;GACF;EAoBC,SAAS;EAcT,aAAa;EAkCb,UAAU;EACV,YAAY;EACb;CAuDC,mBAAmB;CAenB,eAAe;CAChB"}
@@ -3,8 +3,8 @@ import "../../common/index.js";
3
3
  import n from "../../parser/DataSinkSelector.js";
4
4
  import r from "../../parser/ParserSelector.js";
5
5
  import { Input as i, Label as a, Spinner as o } from "@burdenoff/fe-libs/ui";
6
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
- import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
+ import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region src/bigconsole/components/builder/inspector/DataBindingSection.tsx
9
9
  var u = {
10
10
  unbound: "info",
@@ -14,7 +14,7 @@ var u = {
14
14
  parser_error: "danger",
15
15
  field_mismatch: "warning"
16
16
  }, d = ({ consoleId: d, binding: f, resolvedParser: p, dataSinkKey: m, dataPath: h, status: g, resolving: _ = !1, missingFields: v = [], preview: y, error: b, onDataSinkChange: x, onParserChange: S, onDataPathChange: C }) => {
17
- let { t: w } = l(), T = {
17
+ let { t: w } = s(), T = {
18
18
  unbound: w("bigconsole.builder.dataBinding.status.unbound", "Select a DataSink to begin"),
19
19
  loading: _ ? w("bigconsole.parsers.selector.loading", "Loading parsers...") : w("bigconsole.builder.dataBinding.status.loading", "Testing parser and detecting fields…"),
20
20
  bound: w("bigconsole.builder.dataBinding.status.bound", "Binding ready"),
@@ -22,33 +22,33 @@ var u = {
22
22
  parser_error: w("bigconsole.builder.dataBinding.status.parserError", "Parser test failed"),
23
23
  field_mismatch: w("bigconsole.builder.dataBinding.status.fieldMismatch", "Some mapped fields were not found")
24
24
  };
25
- return /* @__PURE__ */ c(t, { children: [
26
- /* @__PURE__ */ s(e, {
25
+ return /* @__PURE__ */ l(t, { children: [
26
+ /* @__PURE__ */ c(e, {
27
27
  title: "Data source",
28
28
  description: w("bigconsole.builder.dataBinding.intro", "Connect this widget to a DataSink and Parser to display transformed data."),
29
29
  "data-testid": "widget-inspector-data-source",
30
- children: /* @__PURE__ */ c("div", {
30
+ children: /* @__PURE__ */ l("div", {
31
31
  className: "flex flex-col gap-form-gap",
32
- children: [/* @__PURE__ */ c("div", {
32
+ children: [/* @__PURE__ */ l("div", {
33
33
  className: "space-y-2",
34
34
  children: [
35
- /* @__PURE__ */ s(a, { children: w("bigconsole.builder.dataBinding.dataSinkLabel", "DataSink") }),
36
- /* @__PURE__ */ s(n, {
35
+ /* @__PURE__ */ c(a, { children: w("bigconsole.builder.dataBinding.dataSinkLabel", "DataSink") }),
36
+ /* @__PURE__ */ c(n, {
37
37
  value: m,
38
38
  onChange: x,
39
39
  placeholder: w("bigconsole.builder.dataBinding.dataSinkPlaceholder", "Select a DataSink...")
40
40
  }),
41
- m && /* @__PURE__ */ c("p", {
41
+ m && /* @__PURE__ */ l("p", {
42
42
  className: "text-xs text-text-secondary",
43
- children: [w("bigconsole.builder.dataBinding.keyLabel", "Key: {{key}}", { key: m }), f.source.ref && /* @__PURE__ */ s("span", {
43
+ children: [w("bigconsole.builder.dataBinding.keyLabel", "Key: {{key}}", { key: m }), f.source.ref && /* @__PURE__ */ c("span", {
44
44
  className: "ml-2 text-text-muted",
45
45
  children: w("bigconsole.builder.dataBinding.idLabel", "ID: {{id}}...", { id: f.source.ref.slice(0, 8) })
46
46
  })]
47
47
  })
48
48
  ]
49
- }), /* @__PURE__ */ c("div", {
49
+ }), /* @__PURE__ */ l("div", {
50
50
  className: "space-y-2",
51
- children: [/* @__PURE__ */ s(a, { children: w("bigconsole.builder.dataBinding.parserLabel", "Parser") }), /* @__PURE__ */ s(r, {
51
+ children: [/* @__PURE__ */ c(a, { children: w("bigconsole.builder.dataBinding.parserLabel", "Parser") }), /* @__PURE__ */ c(r, {
52
52
  consoleId: d,
53
53
  value: f.parserId ?? null,
54
54
  resolvedParser: p,
@@ -61,53 +61,53 @@ var u = {
61
61
  })]
62
62
  })
63
63
  }),
64
- /* @__PURE__ */ s(e, {
64
+ /* @__PURE__ */ c(e, {
65
65
  title: T[g],
66
66
  tone: u[g],
67
67
  padding: "compact",
68
68
  headingLevel: 3,
69
- icon: g === "loading" ? /* @__PURE__ */ s(o, { style: {
69
+ icon: g === "loading" ? /* @__PURE__ */ c(o, { style: {
70
70
  width: "14px",
71
71
  height: "14px"
72
72
  } }) : void 0,
73
73
  "data-testid": "widget-inspector-binding-status",
74
- children: /* @__PURE__ */ c("div", {
74
+ children: /* @__PURE__ */ l("div", {
75
75
  role: "status",
76
76
  "aria-live": "polite",
77
77
  className: "min-w-0 space-y-1",
78
78
  children: [
79
- /* @__PURE__ */ s("p", {
79
+ /* @__PURE__ */ c("p", {
80
80
  className: "sr-only",
81
81
  children: T[g]
82
82
  }),
83
- b && /* @__PURE__ */ s("p", {
83
+ b && /* @__PURE__ */ c("p", {
84
84
  className: "break-words text-xs text-[var(--color-status-error-text)]",
85
85
  children: b
86
86
  }),
87
- v.length > 0 && /* @__PURE__ */ s("p", {
87
+ v.length > 0 && /* @__PURE__ */ c("p", {
88
88
  className: "break-words text-xs text-[var(--color-status-warning-text)]",
89
89
  children: w("bigconsole.builder.dataBinding.missingFields", "Missing: {{fields}}", { fields: v.join(", ") })
90
90
  }),
91
- !b && v.length === 0 && g === "bound" && y !== void 0 && /* @__PURE__ */ s("p", {
91
+ !b && v.length === 0 && g === "bound" && y !== void 0 && /* @__PURE__ */ c("p", {
92
92
  className: "text-xs text-text-secondary",
93
93
  children: "The parser ran and its output matches the fields this widget expects."
94
94
  })
95
95
  ]
96
96
  })
97
97
  }),
98
- f.parserId && Object.keys(f.fields).length > 0 && /* @__PURE__ */ s(e, {
98
+ f.parserId && Object.keys(f.fields).length > 0 && /* @__PURE__ */ c(e, {
99
99
  emphasis: "muted",
100
100
  padding: "compact",
101
101
  title: w("bigconsole.builder.dataBinding.fieldMappingsConfigured", "Field mappings configured"),
102
102
  headingLevel: 3,
103
- children: /* @__PURE__ */ s("div", {
103
+ children: /* @__PURE__ */ c("div", {
104
104
  className: "min-w-0 space-y-1 text-xs text-text-secondary",
105
- children: Object.entries(f.fields).map(([e, t]) => /* @__PURE__ */ c("p", {
105
+ children: Object.entries(f.fields).map(([e, t]) => /* @__PURE__ */ l("p", {
106
106
  className: "break-words",
107
107
  children: [
108
108
  e,
109
109
  ": ",
110
- /* @__PURE__ */ s("code", {
110
+ /* @__PURE__ */ c("code", {
111
111
  className: "rounded bg-bg-surface px-1 font-mono",
112
112
  children: t
113
113
  })
@@ -115,36 +115,36 @@ var u = {
115
115
  }, e))
116
116
  })
117
117
  }),
118
- y !== void 0 && /* @__PURE__ */ s(e, {
118
+ y !== void 0 && /* @__PURE__ */ c(e, {
119
119
  emphasis: "muted",
120
120
  padding: "compact",
121
121
  title: w("bigconsole.builder.dataBinding.livePreviewLabel", "Live Preview"),
122
122
  description: "Raw parser output, exactly as the widget receives it.",
123
123
  headingLevel: 3,
124
- children: /* @__PURE__ */ s("pre", {
124
+ children: /* @__PURE__ */ c("pre", {
125
125
  className: "max-h-40 min-w-0 overflow-auto rounded-input border border-[var(--color-border-subtle)] bg-bg-surface p-3 text-xs text-text-secondary",
126
126
  children: JSON.stringify(y, null, 2)
127
127
  })
128
128
  }),
129
- /* @__PURE__ */ s(e, {
129
+ /* @__PURE__ */ c(e, {
130
130
  emphasis: "muted",
131
131
  padding: "compact",
132
132
  title: "Data path",
133
133
  headingLevel: 3,
134
- children: /* @__PURE__ */ c("div", {
134
+ children: /* @__PURE__ */ l("div", {
135
135
  className: "space-y-2",
136
136
  children: [
137
- /* @__PURE__ */ s(a, {
137
+ /* @__PURE__ */ c(a, {
138
138
  htmlFor: "widget-inspector-data-path",
139
139
  children: w("bigconsole.builder.dataBinding.dataPathLabel", "Data Path (Optional)")
140
140
  }),
141
- /* @__PURE__ */ s(i, {
141
+ /* @__PURE__ */ c(i, {
142
142
  id: "widget-inspector-data-path",
143
143
  value: h ?? "",
144
144
  onChange: (e) => C(e.target.value || void 0),
145
145
  placeholder: w("bigconsole.builder.dataBinding.dataPathPlaceholder", "e.g., summary.totalRevenue")
146
146
  }),
147
- /* @__PURE__ */ s("p", {
147
+ /* @__PURE__ */ c("p", {
148
148
  className: "text-xs text-text-secondary",
149
149
  children: w("bigconsole.builder.dataBinding.dataPathHelp", "Path to extract specific data from the parser output (dot notation)")
150
150
  })
@@ -3,32 +3,32 @@ import "../common/index.js";
3
3
  import t from "./StoreTemplatePicker.js";
4
4
  import { TemplateInstallOptions as n } from "./TemplateInstallOptions.js";
5
5
  import { TemplateLayoutPreview as r } from "./TemplateLayoutPreview.js";
6
- import { templateInputDefaults as i, templateInputError as ee } from "../../utils/templateInstallInputs.js";
7
- import te from "../../hooks/useStoreDashboardTemplates.js";
8
- import { memo as a, useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
9
- import { Copy as ne, LayoutDashboard as re, Plus as u, Tag as ie, X as ae } from "lucide-react";
10
- import { Badge as oe, Button as d, Dialog as se, DialogContent as ce, DialogDescription as le, DialogFooter as ue, DialogHeader as de, DialogTitle as f, Input as p, Spinner as m, Textarea as fe } from "@burdenoff/fe-libs/ui";
11
- import { Fragment as pe, jsx as h, jsxs as g } from "react/jsx-runtime";
6
+ import { templateInputDefaults as ee, templateInputError as te } from "../../utils/templateInstallInputs.js";
7
+ import ne from "../../hooks/useStoreDashboardTemplates.js";
8
+ import { memo as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
9
+ import { Copy as re, LayoutDashboard as ie, Plus as l, Tag as ae, X as oe } from "lucide-react";
10
+ import { Badge as se, Button as u, Dialog as ce, DialogContent as le, DialogDescription as ue, DialogFooter as de, DialogHeader as fe, DialogTitle as d, Input as f, Spinner as p, Textarea as pe } from "@burdenoff/fe-libs/ui";
12
11
  import { useI18n as me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
13
13
  import { useActiveContext as he } from "@burdenoff/fe-libs/shared/providers/shell/ActiveContextProvider";
14
14
  //#region src/bigconsole/components/dashboard/CreateDashboardDialog.tsx
15
- var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, showTemplates: b = !0, onTemplateInstalled: x }) {
16
- let { t: S } = me(), { templates: ge, loading: _e, error: C, fetchTemplateContent: w, installTemplate: T } = te({ autoLoad: b }), [E, D] = l(!1), { workspaceId: O } = he(), k = c(O);
15
+ var _ = i(function({ isOpen: i, isCreating: _ = !1, onClose: v, onCreate: y, showTemplates: b = !0, onTemplateInstalled: x }) {
16
+ let { t: S } = me(), { templates: ge, loading: _e, error: C, fetchTemplateContent: w, installTemplate: T } = ne({ autoLoad: b }), [E, D] = c(!1), { workspaceId: O } = he(), k = s(O);
17
17
  k.current = O;
18
- let [ve, A] = l(null), [ye, be] = l(null), [j, M] = l(!1), [N, P] = l({}), [F, I] = l({}), [L, R] = l("blank"), [z, B] = l(""), [V, H] = l(""), [U, W] = l([]), [G, K] = l(""), [q, J] = l(null), [Y, X] = l(null), Z = c(null), Q = ye === `${q?.id}:${O}` ? ve : null;
19
- s(() => {
20
- a && (R("blank"), B(""), H(""), W([]), K(""), J(null), X(null), setTimeout(() => {
18
+ let [ve, A] = c(null), [ye, be] = c(null), [j, M] = c(!1), [N, P] = c({}), [F, I] = c({}), [L, R] = c("blank"), [z, B] = c(""), [V, H] = c(""), [U, W] = c([]), [G, K] = c(""), [q, J] = c(null), [Y, X] = c(null), Z = s(null), Q = ye === `${q?.id}:${O}` ? ve : null;
19
+ o(() => {
20
+ i && (R("blank"), B(""), H(""), W([]), K(""), J(null), X(null), setTimeout(() => {
21
21
  Z.current?.focus();
22
22
  }, 100));
23
- }, [a]);
24
- let $ = o(() => {
23
+ }, [i]);
24
+ let $ = a(() => {
25
25
  let e = G.trim().toLowerCase();
26
26
  e && !U.includes(e) && U.length < 10 && (W((t) => [...t, e]), K(""));
27
27
  }, [G, U]);
28
- s(() => {
28
+ o(() => {
29
29
  let e = !1;
30
- if (A(null), P({}), I({}), M(!!q), !(!q || !a)) return w(q.id).then((t) => {
31
- e || (A(t), be(`${q.id}:${O}`), M(!1), I(t ? i(t.requiredInputs) : {}), t || X(S("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed.")));
30
+ if (A(null), P({}), I({}), M(!!q), !(!q || !i)) return w(q.id).then((t) => {
31
+ e || (A(t), be(`${q.id}:${O}`), M(!1), I(t ? ee(t.requiredInputs) : {}), t || X(S("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed.")));
32
32
  }), () => {
33
33
  e = !0;
34
34
  };
@@ -36,20 +36,20 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
36
36
  q,
37
37
  w,
38
38
  O,
39
- a,
39
+ i,
40
40
  S
41
41
  ]);
42
- let xe = o((e) => {
42
+ let xe = a((e) => {
43
43
  W((t) => t.filter((t) => t !== e));
44
- }, []), Se = o((e) => {
44
+ }, []), Se = a((e) => {
45
45
  e.key === "Enter" ? (e.preventDefault(), $()) : e.key === "Backspace" && !G && U.length > 0 && W((e) => e.slice(0, -1));
46
46
  }, [
47
47
  $,
48
48
  G,
49
49
  U.length
50
- ]), Ce = o((e) => {
50
+ ]), Ce = a((e) => {
51
51
  J(e), X(null), B(e.name), H(e.description || "");
52
- }, []), we = o(async (e) => {
52
+ }, []), we = a(async (e) => {
53
53
  if (e.preventDefault(), L === "template" && !q) {
54
54
  X(S("bigconsole.dashboards.createDialog.error.selectTemplate", "Please select a template"));
55
55
  return;
@@ -79,7 +79,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
79
79
  X(S("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed."));
80
80
  return;
81
81
  }
82
- let n = ee(e.requiredInputs, F, S);
82
+ let n = te(e.requiredInputs, F, S);
83
83
  if (n) {
84
84
  X(n);
85
85
  return;
@@ -138,16 +138,16 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
138
138
  x,
139
139
  S
140
140
  ]);
141
- return /* @__PURE__ */ h(se, {
142
- open: a,
141
+ return /* @__PURE__ */ h(ce, {
142
+ open: i,
143
143
  onOpenChange: (e) => !e && !_ && !E && v(),
144
- children: /* @__PURE__ */ g(ce, {
144
+ children: /* @__PURE__ */ g(le, {
145
145
  style: {
146
146
  maxWidth: L === "template" ? "900px" : "480px",
147
147
  width: "100%",
148
148
  padding: 0
149
149
  },
150
- children: [/* @__PURE__ */ h(de, {
150
+ children: [/* @__PURE__ */ h(fe, {
151
151
  style: { padding: "var(--space-pagePadding) var(--space-pagePadding) 0" },
152
152
  children: /* @__PURE__ */ g("div", {
153
153
  style: {
@@ -166,7 +166,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
166
166
  borderRadius: "var(--radius-card)",
167
167
  backgroundColor: "var(--color-bg-accentSubtle)"
168
168
  },
169
- children: /* @__PURE__ */ h(re, {
169
+ children: /* @__PURE__ */ h(ie, {
170
170
  "aria-hidden": "true",
171
171
  style: {
172
172
  height: "var(--size-icon-lg)",
@@ -174,7 +174,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
174
174
  color: "var(--color-action-primary-bg)"
175
175
  }
176
176
  })
177
- }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(f, {
177
+ }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(d, {
178
178
  style: {
179
179
  fontSize: "var(--font-size-heading-h4)",
180
180
  fontWeight: "var(--font-weight-bold)",
@@ -182,7 +182,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
182
182
  margin: 0
183
183
  },
184
184
  children: S("bigconsole.dashboards.createDialog.title", "Create New Dashboard")
185
- }), /* @__PURE__ */ h(le, {
185
+ }), /* @__PURE__ */ h(ue, {
186
186
  style: {
187
187
  fontSize: "var(--font-size-body-sm)",
188
188
  color: "var(--color-text-secondary)",
@@ -230,7 +230,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
230
230
  boxShadow: L === "blank" ? "var(--shadow-elevation-1)" : "none",
231
231
  transition: "all 0.15s ease"
232
232
  },
233
- children: [/* @__PURE__ */ h(u, { style: {
233
+ children: [/* @__PURE__ */ h(l, { style: {
234
234
  height: "var(--size-icon-sm)",
235
235
  width: "var(--size-icon-sm)"
236
236
  } }), S("bigconsole.dashboards.createDialog.tab.blank", "Blank Dashboard")]
@@ -255,7 +255,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
255
255
  boxShadow: L === "template" ? "var(--shadow-elevation-1)" : "none",
256
256
  transition: "all 0.15s ease"
257
257
  },
258
- children: [/* @__PURE__ */ h(ne, { style: {
258
+ children: [/* @__PURE__ */ h(re, { style: {
259
259
  height: "var(--size-icon-sm)",
260
260
  width: "var(--size-icon-sm)"
261
261
  } }), S("bigconsole.dashboards.createDialog.tab.template", "From Template")]
@@ -278,7 +278,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
278
278
  }),
279
279
  L === "template" && q && /* @__PURE__ */ g("div", {
280
280
  style: { padding: "var(--space-pagePadding)" },
281
- children: [j && /* @__PURE__ */ h(m, {}), Q && /* @__PURE__ */ g(pe, { children: [/* @__PURE__ */ h(r, { content: Q }), /* @__PURE__ */ h(n, {
281
+ children: [j && /* @__PURE__ */ h(p, {}), Q && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(r, { content: Q }), /* @__PURE__ */ h(n, {
282
282
  content: Q,
283
283
  bindings: N,
284
284
  onBindingChange: (e, t) => P((n) => ({
@@ -323,7 +323,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
323
323
  children: "*"
324
324
  })]
325
325
  }),
326
- /* @__PURE__ */ h(p, {
326
+ /* @__PURE__ */ h(f, {
327
327
  ref: Z,
328
328
  id: "dashboard-name",
329
329
  type: "text",
@@ -369,7 +369,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
369
369
  },
370
370
  children: S("bigconsole.dashboards.createDialog.field.optional", "(optional)")
371
371
  })]
372
- }), /* @__PURE__ */ h(fe, {
372
+ }), /* @__PURE__ */ h(pe, {
373
373
  id: "dashboard-description",
374
374
  value: V,
375
375
  onChange: (e) => H(e.target.value),
@@ -395,7 +395,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
395
395
  marginBottom: "var(--space-controlGap)"
396
396
  },
397
397
  children: [
398
- /* @__PURE__ */ h(ie, { style: {
398
+ /* @__PURE__ */ h(ae, { style: {
399
399
  height: "var(--size-icon-sm)",
400
400
  width: "var(--size-icon-sm)"
401
401
  } }),
@@ -416,7 +416,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
416
416
  gap: "var(--space-controlGap)",
417
417
  marginBottom: "var(--space-controlGap)"
418
418
  },
419
- children: U.map((e) => /* @__PURE__ */ g(oe, {
419
+ children: U.map((e) => /* @__PURE__ */ g(se, {
420
420
  variant: "secondary",
421
421
  style: {
422
422
  display: "flex",
@@ -442,7 +442,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
442
442
  },
443
443
  onMouseOver: (e) => e.currentTarget.style.opacity = "1",
444
444
  onMouseOut: (e) => e.currentTarget.style.opacity = "0.7",
445
- children: /* @__PURE__ */ h(ae, { style: {
445
+ children: /* @__PURE__ */ h(oe, { style: {
446
446
  height: "12px",
447
447
  width: "12px"
448
448
  } })
@@ -454,7 +454,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
454
454
  display: "flex",
455
455
  gap: "var(--space-controlGap)"
456
456
  },
457
- children: [/* @__PURE__ */ h(p, {
457
+ children: [/* @__PURE__ */ h(f, {
458
458
  id: "dashboard-tags",
459
459
  type: "text",
460
460
  value: G,
@@ -467,7 +467,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
467
467
  height: "var(--size-controlHeight-md)",
468
468
  fontSize: "var(--font-size-body-sm)"
469
469
  }
470
- }), /* @__PURE__ */ h(d, {
470
+ }), /* @__PURE__ */ h(u, {
471
471
  type: "button",
472
472
  variant: "outline",
473
473
  onClick: $,
@@ -488,7 +488,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
488
488
  ]
489
489
  })
490
490
  }),
491
- /* @__PURE__ */ g(ue, {
491
+ /* @__PURE__ */ g(de, {
492
492
  style: {
493
493
  padding: "var(--space-formGap) var(--space-pagePadding)",
494
494
  borderTop: "1px solid var(--color-border)",
@@ -497,14 +497,14 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
497
497
  justifyContent: "flex-end",
498
498
  gap: "var(--space-controlGap)"
499
499
  },
500
- children: [/* @__PURE__ */ h(d, {
500
+ children: [/* @__PURE__ */ h(u, {
501
501
  type: "button",
502
502
  variant: "outline",
503
503
  onClick: v,
504
504
  disabled: _ || E,
505
505
  style: { height: "var(--size-controlHeight-md)" },
506
506
  children: S("bigconsole.dashboards.createDialog.action.cancel", "Cancel")
507
- }), /* @__PURE__ */ h(d, {
507
+ }), /* @__PURE__ */ h(u, {
508
508
  type: "submit",
509
509
  disabled: _ || E || !z.trim() || L === "template" && (!q || !Q || j),
510
510
  style: {
@@ -517,7 +517,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
517
517
  alignItems: "center",
518
518
  gap: "var(--space-iconGap)"
519
519
  },
520
- children: [/* @__PURE__ */ h(m, { style: {
520
+ children: [/* @__PURE__ */ h(p, { style: {
521
521
  height: "var(--size-icon-sm)",
522
522
  width: "var(--size-icon-sm)"
523
523
  } }), S("bigconsole.dashboards.createDialog.action.creating", "Creating...")]
@@ -527,7 +527,7 @@ var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, sho
527
527
  alignItems: "center",
528
528
  gap: "var(--space-iconGap)"
529
529
  },
530
- children: [/* @__PURE__ */ h(u, { style: {
530
+ children: [/* @__PURE__ */ h(l, { style: {
531
531
  height: "var(--size-icon-sm)",
532
532
  width: "var(--size-icon-sm)"
533
533
  } }), S("bigconsole.dashboards.createDialog.action.create", "Create Dashboard")]