@industry-theme/github-panels 0.1.65 → 0.1.67

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 +1 @@
1
- {"version":3,"file":"RecentRepositoriesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/RecentRepositoriesPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAgBhE,OAAO,KAAK,EACV,gBAAgB,EAEhB,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AAkGzB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CA8BhE;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CA0BrD;AA2pBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,GAAG;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAEA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;CAQ3C,CAAC"}
1
+ {"version":3,"file":"RecentRepositoriesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/RecentRepositoriesPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAgBhE,OAAO,KAAK,EACV,gBAAgB,EAEhB,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AAsGzB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAsChE;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAkCrD;AA4pBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,GAAG;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAEA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;CAQ3C,CAAC"}
@@ -53058,6 +53058,7 @@ const STORAGE_KEY = "recent-repositories";
53058
53058
  const OWNERS_STORAGE_KEY = "recent-owners";
53059
53059
  const MAX_RECENT_ITEMS = 50;
53060
53060
  function loadRecentRepositories() {
53061
+ if (typeof window === "undefined") return [];
53061
53062
  try {
53062
53063
  const stored = localStorage.getItem(STORAGE_KEY);
53063
53064
  if (stored) {
@@ -53070,6 +53071,7 @@ function loadRecentRepositories() {
53070
53071
  return [];
53071
53072
  }
53072
53073
  function loadRecentOwners() {
53074
+ if (typeof window === "undefined") return [];
53073
53075
  try {
53074
53076
  const stored = localStorage.getItem(OWNERS_STORAGE_KEY);
53075
53077
  if (stored) {
@@ -53081,6 +53083,7 @@ function loadRecentOwners() {
53081
53083
  return [];
53082
53084
  }
53083
53085
  function saveRecentRepositories(repos) {
53086
+ if (typeof window === "undefined") return;
53084
53087
  try {
53085
53088
  localStorage.setItem(STORAGE_KEY, JSON.stringify(repos));
53086
53089
  } catch (err) {
@@ -53088,6 +53091,7 @@ function saveRecentRepositories(repos) {
53088
53091
  }
53089
53092
  }
53090
53093
  function saveRecentOwners(owners) {
53094
+ if (typeof window === "undefined") return;
53091
53095
  try {
53092
53096
  localStorage.setItem(OWNERS_STORAGE_KEY, JSON.stringify(owners));
53093
53097
  } catch (err) {
@@ -53095,6 +53099,10 @@ function saveRecentOwners(owners) {
53095
53099
  }
53096
53100
  }
53097
53101
  function addRecentRepository(repo) {
53102
+ if (repo.id == null) {
53103
+ console.warn("addRecentRepository: skipping repository without valid id", repo.full_name);
53104
+ return;
53105
+ }
53098
53106
  const recent = loadRecentRepositories();
53099
53107
  const filtered = recent.filter((r2) => r2.id !== repo.id);
53100
53108
  const newEntry = {
@@ -53115,9 +53123,15 @@ function addRecentRepository(repo) {
53115
53123
  };
53116
53124
  const updated = [newEntry, ...filtered].slice(0, MAX_RECENT_ITEMS);
53117
53125
  saveRecentRepositories(updated);
53118
- window.dispatchEvent(new CustomEvent("recent-items-updated"));
53126
+ if (typeof window !== "undefined") {
53127
+ window.dispatchEvent(new CustomEvent("recent-items-updated"));
53128
+ }
53119
53129
  }
53120
53130
  function addRecentOwner(owner) {
53131
+ if (owner.id == null) {
53132
+ console.warn("addRecentOwner: skipping owner without valid id", owner.login);
53133
+ return;
53134
+ }
53121
53135
  const recent = loadRecentOwners();
53122
53136
  const filtered = recent.filter((o) => o.id !== owner.id);
53123
53137
  const newEntry = {
@@ -53134,7 +53148,9 @@ function addRecentOwner(owner) {
53134
53148
  };
53135
53149
  const updated = [newEntry, ...filtered].slice(0, MAX_RECENT_ITEMS);
53136
53150
  saveRecentOwners(updated);
53137
- window.dispatchEvent(new CustomEvent("recent-items-updated"));
53151
+ if (typeof window !== "undefined") {
53152
+ window.dispatchEvent(new CustomEvent("recent-items-updated"));
53153
+ }
53138
53154
  }
53139
53155
  const RecentRepositoriesPanelContent = ({
53140
53156
  events,
@@ -53150,8 +53166,8 @@ const RecentRepositoriesPanelContent = ({
53150
53166
  };
53151
53167
  useEffect(() => {
53152
53168
  const loadItems = () => {
53153
- const repos = loadRecentRepositories();
53154
- const owners = loadRecentOwners();
53169
+ const repos = loadRecentRepositories().filter((r2) => r2.id != null);
53170
+ const owners = loadRecentOwners().filter((o) => o.id != null);
53155
53171
  const merged = [...repos, ...owners].sort(
53156
53172
  (a, b) => b.visitedAt - a.visitedAt
53157
53173
  );