@industry-theme/github-panels 0.1.59 → 0.1.61

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,3 +1,6 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1
4
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
5
  import * as React2 from "react";
3
6
  import React2__default, { createContext, useContext, forwardRef, createElement, useState, useRef, useEffect, useCallback, useMemo, useLayoutEffect, useImperativeHandle } from "react";
@@ -1038,10 +1041,10 @@ const GitHubProjectsPanelContent = ({
1038
1041
  const [expandedSections, setExpandedSections] = useState(
1039
1042
  /* @__PURE__ */ new Set(["owned", "starred"])
1040
1043
  );
1041
- const githubSlice = context.getSlice("github-repositories");
1042
- const isLoading = context.isSliceLoading("github-repositories");
1043
- const hasData = context.hasSlice("github-repositories");
1044
- const data = githubSlice == null ? void 0 : githubSlice.data;
1044
+ const { githubRepositories } = context;
1045
+ const isLoading = (githubRepositories == null ? void 0 : githubRepositories.loading) ?? false;
1046
+ const hasData = !!githubRepositories;
1047
+ const data = githubRepositories == null ? void 0 : githubRepositories.data;
1045
1048
  useEffect(() => {
1046
1049
  const container = containerRef.current;
1047
1050
  if (!container) return;
@@ -1424,7 +1427,8 @@ const GitHubProjectsPanelMetadata = {
1424
1427
  description: "Browse and manage your GitHub repositories",
1425
1428
  icon: "github",
1426
1429
  version: "0.1.0",
1427
- slices: ["github-repositories"],
1430
+ slices: ["githubRepositories"],
1431
+ // Typed context slice declaration
1428
1432
  surfaces: ["sidebar", "panel"]
1429
1433
  };
1430
1434
  const RepositoryAvatar = ({
@@ -1477,6 +1481,101 @@ const RepositoryAvatar = ({
1477
1481
  }
1478
1482
  );
1479
1483
  };
1484
+ createContext(null);
1485
+ class PanelErrorBoundary extends React2__default.Component {
1486
+ constructor(props) {
1487
+ super(props);
1488
+ __publicField(this, "reset", () => {
1489
+ this.setState({ error: null });
1490
+ });
1491
+ this.state = { error: null };
1492
+ }
1493
+ static getDerivedStateFromError(error) {
1494
+ return { error };
1495
+ }
1496
+ componentDidCatch(error, errorInfo) {
1497
+ console.error("Panel error:", error, errorInfo);
1498
+ }
1499
+ render() {
1500
+ if (this.state.error) {
1501
+ const Fallback = this.props.fallback;
1502
+ return /* @__PURE__ */ jsx(Fallback, {
1503
+ error: this.state.error,
1504
+ reset: this.reset
1505
+ });
1506
+ }
1507
+ return this.props.children;
1508
+ }
1509
+ }
1510
+ var PANEL_DATA_MIME_TYPE = "application/x-panel-data";
1511
+ function createDragPreview(content2, options) {
1512
+ const preview = document.createElement("div");
1513
+ preview.style.cssText = `
1514
+ position: absolute;
1515
+ top: -1000px;
1516
+ left: -1000px;
1517
+ padding: 8px 12px;
1518
+ background: ${"#3b82f6"};
1519
+ color: ${"white"};
1520
+ border-radius: 6px;
1521
+ font-size: 12px;
1522
+ box-shadow: 0 2px 8px rgba(0,0,0,0.2);
1523
+ display: flex;
1524
+ align-items: center;
1525
+ gap: 8px;
1526
+ white-space: nowrap;
1527
+ `;
1528
+ const text2 = document.createElement("span");
1529
+ text2.textContent = content2;
1530
+ preview.appendChild(text2);
1531
+ return preview;
1532
+ }
1533
+ function useDraggable(config) {
1534
+ const [isDragging, setIsDragging] = useState(false);
1535
+ const handleDragStart = useCallback((e) => {
1536
+ var _a;
1537
+ setIsDragging(true);
1538
+ e.dataTransfer.setData("text/plain", config.primaryData);
1539
+ const panelData = {
1540
+ sourcePanel: config.sourcePanel || "unknown",
1541
+ dataType: config.dataType,
1542
+ primaryData: config.primaryData,
1543
+ metadata: config.metadata,
1544
+ suggestedActions: config.suggestedActions,
1545
+ version: "1.0"
1546
+ };
1547
+ e.dataTransfer.setData(PANEL_DATA_MIME_TYPE, JSON.stringify(panelData));
1548
+ e.dataTransfer.effectAllowed = "copy";
1549
+ if (e.currentTarget instanceof HTMLElement) {
1550
+ e.currentTarget.style.opacity = "0.5";
1551
+ }
1552
+ if (config.dragPreview) {
1553
+ if (config.dragPreview instanceof HTMLElement) {
1554
+ e.dataTransfer.setDragImage(config.dragPreview, 0, 0);
1555
+ } else {
1556
+ const preview = createDragPreview(config.dragPreview);
1557
+ document.body.appendChild(preview);
1558
+ e.dataTransfer.setDragImage(preview, 0, 0);
1559
+ setTimeout(() => document.body.removeChild(preview), 0);
1560
+ }
1561
+ }
1562
+ (_a = config.onDragStart) == null ? void 0 : _a.call(config, e);
1563
+ }, [config]);
1564
+ const handleDragEnd = useCallback((e) => {
1565
+ var _a;
1566
+ setIsDragging(false);
1567
+ if (e.currentTarget instanceof HTMLElement) {
1568
+ e.currentTarget.style.opacity = "1";
1569
+ }
1570
+ (_a = config.onDragEnd) == null ? void 0 : _a.call(config, e);
1571
+ }, [config]);
1572
+ return {
1573
+ draggable: true,
1574
+ onDragStart: handleDragStart,
1575
+ onDragEnd: handleDragEnd,
1576
+ isDragging
1577
+ };
1578
+ }
1480
1579
  const GitHubRepositoryCard = ({
1481
1580
  repository,
1482
1581
  localRepo,
@@ -1492,6 +1591,23 @@ const GitHubRepositoryCard = ({
1492
1591
  const { theme: theme2 } = useTheme();
1493
1592
  const [isHovered, setIsHovered] = useState(false);
1494
1593
  const isCloned = Boolean(localRepo);
1594
+ const { isDragging, ...dragProps } = useDraggable({
1595
+ dataType: "repository-github",
1596
+ primaryData: repository.full_name,
1597
+ metadata: {
1598
+ name: repository.name,
1599
+ owner: repository.owner.login,
1600
+ description: repository.description,
1601
+ language: repository.language,
1602
+ stars: repository.stargazers_count,
1603
+ isPrivate: repository.private,
1604
+ htmlUrl: repository.html_url,
1605
+ cloneUrl: repository.clone_url
1606
+ },
1607
+ suggestedActions: ["add-to-collection"],
1608
+ sourcePanel: "github-repositories",
1609
+ dragPreview: repository.full_name
1610
+ });
1495
1611
  const handleClone = useCallback(
1496
1612
  (e) => {
1497
1613
  e.stopPropagation();
@@ -1549,6 +1665,7 @@ const GitHubRepositoryCard = ({
1549
1665
  onClick: handleClick,
1550
1666
  onMouseEnter: () => setIsHovered(true),
1551
1667
  onMouseLeave: () => setIsHovered(false),
1668
+ ...isInCollection ? {} : dragProps,
1552
1669
  style: {
1553
1670
  display: "flex",
1554
1671
  alignItems: "flex-start",
@@ -1557,8 +1674,9 @@ const GitHubRepositoryCard = ({
1557
1674
  borderRadius: "8px",
1558
1675
  backgroundColor: isSelected ? `${theme2.colors.primary}15` : isHovered ? theme2.colors.backgroundTertiary : "transparent",
1559
1676
  border: `1px solid ${isSelected ? theme2.colors.primary : "transparent"}`,
1560
- cursor: onSelect ? "pointer" : "default",
1561
- transition: "background-color 0.15s, border-color 0.15s"
1677
+ cursor: isInCollection ? "not-allowed" : isDragging ? "grabbing" : onSelect ? "grab" : "default",
1678
+ opacity: isDragging ? 0.5 : isInCollection ? 0.7 : 1,
1679
+ transition: "background-color 0.15s, border-color 0.15s, opacity 0.15s"
1562
1680
  },
1563
1681
  children: [
1564
1682
  /* @__PURE__ */ jsx(
@@ -1869,8 +1987,7 @@ const GitHubSearchPanelContent = ({ context, actions, events }) => {
1869
1987
  const [selectedRepoId, setSelectedRepoId] = useState(null);
1870
1988
  const searchTimeoutRef = useRef(null);
1871
1989
  const inputRef = useRef(null);
1872
- const workspaceSlice = context.getSlice("workspace");
1873
- const workspaceReposSlice = context.getSlice("workspaceRepositories");
1990
+ const { workspace: workspaceSlice, workspaceRepositories: workspaceReposSlice } = context;
1874
1991
  const currentWorkspace = (_a = workspaceSlice == null ? void 0 : workspaceSlice.data) == null ? void 0 : _a.workspace;
1875
1992
  const collectionName = currentWorkspace == null ? void 0 : currentWorkspace.name;
1876
1993
  const collectionRepos = useMemo(
@@ -3687,13 +3804,16 @@ function C$1(e) {
3687
3804
  return { "--panel-background": e.colors.background, "--panel-border": e.colors.border, "--panel-handle": e.colors.backgroundSecondary, "--panel-handle-hover": e.colors.backgroundHover, "--panel-handle-active": e.colors.primary, "--panel-button-bg": e.colors.surface, "--panel-button-hover": e.colors.backgroundHover, "--panel-button-border": e.colors.border, "--panel-button-icon": e.colors.textSecondary, "--panel-accent-bg": e.colors.primary + "15" };
3688
3805
  }
3689
3806
  const z$1 = forwardRef(({ panels: o, className: a = "", style: s2, theme: d, minPanelWidth: u = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m, preventKeyboardScroll: f = true, disableSwipe: g = false }, v) => {
3690
- const b = useRef(null), y = C$1(d);
3807
+ const b = useRef(null), y = useRef(false), w = useRef(null), x = C$1(d);
3691
3808
  useImperativeHandle(v, () => ({ scrollToPanel: (e) => {
3692
3809
  if (!b.current) return;
3693
3810
  const t = b.current, n = t.children[e];
3694
3811
  if (n) {
3812
+ y.current = true, w.current && clearTimeout(w.current);
3695
3813
  const e2 = n.offsetLeft;
3696
- t.scrollTo({ left: e2, behavior: "smooth" });
3814
+ t.scrollTo({ left: e2, behavior: "smooth" }), w.current = setTimeout(() => {
3815
+ y.current = false;
3816
+ }, 500);
3697
3817
  }
3698
3818
  }, getCurrentPanel: () => {
3699
3819
  if (!b.current || 0 === b.current.children.length) return 0;
@@ -3715,24 +3835,27 @@ const z$1 = forwardRef(({ panels: o, className: a = "", style: s2, theme: d, min
3715
3835
  return e.addEventListener("keydown", t), () => {
3716
3836
  e.removeEventListener("keydown", t);
3717
3837
  };
3718
- }, [f]);
3719
- const w = o.length, x = 2 * u;
3720
- let S;
3721
- S = 1 === w || 2 === w ? "100%" : `max(${u}px, ${100 * p2}%)`;
3722
- const R = React2__default.useId().replace(/:/g, "_");
3838
+ }, [f]), useEffect(() => () => {
3839
+ w.current && clearTimeout(w.current);
3840
+ }, []);
3841
+ const S = o.length, R = 2 * u;
3842
+ let N;
3843
+ N = 1 === S || 2 === S ? "100%" : `max(${u}px, ${100 * p2}%)`;
3844
+ const E = React2__default.useId().replace(/:/g, "_");
3723
3845
  return jsxs(Fragment, { children: [
3724
- 2 === w && /* @__PURE__ */ jsx("style", { children: `
3725
- .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
3846
+ 2 === S && /* @__PURE__ */ jsx("style", { children: `
3847
+ .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
3726
3848
  width: 100%;
3727
3849
  }
3728
- @container (min-width: ${x}px) {
3729
- .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
3850
+ @container (min-width: ${R}px) {
3851
+ .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
3730
3852
  width: 50%;
3731
3853
  }
3732
3854
  }
3733
3855
  ` }),
3734
- /* @__PURE__ */ jsx("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a}`, style: { ...y, ...s2, "--snap-carousel-min-width": `${u}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": S, "--snap-carousel-panel-count": w, "--snap-carousel-two-panel-threshold": `${x}px` }, onScroll: (e) => {
3856
+ /* @__PURE__ */ jsx("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a}`, style: { ...x, ...s2, "--snap-carousel-min-width": `${u}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": N, "--snap-carousel-panel-count": S, "--snap-carousel-two-panel-threshold": `${R}px` }, onScroll: (e) => {
3735
3857
  if (!m || !b.current || 0 === b.current.children.length) return;
3858
+ if (y.current) return;
3736
3859
  const t = b.current, n = t.getBoundingClientRect().left;
3737
3860
  let r2 = 0, o2 = 1 / 0;
3738
3861
  for (let i = 0; i < t.children.length; i++) {
@@ -3740,7 +3863,7 @@ const z$1 = forwardRef(({ panels: o, className: a = "", style: s2, theme: d, min
3740
3863
  a2 < o2 && (o2 = a2, r2 = i);
3741
3864
  }
3742
3865
  m(r2);
3743
- }, "data-panel-count": w, "data-carousel-id": R, children: o.map((t, n) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t }, n)) })
3866
+ }, "data-panel-count": S, "data-carousel-id": E, children: o.map((t, n) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t }, n)) })
3744
3867
  ] });
3745
3868
  });
3746
3869
  z$1.displayName = "SnapCarousel";
@@ -3749,8 +3872,8 @@ var le$2, se$1;
3749
3872
  const de$1 = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
3750
3873
  var Te$1, Ae$1;
3751
3874
  (Ae$1 = Te$1 || (Te$1 = {}))[Ae$1.Forward = 1] = "Forward", Ae$1[Ae$1.Backward = -1] = "Backward";
3752
- var _e$2, je$1, He$1, Ke$1;
3753
- (je$1 = _e$2 || (_e$2 = {})).Click = "click", je$1.DragStart = "dragstart", je$1.Keydown = "keydown", je$1.ContextMenu = "contextmenu", je$1.Resize = "resize", je$1.SelectionChange = "selectionchange", je$1.VisibilityChange = "visibilitychange", (Ke$1 = He$1 || (He$1 = {})).Space = "Space", Ke$1.Down = "ArrowDown", Ke$1.Right = "ArrowRight", Ke$1.Left = "ArrowLeft", Ke$1.Up = "ArrowUp", Ke$1.Esc = "Escape", Ke$1.Enter = "Enter", Ke$1.Tab = "Tab";
3875
+ var _e$1, je$1, He$1, Ke$1;
3876
+ (je$1 = _e$1 || (_e$1 = {})).Click = "click", je$1.DragStart = "dragstart", je$1.Keydown = "keydown", je$1.ContextMenu = "contextmenu", je$1.Resize = "resize", je$1.SelectionChange = "selectionchange", je$1.VisibilityChange = "visibilitychange", (Ke$1 = He$1 || (He$1 = {})).Space = "Space", Ke$1.Down = "ArrowDown", Ke$1.Right = "ArrowRight", Ke$1.Left = "ArrowLeft", Ke$1.Up = "ArrowUp", Ke$1.Esc = "Escape", Ke$1.Enter = "Enter", Ke$1.Tab = "Tab";
3754
3877
  ({ start: [He$1.Space, He$1.Enter], cancel: [He$1.Esc], end: [He$1.Space, He$1.Enter, He$1.Tab] });
3755
3878
  var rt$1, ot$1;
3756
3879
  (ot$1 = rt$1 || (rt$1 = {}))[ot$1.RightClick = 2] = "RightClick";
@@ -3771,10 +3894,10 @@ var Ut$1;
3771
3894
  }
3772
3895
  return Ut$1 || (Ut$1 = createContext(void 0)), Ut$1;
3773
3896
  })();
3774
- var _e$1 = Object.defineProperty;
3775
- var Ee = (o, e, t) => e in o ? _e$1(o, e, { enumerable: true, configurable: true, writable: true, value: t }) : o[e] = t;
3776
- var le$1 = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
3777
- class De {
3897
+ var Ee = Object.defineProperty;
3898
+ var Re = (o, e, t) => e in o ? Ee(o, e, { enumerable: true, configurable: true, writable: true, value: t }) : o[e] = t;
3899
+ var le$1 = (o, e, t) => Re(o, typeof e != "symbol" ? e + "" : e, t);
3900
+ class Me {
3778
3901
  constructor() {
3779
3902
  le$1(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
3780
3903
  le$1(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
@@ -3841,10 +3964,10 @@ class De {
3841
3964
  if (i)
3842
3965
  try {
3843
3966
  e[s2] = JSON.parse(i);
3844
- } catch (l) {
3967
+ } catch (a) {
3845
3968
  console.error(
3846
3969
  `Failed to parse repository state for ${s2}:`,
3847
- l
3970
+ a
3848
3971
  );
3849
3972
  }
3850
3973
  }
@@ -3915,11 +4038,11 @@ class O {
3915
4038
  createdAt: s2.createdAt,
3916
4039
  // Preserve creation time
3917
4040
  updatedAt: Date.now()
3918
- }, l = {
4041
+ }, a = {
3919
4042
  ...r2,
3920
4043
  [e]: i
3921
4044
  };
3922
- return await this.adapter.saveWorkspacePresets(l), i;
4045
+ return await this.adapter.saveWorkspacePresets(a), i;
3923
4046
  }
3924
4047
  /**
3925
4048
  * Delete a workspace layout
@@ -4244,13 +4367,13 @@ class O {
4244
4367
  Object.keys(e).length;
4245
4368
  }
4246
4369
  }
4247
- le$1(O, "adapter", new De());
4370
+ le$1(O, "adapter", new Me());
4248
4371
  function gt(o, e, t, r2) {
4249
4372
  useEffect(() => {
4250
4373
  const s2 = e.on(
4251
4374
  "panel:focus",
4252
- (l) => {
4253
- l.payload.panelId === o && t();
4375
+ (a) => {
4376
+ a.payload.panelId === o && t();
4254
4377
  }
4255
4378
  );
4256
4379
  return () => {
@@ -4714,9 +4837,9 @@ const GitHubIssuesPanelContent = ({
4714
4837
  return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
4715
4838
  }
4716
4839
  );
4717
- const issuesSlice = context.getSlice("github-issues");
4718
- const isLoading = context.isSliceLoading("github-issues");
4719
- const hasData = context.hasSlice("github-issues");
4840
+ const { githubIssues: issuesSlice } = context;
4841
+ const isLoading = (issuesSlice == null ? void 0 : issuesSlice.loading) ?? false;
4842
+ const hasData = !!issuesSlice;
4720
4843
  const issues = ((_a = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _a.issues) ?? [];
4721
4844
  const owner = ((_b = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _b.owner) ?? "";
4722
4845
  const repo = ((_c = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _c.repo) ?? "";
@@ -5327,7 +5450,8 @@ const GitHubIssuesPanelMetadata = {
5327
5450
  description: "View and manage GitHub repository issues",
5328
5451
  icon: "circle-dot",
5329
5452
  version: "0.1.0",
5330
- slices: ["github-issues"],
5453
+ slices: ["githubIssues"],
5454
+ // Typed context slice declaration
5331
5455
  surfaces: ["panel"]
5332
5456
  };
5333
5457
  const VOID = -1;
@@ -51413,6 +51537,7 @@ const TimelineEventRenderer = ({ event, onToggleReaction, getMergedReactions })
51413
51537
  };
51414
51538
  const GitHubMessagesPanelContent = ({ context, events }) => {
51415
51539
  var _a;
51540
+ const { githubMessages: messagesSlice } = context;
51416
51541
  const { theme: theme2 } = useTheme();
51417
51542
  const panelRef = useRef(null);
51418
51543
  const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
@@ -51430,8 +51555,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51430
51555
  const [sendError, setSendError] = useState(null);
51431
51556
  const textareaRef = useRef(null);
51432
51557
  const handleDelete2 = () => {
51433
- const messagesSlice2 = context.getSlice("github-messages");
51434
- const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51558
+ const messagesData2 = messagesSlice == null ? void 0 : messagesSlice.data;
51435
51559
  if ((messagesData2 == null ? void 0 : messagesData2.target) && events) {
51436
51560
  const { target: target2, owner, repo } = messagesData2;
51437
51561
  events.emit({
@@ -51448,8 +51572,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51448
51572
  setShowDeleteConfirm(false);
51449
51573
  };
51450
51574
  const handleToggleReaction = useCallback((itemId, itemType, reactionType, currentReactionId) => {
51451
- const messagesSlice2 = context.getSlice("github-messages");
51452
- const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51575
+ const messagesData2 = messagesSlice == null ? void 0 : messagesSlice.data;
51453
51576
  if (!(messagesData2 == null ? void 0 : messagesData2.target) || !events) return;
51454
51577
  const { owner, repo, target: target2 } = messagesData2;
51455
51578
  const key = `${itemType}-${itemId}`;
@@ -51522,8 +51645,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51522
51645
  }
51523
51646
  }, [context, events]);
51524
51647
  const handleSendComment = useCallback(() => {
51525
- const messagesSlice2 = context.getSlice("github-messages");
51526
- const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51648
+ const messagesData2 = messagesSlice == null ? void 0 : messagesSlice.data;
51527
51649
  if (!events || !(messagesData2 == null ? void 0 : messagesData2.target) || !commentText.trim() || isSending) return;
51528
51650
  const { owner, repo, target: target2 } = messagesData2;
51529
51651
  setIsSending(true);
@@ -51588,9 +51710,8 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51588
51710
  return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
51589
51711
  }
51590
51712
  );
51591
- const messagesSlice = context.getSlice("github-messages");
51592
- const isLoading = context.isSliceLoading("github-messages");
51593
- const hasData = context.hasSlice("github-messages");
51713
+ const isLoading = (messagesSlice == null ? void 0 : messagesSlice.loading) ?? false;
51714
+ const hasData = !!messagesSlice;
51594
51715
  const messagesData = messagesSlice == null ? void 0 : messagesSlice.data;
51595
51716
  useEffect(() => {
51596
51717
  if (!events) return;
@@ -51643,8 +51764,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51643
51764
  }, [commentText]);
51644
51765
  useEffect(() => {
51645
51766
  if (!events) return;
51646
- const messagesSlice2 = context.getSlice("github-messages");
51647
- const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51767
+ const messagesData2 = messagesSlice == null ? void 0 : messagesSlice.data;
51648
51768
  const unsubscribers = [
51649
51769
  events.on("github-messages:comment:created", (event) => {
51650
51770
  const payload = event.payload;
@@ -52278,7 +52398,8 @@ const GitHubMessagesPanelMetadata = {
52278
52398
  description: "View conversation threads for GitHub issues and pull requests",
52279
52399
  icon: "message-square",
52280
52400
  version: "0.1.0",
52281
- slices: ["github-messages"],
52401
+ slices: ["githubMessages"],
52402
+ // Typed context slice declaration
52282
52403
  surfaces: ["panel"]
52283
52404
  };
52284
52405
  const OwnerRepositoriesPanelContent = ({
@@ -52307,8 +52428,8 @@ const OwnerRepositoriesPanelContent = ({
52307
52428
  setFilter("");
52308
52429
  }, []);
52309
52430
  const owner = propOwner || ((_b = (_a = context == null ? void 0 : context.currentScope) == null ? void 0 : _a.repository) == null ? void 0 : _b.name);
52310
- const ownerSlice = context.getSlice("owner-repositories");
52311
- const isLoading = context.isSliceLoading("owner-repositories");
52431
+ const { ownerRepositories: ownerSlice } = context;
52432
+ const isLoading = (ownerSlice == null ? void 0 : ownerSlice.loading) ?? false;
52312
52433
  ((_c = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _c.owner) ?? null;
52313
52434
  const repositories = ((_d = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _d.repositories) ?? [];
52314
52435
  const error = ((_e2 = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _e2.error) ?? null;
@@ -52929,7 +53050,8 @@ const OwnerRepositoriesPanelMetadata = {
52929
53050
  description: "Browse repositories for a GitHub user or organization",
52930
53051
  icon: "github",
52931
53052
  version: "0.2.0",
52932
- slices: ["owner-repositories"],
53053
+ slices: ["ownerRepositories"],
53054
+ // Typed context slice declaration
52933
53055
  surfaces: ["panel"]
52934
53056
  };
52935
53057
  const STORAGE_KEY = "recent-repositories";
@@ -53947,7 +54069,7 @@ const panels = [
53947
54069
  component: GitHubProjectsPanel,
53948
54070
  onMount: async (context) => {
53949
54071
  console.log("GitHub Projects Panel mounted");
53950
- const slice = context.getSlice("github-repositories");
54072
+ const slice = context.getSlice("githubRepositories");
53951
54073
  if (slice && !slice.loading) {
53952
54074
  await slice.refresh();
53953
54075
  }
@@ -53971,7 +54093,7 @@ const panels = [
53971
54093
  component: GitHubIssuesPanel,
53972
54094
  onMount: async (context) => {
53973
54095
  console.log("GitHub Issues Panel mounted");
53974
- const slice = context.getSlice("github-issues");
54096
+ const slice = context.getSlice("githubIssues");
53975
54097
  if (slice && !slice.loading) {
53976
54098
  await slice.refresh();
53977
54099
  }