shepherd-onboard 0.1.14 → 0.1.15
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/bin/shepherd-onboard.js +89 -115
- package/package.json +1 -1
package/bin/shepherd-onboard.js
CHANGED
|
@@ -1339,7 +1339,6 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1339
1339
|
<label class="chat-row" data-index="${index}" data-search="${htmlAttr(searchText)}">
|
|
1340
1340
|
<input type="checkbox" name="chatId" value="${htmlAttr(chat.chatId)}">
|
|
1341
1341
|
<span class="box" aria-hidden="true"></span>
|
|
1342
|
-
<span class="avatar" aria-hidden="true">${html(chatInitials(chat.label))}</span>
|
|
1343
1342
|
<span class="chat-name-block">
|
|
1344
1343
|
<span class="chat-name">${html(chat.label)}</span>
|
|
1345
1344
|
${people ? `<span class="chat-people">${html(people)}</span>` : ""}
|
|
@@ -1357,131 +1356,134 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1357
1356
|
<title>Select Messages Chats</title>
|
|
1358
1357
|
<style>
|
|
1359
1358
|
:root {
|
|
1360
|
-
--
|
|
1361
|
-
--
|
|
1362
|
-
--
|
|
1363
|
-
--
|
|
1364
|
-
--
|
|
1365
|
-
--
|
|
1366
|
-
--
|
|
1367
|
-
--green: #
|
|
1368
|
-
--
|
|
1369
|
-
--
|
|
1370
|
-
--neutral-soft: #F0F1EF;
|
|
1371
|
-
--button: #1F6E3C;
|
|
1372
|
-
--button-hover: #237b44;
|
|
1373
|
-
--radius: 12px;
|
|
1374
|
-
--grid: 20px 36px minmax(0, 1fr) 92px 124px;
|
|
1359
|
+
--bg: #fbfbfa;
|
|
1360
|
+
--panel: #ffffff;
|
|
1361
|
+
--fg: #141614;
|
|
1362
|
+
--muted: #767d78;
|
|
1363
|
+
--faint: #9aa09b;
|
|
1364
|
+
--line: #dedfdd;
|
|
1365
|
+
--green: #1f5c2e;
|
|
1366
|
+
--green-hover: #246836;
|
|
1367
|
+
--radius: 8px;
|
|
1368
|
+
--grid: 20px minmax(0, 1fr) 84px 112px;
|
|
1375
1369
|
}
|
|
1376
1370
|
* { box-sizing: border-box; }
|
|
1377
1371
|
body {
|
|
1378
1372
|
margin: 0;
|
|
1379
1373
|
min-height: 100vh;
|
|
1380
|
-
background:
|
|
1374
|
+
background: var(--bg);
|
|
1381
1375
|
color: var(--fg);
|
|
1382
1376
|
font-family: Geist, "Geist Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
1383
1377
|
letter-spacing: 0;
|
|
1384
1378
|
-webkit-font-smoothing: antialiased;
|
|
1385
1379
|
}
|
|
1386
1380
|
main {
|
|
1387
|
-
width: min(
|
|
1381
|
+
width: min(720px, calc(100vw - 32px));
|
|
1388
1382
|
margin: 0 auto;
|
|
1389
|
-
padding:
|
|
1383
|
+
padding: 30px 0 28px;
|
|
1390
1384
|
}
|
|
1391
|
-
.
|
|
1385
|
+
.header {
|
|
1392
1386
|
display: flex;
|
|
1393
|
-
|
|
1387
|
+
justify-content: space-between;
|
|
1394
1388
|
align-items: center;
|
|
1395
|
-
|
|
1396
|
-
|
|
1389
|
+
gap: 16px;
|
|
1390
|
+
padding: 0 0 18px;
|
|
1397
1391
|
}
|
|
1398
|
-
.
|
|
1399
|
-
|
|
1400
|
-
|
|
1392
|
+
.brand {
|
|
1393
|
+
display: flex;
|
|
1394
|
+
align-items: center;
|
|
1395
|
+
gap: 10px;
|
|
1396
|
+
min-width: 0;
|
|
1397
|
+
}
|
|
1398
|
+
.logo {
|
|
1399
|
+
width: 28px;
|
|
1400
|
+
height: 28px;
|
|
1401
1401
|
object-fit: contain;
|
|
1402
1402
|
flex: none;
|
|
1403
1403
|
}
|
|
1404
|
-
.
|
|
1405
|
-
width:
|
|
1406
|
-
height:
|
|
1407
|
-
border-radius:
|
|
1404
|
+
.logo-fallback {
|
|
1405
|
+
width: 28px;
|
|
1406
|
+
height: 28px;
|
|
1407
|
+
border-radius: 6px;
|
|
1408
1408
|
display: grid;
|
|
1409
1409
|
place-items: center;
|
|
1410
1410
|
color: #FFFFFF;
|
|
1411
|
-
|
|
1412
|
-
font-size:
|
|
1411
|
+
background: var(--green);
|
|
1412
|
+
font-size: 13px;
|
|
1413
1413
|
font-weight: 700;
|
|
1414
1414
|
flex: none;
|
|
1415
1415
|
}
|
|
1416
1416
|
h1 {
|
|
1417
1417
|
margin: 0;
|
|
1418
|
-
font-size:
|
|
1419
|
-
line-height: 1.
|
|
1418
|
+
font-size: 19px;
|
|
1419
|
+
line-height: 1.1;
|
|
1420
1420
|
font-weight: 700;
|
|
1421
|
-
letter-spacing:
|
|
1421
|
+
letter-spacing: 0;
|
|
1422
1422
|
}
|
|
1423
1423
|
.subtitle {
|
|
1424
|
-
margin:
|
|
1425
|
-
font-size:
|
|
1426
|
-
line-height: 1.
|
|
1427
|
-
color:
|
|
1424
|
+
margin: 4px 0 0;
|
|
1425
|
+
font-size: 13px;
|
|
1426
|
+
line-height: 1.4;
|
|
1427
|
+
color: var(--muted);
|
|
1428
1428
|
}
|
|
1429
1429
|
.panel {
|
|
1430
1430
|
background: var(--panel);
|
|
1431
|
-
border
|
|
1432
|
-
|
|
1433
|
-
padding: 8px 0 0;
|
|
1431
|
+
border: 1px solid var(--line);
|
|
1432
|
+
border-radius: var(--radius);
|
|
1434
1433
|
overflow: hidden;
|
|
1435
1434
|
}
|
|
1436
1435
|
.panel-head {
|
|
1437
|
-
padding:
|
|
1436
|
+
padding: 12px;
|
|
1437
|
+
border-bottom: 1px solid var(--line);
|
|
1438
1438
|
}
|
|
1439
1439
|
.search {
|
|
1440
1440
|
width: 100%;
|
|
1441
|
-
border: 1px solid #
|
|
1442
|
-
border-radius:
|
|
1443
|
-
background: #
|
|
1441
|
+
border: 1px solid #d7d9d6;
|
|
1442
|
+
border-radius: 6px;
|
|
1443
|
+
background: #ffffff;
|
|
1444
1444
|
color: var(--fg);
|
|
1445
|
-
padding:
|
|
1445
|
+
padding: 9px 10px;
|
|
1446
1446
|
font: inherit;
|
|
1447
|
-
font-size:
|
|
1447
|
+
font-size: 13px;
|
|
1448
1448
|
outline: none;
|
|
1449
1449
|
}
|
|
1450
1450
|
.search:focus {
|
|
1451
1451
|
border-color: var(--green);
|
|
1452
|
-
|
|
1453
|
-
|
|
1452
|
+
outline: 2px solid color-mix(in srgb, var(--green) 22%, transparent);
|
|
1453
|
+
outline-offset: 1px;
|
|
1454
1454
|
}
|
|
1455
1455
|
.search::placeholder { color: var(--faint); }
|
|
1456
1456
|
.error {
|
|
1457
|
-
margin: 12px
|
|
1457
|
+
margin: 10px 12px 0;
|
|
1458
1458
|
color: #9B1C1C;
|
|
1459
|
-
font-size:
|
|
1459
|
+
font-size: 13px;
|
|
1460
1460
|
}
|
|
1461
1461
|
.list-head {
|
|
1462
1462
|
display: grid;
|
|
1463
1463
|
grid-template-columns: var(--grid);
|
|
1464
|
-
gap:
|
|
1464
|
+
gap: 12px;
|
|
1465
1465
|
align-items: center;
|
|
1466
|
-
padding:
|
|
1466
|
+
padding: 9px 12px;
|
|
1467
1467
|
border-bottom: 1px solid var(--line);
|
|
1468
1468
|
color: var(--faint);
|
|
1469
|
-
font-size:
|
|
1470
|
-
font-weight:
|
|
1469
|
+
font-size: 11px;
|
|
1470
|
+
font-weight: 600;
|
|
1471
|
+
text-transform: uppercase;
|
|
1471
1472
|
}
|
|
1472
1473
|
.list-head .right { text-align: left; }
|
|
1473
1474
|
.chat-list { display: block; }
|
|
1474
1475
|
.chat-row {
|
|
1475
1476
|
display: grid;
|
|
1476
1477
|
grid-template-columns: var(--grid);
|
|
1477
|
-
gap:
|
|
1478
|
+
gap: 12px;
|
|
1478
1479
|
align-items: center;
|
|
1479
|
-
padding:
|
|
1480
|
+
padding: 11px 12px;
|
|
1480
1481
|
border-bottom: 1px solid var(--line);
|
|
1481
1482
|
cursor: pointer;
|
|
1482
1483
|
transition: background 120ms ease;
|
|
1483
1484
|
}
|
|
1484
|
-
.chat-row:
|
|
1485
|
+
.chat-row:last-child { border-bottom: 0; }
|
|
1486
|
+
.chat-row:hover { background: #f6f7f5; }
|
|
1485
1487
|
input[type="checkbox"] {
|
|
1486
1488
|
position: absolute;
|
|
1487
1489
|
opacity: 0;
|
|
@@ -1491,7 +1493,7 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1491
1493
|
width: 18px;
|
|
1492
1494
|
height: 18px;
|
|
1493
1495
|
border: 1.5px solid #C7CDC8;
|
|
1494
|
-
border-radius:
|
|
1496
|
+
border-radius: 4px;
|
|
1495
1497
|
display: inline-grid;
|
|
1496
1498
|
place-items: center;
|
|
1497
1499
|
transition: background 120ms ease, border-color 120ms ease;
|
|
@@ -1509,18 +1511,6 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1509
1511
|
border-bottom: 2px solid #FFFFFF;
|
|
1510
1512
|
transform: rotate(-45deg) translateY(-1px);
|
|
1511
1513
|
}
|
|
1512
|
-
.avatar {
|
|
1513
|
-
width: 36px;
|
|
1514
|
-
height: 36px;
|
|
1515
|
-
border-radius: 50%;
|
|
1516
|
-
background: var(--green);
|
|
1517
|
-
color: #FFFFFF;
|
|
1518
|
-
display: grid;
|
|
1519
|
-
place-items: center;
|
|
1520
|
-
font-size: 13px;
|
|
1521
|
-
font-weight: 650;
|
|
1522
|
-
letter-spacing: 0.02em;
|
|
1523
|
-
}
|
|
1524
1514
|
.chat-name-block {
|
|
1525
1515
|
min-width: 0;
|
|
1526
1516
|
display: grid;
|
|
@@ -1531,11 +1521,11 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1531
1521
|
text-overflow: ellipsis;
|
|
1532
1522
|
white-space: nowrap;
|
|
1533
1523
|
font-size: 15px;
|
|
1534
|
-
font-weight:
|
|
1524
|
+
font-weight: 550;
|
|
1535
1525
|
}
|
|
1536
1526
|
.chat-people {
|
|
1537
1527
|
color: var(--muted);
|
|
1538
|
-
font-size:
|
|
1528
|
+
font-size: 12.5px;
|
|
1539
1529
|
line-height: 1.3;
|
|
1540
1530
|
overflow: hidden;
|
|
1541
1531
|
text-overflow: ellipsis;
|
|
@@ -1543,25 +1533,22 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1543
1533
|
}
|
|
1544
1534
|
.chat-kind {
|
|
1545
1535
|
justify-self: start;
|
|
1546
|
-
|
|
1547
|
-
border-radius: 999px;
|
|
1536
|
+
color: var(--muted);
|
|
1548
1537
|
font-size: 12.5px;
|
|
1549
1538
|
font-weight: 500;
|
|
1550
1539
|
}
|
|
1551
|
-
.chat-kind--group {
|
|
1552
|
-
.chat-kind--dm,
|
|
1553
|
-
.chat-kind--other { background: var(--neutral-soft); color: var(--muted); }
|
|
1540
|
+
.chat-kind--group { color: var(--green); }
|
|
1554
1541
|
.chat-meta {
|
|
1555
1542
|
color: var(--muted);
|
|
1556
|
-
font-size:
|
|
1543
|
+
font-size: 12.5px;
|
|
1557
1544
|
overflow-wrap: anywhere;
|
|
1558
1545
|
}
|
|
1559
1546
|
[hidden] { display: none !important; }
|
|
1560
1547
|
.empty {
|
|
1561
1548
|
margin: 0;
|
|
1562
|
-
padding:
|
|
1549
|
+
padding: 26px 12px;
|
|
1563
1550
|
color: var(--muted);
|
|
1564
|
-
font-size:
|
|
1551
|
+
font-size: 13px;
|
|
1565
1552
|
text-align: center;
|
|
1566
1553
|
}
|
|
1567
1554
|
.actions {
|
|
@@ -1571,36 +1558,31 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1571
1558
|
gap: 12px;
|
|
1572
1559
|
position: sticky;
|
|
1573
1560
|
bottom: 0;
|
|
1574
|
-
margin-top:
|
|
1575
|
-
padding:
|
|
1561
|
+
margin-top: 12px;
|
|
1562
|
+
padding: 10px 0 0;
|
|
1563
|
+
background: var(--bg);
|
|
1576
1564
|
}
|
|
1577
1565
|
.selection-count {
|
|
1578
|
-
color:
|
|
1579
|
-
font-size:
|
|
1566
|
+
color: var(--muted);
|
|
1567
|
+
font-size: 13px;
|
|
1580
1568
|
font-weight: 500;
|
|
1581
1569
|
}
|
|
1582
1570
|
button {
|
|
1583
1571
|
appearance: none;
|
|
1584
1572
|
border: 0;
|
|
1585
|
-
border-radius:
|
|
1586
|
-
background: var(--
|
|
1573
|
+
border-radius: 6px;
|
|
1574
|
+
background: var(--green);
|
|
1587
1575
|
color: #FFFFFF;
|
|
1588
|
-
padding:
|
|
1576
|
+
padding: 9px 13px;
|
|
1589
1577
|
font: inherit;
|
|
1590
|
-
font-size:
|
|
1578
|
+
font-size: 13px;
|
|
1591
1579
|
font-weight: 600;
|
|
1592
1580
|
cursor: pointer;
|
|
1593
|
-
|
|
1594
|
-
align-items: center;
|
|
1595
|
-
gap: 10px;
|
|
1596
|
-
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
|
|
1597
|
-
transition: background 120ms ease, transform 120ms ease;
|
|
1581
|
+
transition: background 120ms ease;
|
|
1598
1582
|
}
|
|
1599
|
-
button:hover { background: var(--
|
|
1600
|
-
button:active { transform: scale(0.985); }
|
|
1601
|
-
button svg { width: 18px; height: 18px; }
|
|
1583
|
+
button:hover { background: var(--green-hover); }
|
|
1602
1584
|
@media (max-width: 560px) {
|
|
1603
|
-
:root { --grid: 18px
|
|
1585
|
+
:root { --grid: 18px minmax(0, 1fr) auto; }
|
|
1604
1586
|
.list-head span:last-child,
|
|
1605
1587
|
.chat-meta { display: none; }
|
|
1606
1588
|
}
|
|
@@ -1608,11 +1590,13 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1608
1590
|
</head>
|
|
1609
1591
|
<body>
|
|
1610
1592
|
<main>
|
|
1611
|
-
<header class="
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
<
|
|
1615
|
-
|
|
1593
|
+
<header class="header">
|
|
1594
|
+
<div class="brand">
|
|
1595
|
+
${logo ? `<img class="logo" src="${htmlAttr(logo)}" alt="">` : `<span class="logo-fallback" aria-hidden="true">S</span>`}
|
|
1596
|
+
<div>
|
|
1597
|
+
<h1>Select chats</h1>
|
|
1598
|
+
<p class="subtitle">Choose the local Messages chats Shepherd should sync.</p>
|
|
1599
|
+
</div>
|
|
1616
1600
|
</div>
|
|
1617
1601
|
</header>
|
|
1618
1602
|
<form method="post" action="/select">
|
|
@@ -1634,10 +1618,7 @@ function renderMessagesSelectorPage(chats, token, error = "") {
|
|
|
1634
1618
|
</div>
|
|
1635
1619
|
<div class="actions">
|
|
1636
1620
|
<span class="selection-count" id="selection-count">0 selected</span>
|
|
1637
|
-
<button type="submit">
|
|
1638
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 12H5"/><path d="m12 19-7-7 7-7"/></svg>
|
|
1639
|
-
Return
|
|
1640
|
-
</button>
|
|
1621
|
+
<button type="submit">Return</button>
|
|
1641
1622
|
</div>
|
|
1642
1623
|
</form>
|
|
1643
1624
|
</main>
|
|
@@ -1709,13 +1690,6 @@ function renderChatPeople(chat) {
|
|
|
1709
1690
|
return `<span class="chat-people">${html(people)}</span>`;
|
|
1710
1691
|
}
|
|
1711
1692
|
|
|
1712
|
-
function chatInitials(label) {
|
|
1713
|
-
const words = String(label ?? "").trim().split(/\s+/).filter(Boolean);
|
|
1714
|
-
if (words.length === 0) return "?";
|
|
1715
|
-
if (words.length === 1) return words[0].slice(0, 2).toUpperCase();
|
|
1716
|
-
return (words[0][0] + words[words.length - 1][0]).toUpperCase();
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
1693
|
function chatPeopleLine(chat) {
|
|
1720
1694
|
if (chat.kind !== "group") return "";
|
|
1721
1695
|
const names = chat.participants?.map((participant) => participant.name ?? participant.handle).filter(Boolean) ?? [];
|