@industry-theme/alexandria-panels 0.3.2 → 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"LocalProjectCard.d.ts","sourceRoot":"","sources":["../../../src/panels/LocalProjectsPanel/LocalProjectCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,0BAA0B,CAAC;AA+BlC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAuR5D,CAAC"}
1
+ {"version":3,"file":"LocalProjectCard.d.ts","sourceRoot":"","sources":["../../../src/panels/LocalProjectsPanel/LocalProjectCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,0BAA0B,CAAC;AAuDlC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAwS5D,CAAC"}
@@ -8237,6 +8237,25 @@ const LANGUAGE_COLORS = {
8237
8237
  const getLanguageColor$1 = (language) => {
8238
8238
  return LANGUAGE_COLORS[language] || "#6e7681";
8239
8239
  };
8240
+ const formatRelativeTime = (dateString) => {
8241
+ const date = new Date(dateString);
8242
+ const now2 = /* @__PURE__ */ new Date();
8243
+ const diffMs = now2.getTime() - date.getTime();
8244
+ const diffSecs = Math.floor(diffMs / 1e3);
8245
+ const diffMins = Math.floor(diffSecs / 60);
8246
+ const diffHours = Math.floor(diffMins / 60);
8247
+ const diffDays = Math.floor(diffHours / 24);
8248
+ const diffWeeks = Math.floor(diffDays / 7);
8249
+ const diffMonths = Math.floor(diffDays / 30);
8250
+ const diffYears = Math.floor(diffDays / 365);
8251
+ if (diffYears > 0) return `${diffYears}y ago`;
8252
+ if (diffMonths > 0) return `${diffMonths}mo ago`;
8253
+ if (diffWeeks > 0) return `${diffWeeks}w ago`;
8254
+ if (diffDays > 0) return `${diffDays}d ago`;
8255
+ if (diffHours > 0) return `${diffHours}h ago`;
8256
+ if (diffMins > 0) return `${diffMins}m ago`;
8257
+ return "just now";
8258
+ };
8240
8259
  const LocalProjectCard = ({
8241
8260
  entry,
8242
8261
  actionMode = "default",
@@ -8249,7 +8268,7 @@ const LocalProjectCard = ({
8249
8268
  isInSelectedCollection = false,
8250
8269
  selectedCollectionName
8251
8270
  }) => {
8252
- var _a, _b, _c, _d;
8271
+ var _a, _b, _c, _d, _e, _f;
8253
8272
  const { theme } = useTheme();
8254
8273
  const [isHovered, setIsHovered] = useState(false);
8255
8274
  const [copiedPath, setCopiedPath] = useState(false);
@@ -8280,6 +8299,7 @@ const LocalProjectCard = ({
8280
8299
  return path;
8281
8300
  };
8282
8301
  const displayPath = getDisplayPath(entry.path);
8302
+ const displaySubtitle = ((_b = entry.github) == null ? void 0 : _b.owner) || displayPath;
8283
8303
  const handleCardClick = () => {
8284
8304
  onSelect == null ? void 0 : onSelect(entry);
8285
8305
  };
@@ -8333,7 +8353,7 @@ const LocalProjectCard = ({
8333
8353
  fontSize: `${theme.fontSizes[2]}px`,
8334
8354
  fontWeight: theme.fontWeights.semibold
8335
8355
  },
8336
- children: ((_b = entry.name[0]) == null ? void 0 : _b.toUpperCase()) || "?"
8356
+ children: ((_c = entry.name[0]) == null ? void 0 : _c.toUpperCase()) || "?"
8337
8357
  }
8338
8358
  )
8339
8359
  }
@@ -8361,7 +8381,7 @@ const LocalProjectCard = ({
8361
8381
  /* @__PURE__ */ jsx(
8362
8382
  "span",
8363
8383
  {
8364
- className: ((_c = entry.github) == null ? void 0 : _c.primaryLanguage) ? "project-name-underline" : void 0,
8384
+ className: ((_d = entry.github) == null ? void 0 : _d.primaryLanguage) ? "project-name-underline" : void 0,
8365
8385
  style: {
8366
8386
  fontSize: `${theme.fontSizes[2]}px`,
8367
8387
  fontWeight: theme.fontWeights.semibold,
@@ -8369,7 +8389,7 @@ const LocalProjectCard = ({
8369
8389
  overflow: "hidden",
8370
8390
  textOverflow: "ellipsis",
8371
8391
  whiteSpace: "nowrap",
8372
- "--underline-color": ((_d = entry.github) == null ? void 0 : _d.primaryLanguage) ? getLanguageColor$1(entry.github.primaryLanguage) : theme.colors.textSecondary
8392
+ "--underline-color": ((_e = entry.github) == null ? void 0 : _e.primaryLanguage) ? getLanguageColor$1(entry.github.primaryLanguage) : theme.colors.textSecondary
8373
8393
  },
8374
8394
  children: entry.name
8375
8395
  }
@@ -8438,7 +8458,7 @@ const LocalProjectCard = ({
8438
8458
  gap: "6px",
8439
8459
  cursor: disableCopyPaths ? "default" : "pointer"
8440
8460
  },
8441
- title: disableCopyPaths ? displayPath : copiedPath ? "Copied!" : `Click to copy: ${entry.path}`,
8461
+ title: disableCopyPaths ? entry.path : copiedPath ? "Copied!" : `Click to copy: ${entry.path}`,
8442
8462
  children: [
8443
8463
  /* @__PURE__ */ jsx(
8444
8464
  "span",
@@ -8454,7 +8474,20 @@ const LocalProjectCard = ({
8454
8474
  minWidth: 0,
8455
8475
  transition: "color 0.15s ease"
8456
8476
  },
8457
- children: copiedPath ? "✓ Copied!" : displayPath
8477
+ children: copiedPath ? "✓ Copied!" : displaySubtitle
8478
+ }
8479
+ ),
8480
+ ((_f = entry.github) == null ? void 0 : _f.lastCommit) && /* @__PURE__ */ jsx(
8481
+ "span",
8482
+ {
8483
+ style: {
8484
+ fontSize: `${theme.fontSizes[0]}px`,
8485
+ color: theme.colors.textSecondary,
8486
+ whiteSpace: "nowrap",
8487
+ flexShrink: 0
8488
+ },
8489
+ title: `Last commit: ${new Date(entry.github.lastCommit).toLocaleDateString()}`,
8490
+ children: formatRelativeTime(entry.github.lastCommit)
8458
8491
  }
8459
8492
  ),
8460
8493
  !disableCopyPaths && !copiedPath && /* @__PURE__ */ jsx(