@principal-ade/panel-layouts 0.3.21 → 0.4.1

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,7 +1,7 @@
1
1
  import './index.css';var Ee = Object.defineProperty;
2
2
  var Re = (o, e, t) => e in o ? Ee(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
3
  var le = (o, e, t) => Re(o, typeof e != "symbol" ? e + "" : e, t);
4
- import { EditableConfigurablePanelLayout as zt, ResponsiveConfigurablePanelLayout as Pt, mapThemeToPanelVars as Lt, mapThemeToTabVars as Wt } from "@principal-ade/panels";
4
+ import { EditableConfigurablePanelLayout as Pt, PanelBoundsProvider as zt, ResponsiveConfigurablePanelLayout as Lt, mapThemeToPanelVars as Wt, mapThemeToTabVars as _t, usePanelBounds as Et, usePanelOffset as Rt } from "@principal-ade/panels";
5
5
  import { useState as _, useRef as U, useEffect as E, useCallback as w, useMemo as ne } from "react";
6
6
  import { jsx as l, jsxs as b, Fragment as ce } from "react/jsx-runtime";
7
7
  import { useTheme as ee } from "@principal-ade/industry-theme";
@@ -119,7 +119,7 @@ function dt(o) {
119
119
  }, [u]);
120
120
  const L = w(async () => {
121
121
  }, []), q = w(async () => {
122
- }, []), z = w(async () => {
122
+ }, []), P = w(async () => {
123
123
  }, []), A = w(async () => {
124
124
  }, []);
125
125
  return r === "three-panel" ? {
@@ -129,7 +129,7 @@ function dt(o) {
129
129
  handlePanelResize: y,
130
130
  handleLeftCollapseComplete: L,
131
131
  handleLeftExpandComplete: q,
132
- handleRightCollapseComplete: z,
132
+ handleRightCollapseComplete: P,
133
133
  handleRightExpandComplete: A
134
134
  } : {
135
135
  type: "two-panel",
@@ -221,7 +221,7 @@ class Me {
221
221
  }
222
222
  }
223
223
  }
