@burdenoff/microfe-bigconsole 2026.727.2 → 2026.727.3

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.
@@ -12,27 +12,33 @@ var m = {
12
12
  y: 0,
13
13
  width: 6,
14
14
  height: 4
15
- }, h = i(function({ isOpen: i, onClose: h, dashboardId: g, pageId: _, source: v }) {
16
- let { dataSinks: y } = t({ skipFetch: !i }), { parsers: b, executeParser: x } = n({
17
- consoleId: g,
15
+ }, h = "default", g = i(function({ isOpen: i, onClose: g, dashboardId: _, pageId: v, source: y }) {
16
+ let { dataSinks: b } = t({ skipFetch: !i }), { createWidget: x } = e(v, _, { skipFetch: !0 }), S = _ === h, { parsers: C, executeParser: w } = n({
17
+ consoleId: _,
18
18
  skipFetch: !i
19
- }), { createWidget: S } = e(_, g, { skipFetch: !0 }), C = o(() => y.map((e) => ({
19
+ }), { parsers: T } = n({
20
+ consoleId: h,
21
+ skipFetch: !i || S
22
+ }), E = o(() => b.map((e) => ({
20
23
  id: e.id,
21
24
  key: e.key,
22
25
  name: e.name
23
- })), [y]), w = o(() => b.map((e) => ({
24
- id: e.id,
25
- name: e.name,
26
- inputSinkKey: e.inputSinkKey
27
- })), [b]), T = a(async (e) => {
26
+ })), [b]), D = o(() => {
27
+ let e = new Set(C.map((e) => e.id));
28
+ return [...C, ...T.filter((t) => !e.has(t.id))].map((e) => ({
29
+ id: e.id,
30
+ name: e.name,
31
+ inputSinkKey: e.inputSinkKey
32
+ }));
33
+ }, [C, T]), O = a(async (e) => {
28
34
  if (!e.binding.parserId) return;
29
- let t = await x(e.binding.parserId);
35
+ let t = await w(e.binding.parserId);
30
36
  if (!t || !t.success) throw Error(t?.error || "Could not resolve the binding.");
31
37
  return t.output;
32
- }, [x]), E = a(async (e) => {
33
- if (!await S({
34
- pageId: _,
35
- dashboardId: g,
38
+ }, [w]), k = a(async (e) => {
39
+ if (!await x({
40
+ pageId: v,
41
+ dashboardId: _,
36
42
  type: e.widgetType,
37
43
  title: e.presentation.title,
38
44
  description: e.presentation.description,
@@ -48,13 +54,13 @@ var m = {
48
54
  position: { ...m }
49
55
  })) throw Error("The widget could not be created.");
50
56
  }, [
51
- S,
52
- _,
53
- g
57
+ x,
58
+ v,
59
+ _
54
60
  ]);
55
61
  return /* @__PURE__ */ f(s, {
56
62
  open: i,
57
- onOpenChange: (e) => !e && h(),
63
+ onOpenChange: (e) => !e && g(),
58
64
  children: /* @__PURE__ */ p(c, {
59
65
  style: {
60
66
  width: 480,
@@ -75,18 +81,18 @@ var m = {
75
81
  minHeight: 0
76
82
  },
77
83
  children: /* @__PURE__ */ f(r, {
78
- sinks: C,
79
- parsers: w,
80
- resolvePreviewData: T,
81
- onApprove: E,
82
- onClose: h,
83
- source: v
84
+ sinks: E,
85
+ parsers: D,
86
+ resolvePreviewData: O,
87
+ onApprove: k,
88
+ onClose: g,
89
+ source: y
84
90
  })
85
91
  })]
86
92
  })
87
93
  });
88
94
  });
89
95
  //#endregion
90
- export { h as default };
96
+ export { g as default };
91
97
 
92
98
  //# sourceMappingURL=CustomWidgetBuilderSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomWidgetBuilderSheet.js","names":[],"sources":["../../../src/bigconsole/customWidget/CustomWidgetBuilderSheet.tsx"],"sourcesContent":["/**\n * Container that wires the custom-widget proposal panel to real workspace data\n * (BOFF-5532).\n *\n * Supplies the panel with the user's actual permitted DataSinks and parsers,\n * resolves previews by running the real parser, and persists an approved\n * proposal through the normal `createWidget` path — so an approved widget is an\n * ordinary widget, editable afterwards through the standard inspector.\n */\n\nimport { type FC, memo, useCallback, useMemo } from 'react';\nimport { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '@burdenoff/fe-libs/ui';\n\nimport { useDataSinkOperations, useParserOperations, useWidgetOperations } from '../hooks';\nimport { CustomWidgetProposalPanel } from './CustomWidgetProposalPanel';\nimport type { CustomWidgetProposal } from './proposalContract';\nimport type { CustomWidgetProposalSource, ProposalCandidateParser, ProposalCandidateSink } from './proposalSource';\n\nexport interface CustomWidgetBuilderSheetProps {\n isOpen: boolean;\n onClose: () => void;\n dashboardId: string;\n pageId: string;\n /** Swap for the GraphQL-backed source once BOFF-3021's backend half lands. */\n source?: CustomWidgetProposalSource;\n}\n\n/** Grid slot for an approved widget; the reviewer can move it afterwards. */\nconst DEFAULT_POSITION = { x: 0, y: 0, width: 6, height: 4 } as const;\n\nexport const CustomWidgetBuilderSheet: FC<CustomWidgetBuilderSheetProps> = memo(function CustomWidgetBuilderSheet({\n isOpen,\n onClose,\n dashboardId,\n pageId,\n source,\n}) {\n const { dataSinks } = useDataSinkOperations({ skipFetch: !isOpen });\n const { parsers, executeParser } = useParserOperations({ consoleId: dashboardId, skipFetch: !isOpen });\n const { createWidget } = useWidgetOperations(pageId, dashboardId, { skipFetch: true });\n\n const sinks: ProposalCandidateSink[] = useMemo(\n () => dataSinks.map((sink) => ({ id: sink.id, key: sink.key, name: sink.name })),\n [dataSinks]\n );\n\n const parserCandidates: ProposalCandidateParser[] = useMemo(\n () => parsers.map((parser) => ({ id: parser.id, name: parser.name, inputSinkKey: parser.inputSinkKey })),\n [parsers]\n );\n\n /**\n * Resolves what the binding actually produces. Rejects on failure so the\n * panel can distinguish \"no data\" from \"you cannot read this\".\n */\n const resolvePreviewData = useCallback(\n async (proposal: CustomWidgetProposal): Promise<unknown> => {\n if (!proposal.binding.parserId) return undefined;\n const execution = await executeParser(proposal.binding.parserId);\n if (!execution || !execution.success) {\n throw new Error(execution?.error || 'Could not resolve the binding.');\n }\n return execution.output;\n },\n [executeParser]\n );\n\n const handleApprove = useCallback(\n async (proposal: CustomWidgetProposal) => {\n const widget = await createWidget({\n pageId,\n dashboardId,\n type: proposal.widgetType,\n title: proposal.presentation.title,\n description: proposal.presentation.description,\n dataSinkId: proposal.binding.dataSinkId || undefined,\n parserId: proposal.binding.parserId,\n config: {\n ...proposal.presentation.config,\n ...proposal.fieldMapping,\n // Provenance, so an approved widget can be traced back to its prompt\n // and survives export/import and clone with its origin intact.\n generatedBy: proposal.generatedBy,\n sourcePrompt: proposal.sourcePrompt,\n proposalVersion: proposal.version,\n },\n position: { ...DEFAULT_POSITION },\n });\n\n if (!widget) throw new Error('The widget could not be created.');\n },\n [createWidget, pageId, dashboardId]\n );\n\n return (\n <Sheet open={isOpen} onOpenChange={(open) => !open && onClose()}>\n <SheetContent style={{ width: 480, maxWidth: '95vw', padding: 0, display: 'flex', flexDirection: 'column' }}>\n <SheetHeader style={{ padding: 16, paddingBottom: 0 }}>\n <SheetTitle>AI custom widget</SheetTitle>\n <SheetDescription>\n Describe a widget, review the proposal, then approve it onto the dashboard.\n </SheetDescription>\n </SheetHeader>\n\n <div style={{ flex: 1, minHeight: 0 }}>\n <CustomWidgetProposalPanel\n sinks={sinks}\n parsers={parserCandidates}\n resolvePreviewData={resolvePreviewData}\n onApprove={handleApprove}\n onClose={onClose}\n source={source}\n />\n </div>\n </SheetContent>\n </Sheet>\n );\n});\n\nexport default CustomWidgetBuilderSheet;\n"],"mappings":";;;;;;;;;AA4BA,IAAM,IAAmB;CAAE,GAAG;CAAG,GAAG;CAAG,OAAO;CAAG,QAAQ;CAAG,EAE/C,IAA8D,EAAK,SAAkC,EAChH,WACA,YACA,gBACA,WACA,aACC;CACD,IAAM,EAAE,iBAAc,EAAsB,EAAE,WAAW,CAAC,GAAQ,CAAC,EAC7D,EAAE,YAAS,qBAAkB,EAAoB;EAAE,WAAW;EAAa,WAAW,CAAC;EAAQ,CAAC,EAChG,EAAE,oBAAiB,EAAoB,GAAQ,GAAa,EAAE,WAAW,IAAM,CAAC,EAEhF,IAAiC,QAC/B,EAAU,KAAK,OAAU;EAAE,IAAI,EAAK;EAAI,KAAK,EAAK;EAAK,MAAM,EAAK;EAAM,EAAE,EAChF,CAAC,EAAU,CACZ,EAEK,IAA8C,QAC5C,EAAQ,KAAK,OAAY;EAAE,IAAI,EAAO;EAAI,MAAM,EAAO;EAAM,cAAc,EAAO;EAAc,EAA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idgetBuilderSheet.js","names":[],"sources":["../../../src/bigconsole/customWidget/CustomWidgetBuilderSheet.tsx"],"sourcesContent":["/**\n * Container that wires the custom-widget proposal panel to real workspace data\n * (BOFF-5532).\n *\n * Supplies the panel with the user's actual permitted DataSinks and parsers,\n * resolves previews by running the real parser, and persists an approved\n * proposal through the normal `createWidget` path — so an approved widget is an\n * ordinary widget, editable afterwards through the standard inspector.\n */\n\nimport { type FC, memo, useCallback, useMemo } from 'react';\nimport { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '@burdenoff/fe-libs/ui';\n\nimport { useDataSinkOperations, useParserOperations, useWidgetOperations } from '../hooks';\nimport { CustomWidgetProposalPanel } from './CustomWidgetProposalPanel';\nimport type { CustomWidgetProposal } from './proposalContract';\nimport type { CustomWidgetProposalSource, ProposalCandidateParser, ProposalCandidateSink } from './proposalSource';\n\nexport interface CustomWidgetBuilderSheetProps {\n isOpen: boolean;\n onClose: () => void;\n dashboardId: string;\n pageId: string;\n /** Swap for the GraphQL-backed source once BOFF-3021's backend half lands. */\n source?: CustomWidgetProposalSource;\n}\n\n/** Grid slot for an approved widget; the reviewer can move it afterwards. */\nconst DEFAULT_POSITION = { x: 0, y: 0, width: 6, height: 4 } as const;\n\n/** Sentinel consoleId under which workspace-global parsers are stored. */\nconst GLOBAL_CONSOLE_ID = 'default';\n\nexport const CustomWidgetBuilderSheet: FC<CustomWidgetBuilderSheetProps> = memo(function CustomWidgetBuilderSheet({\n isOpen,\n onClose,\n dashboardId,\n pageId,\n source,\n}) {\n const { dataSinks } = useDataSinkOperations({ skipFetch: !isOpen });\n const { createWidget } = useWidgetOperations(pageId, dashboardId, { skipFetch: true });\n\n // Parsers are either dashboard-scoped or workspace-global (`consoleId: 'default'`),\n // and the widget inspector offers both. Fetch both here too, otherwise a proposal\n // can never bind to a global parser — which is what the parser builder creates by\n // default, so the picker would look empty in a typical workspace.\n const isGlobalConsole = dashboardId === GLOBAL_CONSOLE_ID;\n const { parsers: dashboardParsers, executeParser } = useParserOperations({\n consoleId: dashboardId,\n skipFetch: !isOpen,\n });\n const { parsers: globalParsers } = useParserOperations({\n consoleId: GLOBAL_CONSOLE_ID,\n skipFetch: !isOpen || isGlobalConsole,\n });\n\n const sinks: ProposalCandidateSink[] = useMemo(\n () => dataSinks.map((sink) => ({ id: sink.id, key: sink.key, name: sink.name })),\n [dataSinks]\n );\n\n const parserCandidates: ProposalCandidateParser[] = useMemo(() => {\n const seen = new Set(dashboardParsers.map((parser) => parser.id));\n const merged = [...dashboardParsers, ...globalParsers.filter((parser) => !seen.has(parser.id))];\n return merged.map((parser) => ({ id: parser.id, name: parser.name, inputSinkKey: parser.inputSinkKey }));\n }, [dashboardParsers, globalParsers]);\n\n /**\n * Resolves what the binding actually produces. Rejects on failure so the\n * panel can distinguish \"no data\" from \"you cannot read this\".\n */\n const resolvePreviewData = useCallback(\n async (proposal: CustomWidgetProposal): Promise<unknown> => {\n if (!proposal.binding.parserId) return undefined;\n const execution = await executeParser(proposal.binding.parserId);\n if (!execution || !execution.success) {\n throw new Error(execution?.error || 'Could not resolve the binding.');\n }\n return execution.output;\n },\n [executeParser]\n );\n\n const handleApprove = useCallback(\n async (proposal: CustomWidgetProposal) => {\n const widget = await createWidget({\n pageId,\n dashboardId,\n type: proposal.widgetType,\n title: proposal.presentation.title,\n description: proposal.presentation.description,\n dataSinkId: proposal.binding.dataSinkId || undefined,\n parserId: proposal.binding.parserId,\n config: {\n ...proposal.presentation.config,\n ...proposal.fieldMapping,\n // Provenance, so an approved widget can be traced back to its prompt\n // and survives export/import and clone with its origin intact.\n generatedBy: proposal.generatedBy,\n sourcePrompt: proposal.sourcePrompt,\n proposalVersion: proposal.version,\n },\n position: { ...DEFAULT_POSITION },\n });\n\n if (!widget) throw new Error('The widget could not be created.');\n },\n [createWidget, pageId, dashboardId]\n );\n\n return (\n <Sheet open={isOpen} onOpenChange={(open) => !open && onClose()}>\n <SheetContent style={{ width: 480, maxWidth: '95vw', padding: 0, display: 'flex', flexDirection: 'column' }}>\n <SheetHeader style={{ padding: 16, paddingBottom: 0 }}>\n <SheetTitle>AI custom widget</SheetTitle>\n <SheetDescription>\n Describe a widget, review the proposal, then approve it onto the dashboard.\n </SheetDescription>\n </SheetHeader>\n\n <div style={{ flex: 1, minHeight: 0 }}>\n <CustomWidgetProposalPanel\n sinks={sinks}\n parsers={parserCandidates}\n resolvePreviewData={resolvePreviewData}\n onApprove={handleApprove}\n onClose={onClose}\n source={source}\n />\n </div>\n </SheetContent>\n </Sheet>\n );\n});\n\nexport default CustomWidgetBuilderSheet;\n"],"mappings":";;;;;;;;;AA4BA,IAAM,IAAmB;CAAE,GAAG;CAAG,GAAG;CAAG,OAAO;CAAG,QAAQ;CAAG,EAGtD,IAAoB,WAEb,IAA8D,EAAK,SAAkC,EAChH,WACA,YACA,gBACA,WACA,aACC;CACD,IAAM,EAAE,iBAAc,EAAsB,EAAE,WAAW,CAAC,GAAQ,CAAC,EAC7D,EAAE,oBAAiB,EAAoB,GAAQ,GAAa,EAAE,WAAW,IAAM,CAAC,EAMhF,IAAkB,MAAgB,GAClC,EAAE,SAAS,GAAkB,qBAAkB,EAAoB;EACvE,WAAW;EACX,WAAW,CAAC;EACb,CAAC,EACI,EAAE,SAAS,MAAkB,EAAoB;EACrD,WAAW;EACX,WAAW,CAAC,KAAU;EACvB,CAAC,EAEI,IAAiC,QAC/B,EAAU,KAAK,OAAU;EAAE,IAAI,EAAK;EAAI,KAAK,EAAK;EAAK,MAAM,EAAK;EAAM,EAAE,EAChF,CAAC,EAAU,CACZ,EAEK,IAA8C,QAAc;EAChE,IAAM,IAAO,IAAI,IAAI,EAAiB,KAAK,MAAW,EAAO,GAAG,CAAC;AAEjE,SADe,CAAC,GAAG,GAAkB,GAAG,EAAc,QAAQ,MAAW,CAAC,EAAK,IAAI,EAAO,GAAG,CAAC,CAAC,CACjF,KAAK,OAAY;GAAE,IAAI,EAAO;GAAI,MAAM,EAAO;GAAM,cAAc,EAAO;GAAc,EAAE;I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-1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-bigconsole",
3
- "version": "2026.727.2",
3
+ "version": "2026.727.3",
4
4
  "description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "type": "module",
6
6
  "files": [