@burtson-labs/bandit-engine 2.0.89 → 2.0.90

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.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  management_default
3
- } from "../chunk-GAOJ4PB2.mjs";
4
- import "../chunk-OB2W4OR4.mjs";
3
+ } from "../chunk-ZOUKYB66.mjs";
4
+ import "../chunk-RUMVTVNM.mjs";
5
5
  import "../chunk-ZLXWNTFK.mjs";
6
6
  import "../chunk-L2EKYO4F.mjs";
7
- import "../chunk-BDD6YEWH.mjs";
8
- import "../chunk-4VTF3MY4.mjs";
7
+ import "../chunk-AGT77Z3A.mjs";
8
+ import "../chunk-IVLVUNIB.mjs";
9
9
  import "../chunk-J2PMXOV2.mjs";
10
10
  import "../chunk-LWHSOEPR.mjs";
11
11
  import "../chunk-H3BYFEIE.mjs";
@@ -12030,6 +12030,19 @@ if (!autoInitialized) {
12030
12030
  init_preferencesStore();
12031
12031
  init_packageSettingsStore();
12032
12032
 
12033
+ // src/store/canvasStore.ts
12034
+ var import_zustand13 = require("zustand");
12035
+ var useCanvasStore = (0, import_zustand13.create)((set) => ({
12036
+ open: false,
12037
+ title: "",
12038
+ content: "",
12039
+ language: void 0,
12040
+ openCanvas: ({ content, title, language }) => set({ open: true, content, title: title?.trim() || "Untitled", language }),
12041
+ setContent: (content) => set({ content }),
12042
+ setTitle: (title) => set({ title }),
12043
+ close: () => set({ open: false })
12044
+ }));
12045
+
12033
12046
  // src/hooks/useTTS.ts
12034
12047
  var import_react12 = require("react");
12035
12048
  init_preferencesStore();
@@ -12259,6 +12272,15 @@ init_debugLogger();
12259
12272
  var import_jsx_runtime8 = require("react/jsx-runtime");
12260
12273
  var AiResponseActionsBar = ({ text }) => {
12261
12274
  const [copied, setCopied] = (0, import_react13.useState)(false);
12275
+ const openCanvas = useCanvasStore((s) => s.openCanvas);
12276
+ const openInCanvas = () => {
12277
+ const plain = text || "";
12278
+ const firstHeading = plain.match(/^#{1,3}\s+(.+)$/m)?.[1];
12279
+ const firstLine = plain.split("\n").map((l) => l.trim()).find(Boolean) || "";
12280
+ const rawTitle = (firstHeading || firstLine).replace(/[#*_>]/g, "").replace(/\s+/g, " ").trim();
12281
+ const title = rawTitle.length > 60 ? `${rawTitle.slice(0, 57)}\u2026` : rawTitle || "Untitled";
12282
+ openCanvas({ content: plain, title });
12283
+ };
12262
12284
  const [feedback, setFeedback] = (0, import_react13.useState)(null);
12263
12285
  const {
12264
12286
  isPlaying,
@@ -12345,6 +12367,20 @@ var AiResponseActionsBar = ({ text }) => {
12345
12367
  children: copied ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Check, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Copy, { size: 18 })
12346
12368
  }
12347
12369
  ) }),
12370
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material7.Tooltip, { title: "Open in canvas \u2014 edit & export", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
12371
+ import_material7.IconButton,
12372
+ {
12373
+ onClick: openInCanvas,
12374
+ size: "small",
12375
+ sx: {
12376
+ color: (theme) => theme.palette.mode === "dark" ? "#ccc" : "#555",
12377
+ "&:hover": {
12378
+ color: (theme) => theme.palette.mode === "dark" ? "#fff" : "#000"
12379
+ }
12380
+ },
12381
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.PanelRight, { size: 18 })
12382
+ }
12383
+ ) }),
12348
12384
  isTTSAvailable && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
12349
12385
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
12350
12386
  import_material7.Tooltip,