224
- class O {
224
+ class F {
225
225
  /**
226
226
  * Configure a custom storage adapter (for Electron IPC or remote storage)
227
227
  */
@@ -610,18 +610,18 @@ class O {
610
610
  Object.keys(e).length;
611
611
  }
612
612
  }
613
- le(O, "adapter", new Me());
613
+ le(F, "adapter", new Me());
614
614
  function pt(o = {}) {
615
615
  const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [s, i] = _(
616
616
  {}
617
617
  ), [a, n] = _(null), [g, c] = _(null), [x, p] = _(!0), [h, C] = _(null), f = w(async () => {
618
618
  try {
619
619
  p(!0), C(null);
620
- const k = await O.getWorkspaceLayouts();
620
+ const k = await F.getWorkspaceLayouts();
621
621
  if (i(k), e) {
622
- let I = await O.getRepositoryState(e);
622
+ let I = await F.getRepositoryState(e);
623
623
  if (!I && t) {
624
- const W = r || "project-management", $ = await O.getWorkspaceLayout(W);
624
+ const W = r || "project-management", $ = await F.getWorkspaceLayout(W);
625
625
  $ && (I = {
626
626
  workspaceId: W,
627
627
  sizes: $.defaultSizes || {
@@ -633,13 +633,13 @@ function pt(o = {}) {
633
633
  left: !1,
634
634
  right: !1
635
635
  }
636
- }, await O.setRepositoryState(
636
+ }, await F.setRepositoryState(
637
637
  e,
638
638
  I
639
639
  ));
640
640
  }
641
641
  if (n(I), I != null && I.workspaceId) {
642
- const W = await O.getWorkspaceLayout(
642
+ const W = await F.getWorkspaceLayout(
643
643
  I.workspaceId
644
644
  );
645
645
  c(W);
@@ -656,23 +656,23 @@ function pt(o = {}) {
656
656
  f();
657
657
  }, [f]);
658
658
  const d = w(
659
- async (k) => await O.getWorkspaceLayout(k),
659
+ async (k) => await F.getWorkspaceLayout(k),
660
660
  []
661
661
  ), u = w(
662
662
  async (k) => {
663
- const I = await O.createWorkspaceLayout(k);
663
+ const I = await F.createWorkspaceLayout(k);
664
664
  return await f(), I;
665
665
  },
666
666
  [f]
667
667
  ), y = w(
668
668
  async (k, I) => {
669
- const W = await O.updateWorkspaceLayout(k, I);
669
+ const W = await F.updateWorkspaceLayout(k, I);
670
670
  return await f(), W;
671
671
  },
672
672
  [f]
673
673
  ), L = w(
674
674
  async (k) => {
675
- const I = await O.deleteWorkspaceLayout(k);
675
+ const I = await F.deleteWorkspaceLayout(k);
676
676
  return I && await f(), I;
677
677
  },
678
678
  [f]
@@ -682,7 +682,7 @@ function pt(o = {}) {
682
682
  console.error("Cannot apply workspace without repositoryKey");
683
683
  return;
684
684
  }
685
- const I = await O.getWorkspaceLayout(k);
685
+ const I = await F.getWorkspaceLayout(k);
686
686
  if (!I) {
687
687
  console.error(`Workspace ${k} not found`);
688
688
  return;
@@ -695,16 +695,16 @@ function pt(o = {}) {
695
695
  right: !1
696
696
  }
697
697
  };
698
- await O.setRepositoryState(e, W), await f();
698
+ await F.setRepositoryState(e, W), await f();
699
699
  },
700
700
  [e, f]
701
- ), z = w(
701
+ ), P = w(
702
702
  async (k) => {
703
703
  if (!e) {
704
704
  console.error("Cannot update sizes without repositoryKey");
705
705
  return;
706
706
  }
707
- await O.updateRepositorySizes(e, k), await f();
707
+ await F.updateRepositorySizes(e, k), await f();
708
708
  },
709
709
  [e, f]
710
710
  ), A = w(
@@ -713,7 +713,7 @@ function pt(o = {}) {
713
713
  console.error("Cannot update collapsed without repositoryKey");
714
714
  return;
715
715
  }
716
- await O.updateRepositoryCollapsed(
716
+ await F.updateRepositoryCollapsed(
717
717
  e,
718
718
  k
719
719
  ), await f();
@@ -724,7 +724,7 @@ function pt(o = {}) {
724
724
  console.error("Cannot reset without repositoryKey and active workspace");
725
725
  return;
726
726
  }
727
- await O.resetRepositoryToWorkspaceDefaults(
727
+ await F.resetRepositoryToWorkspaceDefaults(
728
728
  e,
729
729
  a.workspaceId
730
730
  ), await f();
@@ -742,7 +742,7 @@ function pt(o = {}) {
742
742
  updateWorkspace: y,
743
743
  deleteWorkspace: L,
744
744
  applyWorkspace: q,
745
- updateSizes: z,
745
+ updateSizes: P,
746
746
  updateCollapsed: A,
747
747
  resetToDefaults: v,
748
748
  refresh: S
@@ -1046,11 +1046,11 @@ const ht = ({
1046
1046
  // Override opacity when hovered
1047
1047
  ...L ? { opacity: 0 } : {},
1048
1048
  ...c
1049
- }, z = t.includes("vignette-drift"), A = t.includes("radial-breathing"), v = t.includes("snowfall"), S = (te, H) => {
1049
+ }, P = t.includes("vignette-drift"), A = t.includes("radial-breathing"), v = t.includes("snowfall"), S = (te, H) => {
1050
1050
  const M = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(te);
1051
1051
  if (!M) return `rgba(255, 255, 255, ${H})`;
1052
- const oe = parseInt(M[1], 16), V = parseInt(M[2], 16), Y = parseInt(M[3], 16);
1053
- return `rgba(${oe}, ${V}, ${Y}, ${H})`;
1052
+ const oe = parseInt(M[1], 16), B = parseInt(M[2], 16), Y = parseInt(M[3], 16);
1053
+ return `rgba(${oe}, ${B}, ${Y}, ${H})`;
1054
1054
  }, k = x.colors.primary, I = {
1055
1055
  position: "absolute",
1056
1056
  top: 0,
@@ -1074,7 +1074,7 @@ const ht = ({
1074
1074
  transition: `opacity ${s}ms ease-out`,
1075
1075
  background: `radial-gradient(circle at center, ${S(k, 0.15)} 0%, ${S(k, 0.06)} 30%, transparent 55%)`,
1076
1076
  animation: p ? "focus-overlay-radial-breathing 4s ease-in-out infinite" : "none"
1077
- }, $ = S(k, 0.6), T = S(k, 0.4), P = S(k, 0.25), B = {
1077
+ }, $ = S(k, 0.6), T = S(k, 0.4), z = S(k, 0.25), V = {
1078
1078
  position: "absolute",
1079
1079
  top: 0,
1080
1080
  left: 0,
@@ -1084,7 +1084,7 @@ const ht = ({
1084
1084
  opacity: p ? 1 : 0,
1085
1085
  transition: `opacity ${s}ms ease-out`
1086
1086
  }, se = {
1087
- ...B,
1087
+ ...V,
1088
1088
  background: `
1089
1089
  radial-gradient(circle, ${$} 0%, ${$} 3px, transparent 3px),
1090
1090
  radial-gradient(circle, ${$} 0%, ${$} 3px, transparent 3px),
@@ -1095,7 +1095,7 @@ const ht = ({
1095
1095
  backgroundPosition: "10px 20px, 60px 80px, 110px 40px, 40px 120px",
1096
1096
  animation: p ? "focus-overlay-snowfall-1 4s linear infinite" : "none"
1097
1097
  }, G = {
1098
- ...B,
1098
+ ...V,
1099
1099
  background: `
1100
1100
  radial-gradient(circle, ${T} 0%, ${T} 2px, transparent 2px),
1101
1101
  radial-gradient(circle, ${T} 0%, ${T} 2px, transparent 2px),
@@ -1107,14 +1107,14 @@ const ht = ({
1107
1107
  backgroundPosition: "30px 10px, 90px 60px, 15px 100px, 120px 30px, 70px 130px",
1108
1108
  animation: p ? "focus-overlay-snowfall-2 7s linear infinite" : "none"
1109
1109
  }, K = {
1110
- ...B,
1110
+ ...V,
1111
1111
  background: `
1112
- radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
1113
- radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
1114
- radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
1115
- radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
1116
- radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
1117
- radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px)
1112
+ radial-gradient(circle, ${z} 0%, ${z} 1.5px, transparent 1.5px),
1113
+ radial-gradient(circle, ${z} 0%, ${z} 1.5px, transparent 1.5px),
1114
+ radial-gradient(circle, ${z} 0%, ${z} 1.5px, transparent 1.5px),
1115
+ radial-gradient(circle, ${z} 0%, ${z} 1.5px, transparent 1.5px),
1116
+ radial-gradient(circle, ${z} 0%, ${z} 1.5px, transparent 1.5px),
1117
+ radial-gradient(circle, ${z} 0%, ${z} 1.5px, transparent 1.5px)
1118
1118
  `,
1119
1119
  backgroundSize: "150px 150px",
1120
1120
  backgroundPosition: "20px 5px, 80px 45px, 45px 90px, 130px 20px, 5px 70px, 100px 110px",
@@ -1131,7 +1131,7 @@ const ht = ({
1131
1131
  "data-active": o,
1132
1132
  "data-variant": e,
1133
1133
  children: [
1134
- z && /* @__PURE__ */ l(
1134
+ P && /* @__PURE__ */ l(
1135
1135
  "div",
1136
1136
  {
1137
1137
  className: "focus-mode-overlay__vignette-drift",
@@ -1212,7 +1212,7 @@ const ht = ({
1212
1212
  A.preventDefault(), h && f ? f() : i();
1213
1213
  break;
1214
1214
  }
1215
- }, z = n === "thinking" || n === "executing";
1215
+ }, P = n === "thinking" || n === "executing";
1216
1216
  return /* @__PURE__ */ b(
1217
1217
  "div",
1218
1218
  {
@@ -1284,7 +1284,7 @@ const ht = ({
1284
1284
  onChange: (A) => e(A.target.value),
1285
1285
  onKeyDown: q,
1286
1286
  placeholder: g,
1287
- disabled: c || z,
1287
+ disabled: c || P,
1288
1288
  style: {
1289
1289
  flex: 1,
1290
1290
  backgroundColor: "transparent",
@@ -1297,7 +1297,7 @@ const ht = ({
1297
1297
  }
1298
1298
  }
1299
1299
  ),
1300
- z && /* @__PURE__ */ b(
1300
+ P && /* @__PURE__ */ b(
1301
1301
  "span",
1302
1302
  {
1303
1303
  style: {
@@ -1325,7 +1325,7 @@ const ht = ({
1325
1325
  ]
1326
1326
  }
1327
1327
  ),
1328
- !z && /* @__PURE__ */ l(
1328
+ !P && /* @__PURE__ */ l(
1329
1329
  "kbd",
1330
1330
  {
1331
1331
  style: {
@@ -1376,7 +1376,7 @@ const qe = ({ status: o }) => {
1376
1376
  }, Ne = (o) => {
1377
1377
  const e = Object.entries(o);
1378
1378
  return e.length === 0 ? "" : e.map(([t, r]) => t === "args" && Array.isArray(r) ? r.join(", ") : typeof r == "string" ? `"${r}"` : JSON.stringify(r)).join(", ");
1379
- }, Fe = ({ tool: o, compact: e }) => {
1379
+ }, Oe = ({ tool: o, compact: e }) => {
1380
1380
  const { theme: t } = ee(), r = Ne(o.args);
1381
1381
  return /* @__PURE__ */ b(
1382
1382
  "div",
@@ -1450,7 +1450,7 @@ const qe = ({ status: o }) => {
1450
1450
  borderRadius: "4px",
1451
1451
  margin: "8px 16px"
1452
1452
  },
1453
- children: o.map((r) => /* @__PURE__ */ l(Fe, { tool: r, compact: e }, r.id))
1453
+ children: o.map((r) => /* @__PURE__ */ l(Oe, { tool: r, compact: e }, r.id))
1454
1454
  }
1455
1455
  );
1456
1456
  };
@@ -1777,7 +1777,7 @@ const we = ({
1777
1777
  );
1778
1778
  };
1779
1779
  we.displayName = "QuickCommandAutocomplete";
1780
- const Oe = ({
1780
+ const Fe = ({
1781
1781
  palette: o,
1782
1782
  config: e
1783
1783
  }) => {
@@ -1799,7 +1799,7 @@ const Oe = ({
1799
1799
  // Autocomplete
1800
1800
  quickCommandMatches: L,
1801
1801
  argumentOptionMatches: q,
1802
- parsedQuery: z,
1802
+ parsedQuery: P,
1803
1803
  currentArgDef: A,
1804
1804
  selectedAutocompleteIndex: v,
1805
1805
  autocompleteItemCount: S,
@@ -1810,31 +1810,31 @@ const Oe = ({
1810
1810
  } = o;
1811
1811
  E(() => {
1812
1812
  if (!s) return;
1813
- const V = (N) => {
1813
+ const B = (N) => {
1814
1814
  r.current && !r.current.contains(N.target) && i();
1815
1815
  }, Y = setTimeout(() => {
1816
- document.addEventListener("mousedown", V);
1816
+ document.addEventListener("mousedown", B);
1817
1817
  }, 100);
1818
1818
  return () => {
1819
- clearTimeout(Y), document.removeEventListener("mousedown", V);
1819
+ clearTimeout(Y), document.removeEventListener("mousedown", B);
1820
1820
  };
1821
1821
  }, [s, i]);
1822
- const [T, P] = _(!1), [B, se] = _(!1);
1822
+ const [T, z] = _(!1), [V, se] = _(!1);
1823
1823
  if (E(() => {
1824
1824
  if (s)
1825
1825
  se(!0), requestAnimationFrame(() => {
1826
1826
  requestAnimationFrame(() => {
1827
- P(!0);
1827
+ z(!0);
1828
1828
  });
1829
1829
  });
1830
1830
  else {
1831
- P(!1);
1832
- const V = setTimeout(() => {
1831
+ z(!1);
1832
+ const B = setTimeout(() => {
1833
1833
  se(!1);
1834
1834
  }, 150);
1835
- return () => clearTimeout(V);
1835
+ return () => clearTimeout(B);
1836
1836
  }
1837
- }, [s]), !B)
1837
+ }, [s]), !V)
1838
1838
  return null;
1839
1839
  const G = y ? (e == null ? void 0 : e.placeholder) || "What would you like to do?" : "Quick command mode (agent unavailable)", K = [...p, ...x], te = K.length > 0, H = h && c !== "idle", M = y && !a && c === "idle" && u.length > 0, oe = !y && g !== "quick-command" && c === "idle";
1840
1840
  return /* @__PURE__ */ b(ce, { children: [
@@ -2004,11 +2004,11 @@ const Oe = ({
2004
2004
  children: "Try:"
2005
2005
  }
2006
2006
  ),
2007
- u.map((V, Y) => /* @__PURE__ */ b(
2007
+ u.map((B, Y) => /* @__PURE__ */ b(
2008
2008
  "button",
2009
2009
  {
2010
2010
  onClick: () => {
2011
- n(V);
2011
+ n(B);
2012
2012
  },
2013
2013
  style: {
2014
2014
  padding: "4px 10px",
@@ -2028,7 +2028,7 @@ const Oe = ({
2028
2028
  },
2029
2029
  children: [
2030
2030
  '"',
2031
- V,
2031
+ B,
2032
2032
  '"'
2033
2033
  ]
2034
2034
  },
@@ -2069,23 +2069,23 @@ const Oe = ({
2069
2069
  matches: L,
2070
2070
  argumentMatches: q,
2071
2071
  currentArg: A,
2072
- isEnteringArgs: z.isEnteringArgs,
2072
+ isEnteringArgs: P.isEnteringArgs,
2073
2073
  selectedIndex: v,
2074
- onSelect: (V) => {
2074
+ onSelect: (B) => {
2075
2075
  var N;
2076
- if (z.isEnteringArgs) {
2077
- const Q = q[V];
2076
+ if (P.isEnteringArgs) {
2077
+ const Q = q[B];
2078
2078
  if (Q) {
2079
- let re = `/${z.commandName}`;
2080
- for (const ae of z.enteredArgs)
2079
+ let re = `/${P.commandName}`;
2080
+ for (const ae of P.enteredArgs)
2081
2081
  re += ` ${ae}`;
2082
2082
  re += ` ${Q.option}`;
2083
- const de = z.currentArgIndex + 1;
2084
- ((N = z.command) == null ? void 0 : N.args) && de < z.command.args.length && (re += " "), n(re);
2083
+ const de = P.currentArgIndex + 1;
2084
+ ((N = P.command) == null ? void 0 : N.args) && de < P.command.args.length && (re += " "), n(re);
2085
2085
  }
2086
2086
  return;
2087
2087
  }
2088
- const Y = L[V];
2088
+ const Y = L[B];
2089
2089
  if (Y) {
2090
2090
  const Q = Y.command;
2091
2091
  let re = `/${Q.name}`;
@@ -2114,7 +2114,7 @@ const Oe = ({
2114
2114
  ` })
2115
2115
  ] });
2116
2116
  };
2117
- Oe.displayName = "AgentCommandPalette";
2117
+ Fe.displayName = "AgentCommandPalette";
2118
2118
  function pe(o, e) {
2119
2119
  const t = o.toLowerCase(), r = e.toLowerCase();
2120
2120
  if (!t)
@@ -2125,7 +2125,7 @@ function pe(o, e) {
2125
2125
  r[c] === t[i] && (s.push(c), g === c - 1 ? (n++, a += n * 2) : n = 1, c === 0 && (a += 10), c > 0 && /[_\-\s]/.test(e[c - 1]) && (a += 5), a += 1, g = c, i++);
2126
2126
  return i < t.length ? null : (a -= e.length * 0.1, t === r && (a += 20), r.startsWith(t) && (a += 15), { score: a, matchedIndices: s });
2127
2127
  }
2128
- function Ve(o, e, t = 10) {
2128
+ function Be(o, e, t = 10) {
2129
2129
  const r = o.replace(/^\//, "").trim();
2130
2130
  if (!r)
2131
2131
  return [];
@@ -2158,7 +2158,7 @@ function Ve(o, e, t = 10) {
2158
2158
  }
2159
2159
  return s.sort((i, a) => a.score - i.score).slice(0, t);
2160
2160
  }
2161
- function Be(o, e) {
2161
+ function Ve(o, e) {
2162
2162
  const r = o.replace(/^\//, "").split(/\s+/), s = r[0] || "", i = o.endsWith(" ") && o.trim().length > 0, a = e.find(
2163
2163
  (g) => {
2164
2164
  var c;
@@ -2238,14 +2238,14 @@ function yt({
2238
2238
  agentAvailable: i = !0,
2239
2239
  quickCommands: a = []
2240
2240
  } = {}) {
2241
- const [n, g] = _(!1), [c, x] = _(""), [p, h] = _("natural"), [C, f] = _("idle"), [d, u] = _([]), [y, L] = _([]), [q, z] = _(""), [A, v] = _([]), [S, k] = _(-1), I = ne(() => s, [s]), [W, $] = _(-1), T = ne(() => p !== "quick-command" || !a.length ? {
2241
+ const [n, g] = _(!1), [c, x] = _(""), [p, h] = _("natural"), [C, f] = _("idle"), [d, u] = _([]), [y, L] = _([]), [q, P] = _(""), [A, v] = _([]), [S, k] = _(-1), I = ne(() => s, [s]), [W, $] = _(-1), T = ne(() => p !== "quick-command" || !a.length ? {
2242
2242
  commandName: "",
2243
2243
  command: null,
2244
2244
  enteredArgs: [],
2245
2245
  currentArgValue: "",
2246
2246
  currentArgIndex: -1,
2247
2247
  isEnteringArgs: !1
2248
- } : Be(c, a), [c, p, a]), P = ne(() => p !== "quick-command" || !a.length || T.isEnteringArgs ? [] : Ve(c, a), [c, p, a, T.isEnteringArgs]), B = ne(() => {
2248
+ } : Ve(c, a), [c, p, a]), z = ne(() => p !== "quick-command" || !a.length || T.isEnteringArgs ? [] : Be(c, a), [c, p, a, T.isEnteringArgs]), V = ne(() => {
2249
2249
  var R;
2250
2250
  if (!T.isEnteringArgs || !((R = T.command) != null && R.args))
2251
2251
  return [];
@@ -2254,14 +2254,14 @@ function yt({
2254
2254
  }, [T]), se = ne(() => {
2255
2255
  var m;
2256
2256
  return !T.isEnteringArgs || !((m = T.command) != null && m.args) ? null : T.command.args[T.currentArgIndex] || null;
2257
- }, [T]), G = ne(() => p !== "quick-command" || C !== "idle" || c.length === 0 ? !1 : P.length > 0 || B.length > 0, [p, C, c.length, P.length, B.length]), K = ne(() => T.isEnteringArgs ? B.length : P.length, [T.isEnteringArgs, B.length, P.length]);
2257
+ }, [T]), G = ne(() => p !== "quick-command" || C !== "idle" || c.length === 0 ? !1 : z.length > 0 || V.length > 0, [p, C, c.length, z.length, V.length]), K = ne(() => T.isEnteringArgs ? V.length : z.length, [T.isEnteringArgs, V.length, z.length]);
2258
2258
  E(() => {
2259
2259
  $(K > 0 ? 0 : -1);
2260
2260
  }, [K]);
2261
2261
  const te = w((m) => {
2262
2262
  x(m), h(m.startsWith("/") ? "quick-command" : "natural");
2263
2263
  }, []), H = w(() => {
2264
- g(!0), i ? (x(""), h("natural")) : (x("/"), h("quick-command")), f("idle"), u([]), L([]), z(""), k(-1), o == null || o.emit({
2264
+ g(!0), i ? (x(""), h("natural")) : (x("/"), h("quick-command")), f("idle"), u([]), L([]), P(""), k(-1), o == null || o.emit({
2265
2265
  type: "agent-command-palette:opened",
2266
2266
  source: "agent-command-palette",
2267
2267
  timestamp: Date.now(),
@@ -2276,8 +2276,8 @@ function yt({
2276
2276
  });
2277
2277
  }, [o]), oe = w(() => {
2278
2278
  n ? M() : H();
2279
- }, [n, H, M]), V = w(() => {
2280
- x(""), h("natural"), f("idle"), u([]), L([]), z(""), k(-1);
2279
+ }, [n, H, M]), B = w(() => {
2280
+ x(""), h("natural"), f("idle"), u([]), L([]), P(""), k(-1);
2281
2281
  }, []), Y = w((m) => {
2282
2282
  const R = {
2283
2283
  ...m,
@@ -2286,16 +2286,16 @@ function yt({
2286
2286
  return u((j) => [...j, R]), R;
2287
2287
  }, []), N = w(
2288
2288
  (m, R, j, X) => {
2289
- u((F) => {
2290
- const J = F.find((Z) => Z.id === m);
2291
- if (!J) return F;
2289
+ u((O) => {
2290
+ const J = O.find((Z) => Z.id === m);
2291
+ if (!J) return O;
2292
2292
  const D = {
2293
2293
  ...J,
2294
2294
  status: R,
2295
2295
  result: j,
2296
2296
  error: X
2297
2297
  };
2298
- return R === "success" || R === "error" ? (L((Z) => [...Z, D]), F.filter((Z) => Z.id !== m)) : F.map((Z) => Z.id === m ? D : Z);
2298
+ return R === "success" || R === "error" ? (L((Z) => [...Z, D]), O.filter((Z) => Z.id !== m)) : O.map((Z) => Z.id === m ? D : Z);
2299
2299
  });
2300
2300
  },
2301
2301
  []
@@ -2304,18 +2304,18 @@ function yt({
2304
2304
  const R = m.replace(/^\//, "").trim().split(/\s+/), j = R[0], X = R.slice(1);
2305
2305
  if (!j) return;
2306
2306
  f("executing");
2307
- const F = `quick-${Date.now()}`;
2307
+ const O = `quick-${Date.now()}`;
2308
2308
  Y({
2309
- id: F,
2309
+ id: O,
2310
2310
  name: j,
2311
2311
  args: { args: X }
2312
- }), N(F, "running");
2312
+ }), N(O, "running");
2313
2313
  try {
2314
2314
  if (r) {
2315
2315
  const D = await r(j, { args: X });
2316
- N(F, "success", String(D));
2316
+ N(O, "success", String(D));
2317
2317
  } else
2318
- N(F, "success", "Tool executed (no handler)");
2318
+ N(O, "success", "Tool executed (no handler)");
2319
2319
  v((D) => [
2320
2320
  {
2321
2321
  query: m,
@@ -2324,12 +2324,12 @@ function yt({
2324
2324
  success: !0
2325
2325
  },
2326
2326
  ...D.slice(0, (t.maxHistoryEntries || 50) - 1)
2327
- ]), f("complete"), z(`Executed: ${j}`);
2327
+ ]), f("complete"), P(`Executed: ${j}`);
2328
2328
  const J = t.autoCloseDelay ?? 1e3;
2329
2329
  J > 0 && setTimeout(() => M(), J);
2330
2330
  } catch (J) {
2331
2331
  const D = J instanceof Error ? J.message : "Unknown error";
2332
- N(F, "error", void 0, D), f("error"), z(`Error: ${D}`);
2332
+ N(O, "error", void 0, D), f("error"), P(`Error: ${D}`);
2333
2333
  }
2334
2334
  },
2335
2335
  [r, Y, N, t.autoCloseDelay, t.maxHistoryEntries, M]
@@ -2340,7 +2340,7 @@ function yt({
2340
2340
  return;
2341
2341
  }
2342
2342
  if (!i) {
2343
- z("Agent unavailable. Use quick commands (start with /)."), f("error");
2343
+ P("Agent unavailable. Use quick commands (start with /)."), f("error");
2344
2344
  return;
2345
2345
  }
2346
2346
  f("thinking"), o == null || o.emit({
@@ -2375,9 +2375,9 @@ function yt({
2375
2375
  key: R = "p",
2376
2376
  altKey: j = !0,
2377
2377
  ctrlKey: X = !1,
2378
- metaKey: F = !1,
2378
+ metaKey: O = !1,
2379
2379
  shiftKey: J = !1
2380
- } = e, D = m.altKey === j && m.ctrlKey === X && m.metaKey === F && m.shiftKey === J;
2380
+ } = e, D = m.altKey === j && m.ctrlKey === X && m.metaKey === O && m.shiftKey === J;
2381
2381
  if ((j ? m.code === `Key${R.toUpperCase()}` : m.key.toLowerCase() === R.toLowerCase()) && D) {
2382
2382
  const ie = m.target;
2383
2383
  if (!ie.closest("[data-agent-command-palette-input]") && (ie.tagName === "INPUT" || ie.tagName === "TEXTAREA" || ie.isContentEditable))
@@ -2397,25 +2397,25 @@ function yt({
2397
2397
  (m) => m > 0 ? m - 1 : K - 1
2398
2398
  );
2399
2399
  }, [G, K]), _e = w((m = !1) => {
2400
- var F;
2400
+ var O;
2401
2401
  if (!G || W < 0) return;
2402
2402
  if (T.isEnteringArgs) {
2403
- const J = B[W];
2403
+ const J = V[W];
2404
2404
  if (!J) return;
2405
2405
  let D = `/${T.commandName}`;
2406
2406
  for (const fe of T.enteredArgs)
2407
2407
  D += ` ${fe}`;
2408
2408
  D += ` ${J.option}`;
2409
2409
  const Z = T.currentArgIndex + 1;
2410
- ((F = T.command) == null ? void 0 : F.args) && Z < T.command.args.length ? (D += " ", x(D), $(-1)) : (x(D), $(-1), m && setTimeout(() => Q(D), 0));
2410
+ ((O = T.command) == null ? void 0 : O.args) && Z < T.command.args.length ? (D += " ", x(D), $(-1)) : (x(D), $(-1), m && setTimeout(() => Q(D), 0));
2411
2411
  return;
2412
2412
  }
2413
- const R = P[W];
2413
+ const R = z[W];
2414
2414
  if (!R) return;
2415
2415
  const j = R.command;
2416
2416
  let X = `/${j.name}`;
2417
2417
  j.args && j.args.length > 0 ? (X += " ", x(X), $(-1)) : (x(X), $(-1), m && setTimeout(() => Q(X), 0));
2418
- }, [G, W, T, B, P, Q]);
2418
+ }, [G, W, T, V, z, Q]);
2419
2419
  return {
2420
2420
  // Agent availability
2421
2421
  agentAvailable: i,
@@ -2434,7 +2434,7 @@ function yt({
2434
2434
  pendingTools: d,
2435
2435
  completedTools: y,
2436
2436
  agentResponse: q,
2437
- setAgentResponse: z,
2437
+ setAgentResponse: P,
2438
2438
  submit: re,
2439
2439
  executeQuickCommand: Q,
2440
2440
  // Tool management (for external AI integration)
@@ -2447,10 +2447,10 @@ function yt({
2447
2447
  // Suggestions
2448
2448
  suggestions: I,
2449
2449
  // Actions
2450
- clear: V,
2450
+ clear: B,
2451
2451
  // Quick command autocomplete
2452
- quickCommandMatches: P,
2453
- argumentOptionMatches: B,
2452
+ quickCommandMatches: z,
2453
+ argumentOptionMatches: V,
2454
2454
  parsedQuery: T,
2455
2455
  currentArgDef: se,
2456
2456
  selectedAutocompleteIndex: W,
@@ -2693,7 +2693,7 @@ const Se = {
2693
2693
  call_template_type: "panel_event",
2694
2694
  event_type: "panel:switch"
2695
2695
  }
2696
- }, ze = {
2696
+ }, Pe = {
2697
2697
  name: "focus_panel",
2698
2698
  description: "Set focus to a specific panel slot for keyboard navigation.",
2699
2699
  inputs: {
@@ -2719,7 +2719,7 @@ const Se = {
2719
2719
  call_template_type: "panel_event",
2720
2720
  event_type: "panel:focus"
2721
2721
  }
2722
- }, Pe = {
2722
+ }, ze = {
2723
2723
  name: "reset_layout",
2724
2724
  description: "Reset panel sizes to the default layout configuration.",
2725
2725
  inputs: {
@@ -2749,8 +2749,8 @@ const Se = {
2749
2749
  Ie,
2750
2750
  $e,
2751
2751
  Ae,
2752
- ze,
2753
- Pe
2752
+ Pe,
2753
+ ze
2754
2754
  ], xt = [
2755
2755
  Se,
2756
2756
  ve,
@@ -2760,8 +2760,8 @@ const Se = {
2760
2760
  Ie,
2761
2761
  $e,
2762
2762
  Ae,
2763
- ze,
2764
- Pe
2763
+ Pe,
2764
+ ze
2765
2765
  ], bt = {
2766
2766
  id: "panel-layouts",
2767
2767
  name: "Panel Layouts",
@@ -3109,7 +3109,7 @@ const Xe = ({ size: o = 18 }) => /* @__PURE__ */ b(
3109
3109
  rightCollapseButtonProps: y,
3110
3110
  leftMiddleSwitchButtonProps: L,
3111
3111
  rightMiddleSwitchButtonProps: q,
3112
- configureButtonProps: z
3112
+ configureButtonProps: P
3113
3113
  }) => t && e || n && a || p && x || c && g || i && s ? /* @__PURE__ */ b(
3114
3114
  "div",
3115
3115
  {
@@ -3145,7 +3145,7 @@ const Xe = ({ size: o = 18 }) => /* @__PURE__ */ b(
3145
3145
  {
3146
3146
  onConfigure: x,
3147
3147
  iconSize: d ?? 14,
3148
- ...z
3148
+ ...P
3149
3149
  }
3150
3150
  ),
3151
3151
  c && g && /* @__PURE__ */ l(
@@ -3172,24 +3172,25 @@ const Xe = ({ size: o = 18 }) => /* @__PURE__ */ b(
3172
3172
  ) : null;
3173
3173
  export {
3174
3174
  xe as AgentCommandInput,
3175
- Oe as AgentCommandPalette,
3175
+ Fe as AgentCommandPalette,
3176
3176
  be as AgentResponseDisplay,
3177
- zt as EditableConfigurablePanelLayout,
3177
+ Pt as EditableConfigurablePanelLayout,
3178
3178
  ht as FocusIndicator,
3179
3179
  mt as FocusModeOverlay,
3180
3180
  De as LocalStoragePersistenceAdapter,
3181
3181
  Me as LocalStorageWorkspaceAdapter,
3182
+ zt as PanelBoundsProvider,
3182
3183
  me as PanelCollapseButton,
3183
3184
  st as PanelConfigureButton,
3184
3185
  It as PanelControls,
3185
3186
  ye as PanelSwitchButton,
3186
3187
  we as QuickCommandAutocomplete,
3187
- Pt as ResponsiveConfigurablePanelLayout,
3188
+ Lt as ResponsiveConfigurablePanelLayout,
3188
3189
  ke as ToolExecutionList,
3189
- O as WorkspaceLayoutService,
3190
+ F as WorkspaceLayoutService,
3190
3191
  Ie as collapseAllPanelsTool,
3191
3192
  $e as expandAllPanelsTool,
3192
- ze as focusPanelTool,
3193
+ Pe as focusPanelTool,
3193
3194
  pe as fuzzyMatch,
3194
3195
  Ct as generateToolsSystemPrompt,
3195
3196
  ve as getPanelStateTool,
@@ -3198,10 +3199,10 @@ export {
3198
3199
  Qe as layoutTools,
3199
3200
  bt as layoutToolsMetadata,
3200
3201
  Te as listPanelsWithStateTool,
3201
- Lt as mapThemeToPanelVars,
3202
- Wt as mapThemeToTabVars,
3203
- Pe as resetLayoutTool,
3204
- Ve as searchQuickCommands,
3202
+ Wt as mapThemeToPanelVars,
3203
+ _t as mapThemeToTabVars,
3204
+ ze as resetLayoutTool,
3205
+ Be as searchQuickCommands,
3205
3206
  xt as stateQueryTools,
3206
3207
  Ae as switchPanelTool,
3207
3208
  Ce as togglePanelTool,
@@ -3214,9 +3215,11 @@ export {
3214
3215
  wt as toolsToGeminiFormat,
3215
3216
  St as toolsToOpenAIFormat,
3216
3217
  yt as useAgentCommandPalette,
3218
+ Et as usePanelBounds,
3217
3219
  ut as usePanelFocus,
3218
3220
  gt as usePanelFocusListener,
3219
3221
  ft as usePanelKeyboardShortcuts,
3222
+ Rt as usePanelOffset,
3220
3223
  dt as usePanelPersistence,
3221
3224
  pt as useWorkspace
3222
3225
  };