@the-portland-company/shell 0.49.0 → 0.51.0
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/app-chrome.cjs +91 -44
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +1 -1
- package/dist/{chunk-DYD2J5CC.js → chunk-II5K6QT6.js} +93 -46
- package/dist/chunk-II5K6QT6.js.map +1 -0
- package/dist/native.cjs +91 -44
- package/dist/native.cjs.map +1 -1
- package/dist/native.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DYD2J5CC.js.map +0 -1
package/dist/app-chrome.cjs
CHANGED
|
@@ -54,6 +54,20 @@ function resolveBrandGlyph(name) {
|
|
|
54
54
|
return GLYPHS[name.trim().toLowerCase()] ?? null;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// src/native/orgFilter.ts
|
|
58
|
+
var ORG_FILTER_THRESHOLD = 8;
|
|
59
|
+
function filterOrgs(orgs, query) {
|
|
60
|
+
const q = normalize(query);
|
|
61
|
+
if (!q) return [...orgs];
|
|
62
|
+
return orgs.filter((o) => normalize(o.name ?? "").includes(q) || o.id.toLowerCase().startsWith(q));
|
|
63
|
+
}
|
|
64
|
+
function shouldShowOrgFilter(count) {
|
|
65
|
+
return count > ORG_FILTER_THRESHOLD;
|
|
66
|
+
}
|
|
67
|
+
function normalize(s) {
|
|
68
|
+
return s.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().trim();
|
|
69
|
+
}
|
|
70
|
+
|
|
57
71
|
// src/theme-preference.ts
|
|
58
72
|
var THEME_STORAGE_KEY = "politogy_theme";
|
|
59
73
|
var THEME_COOKIE = "politogy_theme";
|
|
@@ -1464,14 +1478,17 @@ var APP_CONTACTS_CHILDREN = [
|
|
|
1464
1478
|
{ label: "Activity", icon: "activity", href: `${CONTACTS_APP}/activity` },
|
|
1465
1479
|
{ label: "Duplicates", icon: "fileText", href: `${CONTACTS_APP}/duplicates` }
|
|
1466
1480
|
];
|
|
1467
|
-
var
|
|
1468
|
-
|
|
1469
|
-
{ label: "
|
|
1470
|
-
{ label: "
|
|
1471
|
-
{ label: "
|
|
1472
|
-
{ label: "
|
|
1473
|
-
{ label: "
|
|
1481
|
+
var EMAIL_APP = "https://email.politogyvrm.com";
|
|
1482
|
+
var APP_EMAIL_CHILDREN = [
|
|
1483
|
+
{ label: "Dashboard", icon: "grid", href: `${EMAIL_APP}/dashboard` },
|
|
1484
|
+
{ label: "Creative Canvas", icon: "edit", href: `${EMAIL_APP}/canvas` },
|
|
1485
|
+
{ label: "Sender Information", icon: "mail", href: `${EMAIL_APP}/sender` },
|
|
1486
|
+
{ label: "Recipients", icon: "user", href: `${EMAIL_APP}/recipients` },
|
|
1487
|
+
{ label: "Send & Automate", icon: "send", href: `${EMAIL_APP}/send` },
|
|
1488
|
+
{ label: "Statistics", icon: "barChart", href: `${EMAIL_APP}/statistics` },
|
|
1489
|
+
{ label: "Deliverability", icon: "activity", href: `${EMAIL_APP}/deliverability` }
|
|
1474
1490
|
];
|
|
1491
|
+
var EMAIL_V1_LEGACY = { label: "Email V1 (legacy)", icon: "clock", path: "/relationship/email/dashboard" };
|
|
1475
1492
|
var SMS_CHILDREN = [
|
|
1476
1493
|
{ label: "Dashboard", icon: "grid", path: "/relationship/sms-mms-blast/dashboard" },
|
|
1477
1494
|
{ label: "Compose & Send", icon: "send", path: "/relationship/sms-mms-blast/compose-and-send" },
|
|
@@ -1575,8 +1592,11 @@ function standardPolitogyNav(opts) {
|
|
|
1575
1592
|
{
|
|
1576
1593
|
label: "Email Broadcast",
|
|
1577
1594
|
icon: icon("mail"),
|
|
1578
|
-
href: withOrg(
|
|
1579
|
-
children:
|
|
1595
|
+
href: withOrg(`${EMAIL_APP}/dashboard`),
|
|
1596
|
+
children: [
|
|
1597
|
+
...APP_EMAIL_CHILDREN.map((c) => ({ label: c.label, icon: icon(c.icon), href: withOrg(c.href) })),
|
|
1598
|
+
...leaves([EMAIL_V1_LEGACY])
|
|
1599
|
+
]
|
|
1580
1600
|
},
|
|
1581
1601
|
{
|
|
1582
1602
|
label: "SMS/MMS Blast",
|
|
@@ -1762,6 +1782,7 @@ function NavSidebar({
|
|
|
1762
1782
|
return null;
|
|
1763
1783
|
}, [nav.items, pathname, activeFn]);
|
|
1764
1784
|
const [openGroup, setOpenGroup] = react.useState(activeGroupKey);
|
|
1785
|
+
const [orgFilter, setOrgFilter] = react.useState("");
|
|
1765
1786
|
react.useEffect(() => {
|
|
1766
1787
|
setOpenGroup(activeGroupKey);
|
|
1767
1788
|
}, [activeGroupKey]);
|
|
@@ -1833,43 +1854,69 @@ function NavSidebar({
|
|
|
1833
1854
|
] }),
|
|
1834
1855
|
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
1835
1856
|
] }),
|
|
1836
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
"button",
|
|
1857
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute left-0 right-0 z-40 mt-1 max-h-[min(60vh,520px)] overflow-y-auto rounded-xl border border-[color:var(--line)] bg-[color:var(--panel-elevated)] py-1 shadow-[var(--shadow-soft)]", children: [
|
|
1858
|
+
shouldShowOrgFilter(org.organizations.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 bg-[color:var(--panel-elevated)] px-2 pb-1 pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1859
|
+
"input",
|
|
1840
1860
|
{
|
|
1841
|
-
type: "
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1861
|
+
type: "search",
|
|
1862
|
+
value: orgFilter,
|
|
1863
|
+
onChange: (e) => setOrgFilter(e.target.value),
|
|
1864
|
+
onKeyDown: (e) => {
|
|
1865
|
+
if (e.key === "Escape") {
|
|
1866
|
+
setOrgFilter("");
|
|
1867
|
+
e.currentTarget.closest("details")?.removeAttribute("open");
|
|
1868
|
+
}
|
|
1845
1869
|
},
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1870
|
+
placeholder: `Filter ${org.organizations.length} organizations`,
|
|
1871
|
+
"aria-label": "Filter organizations",
|
|
1872
|
+
autoComplete: "off",
|
|
1873
|
+
className: "w-full rounded-lg border border-[color:var(--line)] bg-[color:var(--panel)] px-3 py-1.5 text-sm text-[color:var(--foreground)] placeholder:text-[color:var(--muted)] focus:outline-none focus:ring-2 focus:ring-[color:var(--color-accent)]"
|
|
1874
|
+
}
|
|
1875
|
+
) }) : null,
|
|
1876
|
+
filterOrgs(org.organizations, orgFilter).length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "px-3 py-2 text-sm text-[color:var(--muted)]", children: [
|
|
1877
|
+
"No organization matches \u201C",
|
|
1878
|
+
orgFilter,
|
|
1879
|
+
"\u201D."
|
|
1880
|
+
] }) : null,
|
|
1881
|
+
filterOrgs(org.organizations, orgFilter).map((o) => {
|
|
1882
|
+
const selected = o.id === org.id;
|
|
1883
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1884
|
+
"button",
|
|
1885
|
+
{
|
|
1886
|
+
type: "button",
|
|
1887
|
+
onClick: (e) => {
|
|
1888
|
+
e.currentTarget.closest("details")?.removeAttribute("open");
|
|
1889
|
+
setOrgFilter("");
|
|
1890
|
+
if (!selected) org.onSwitch?.(o.id);
|
|
1891
|
+
},
|
|
1892
|
+
"aria-current": selected ? "true" : void 0,
|
|
1893
|
+
className: [
|
|
1894
|
+
"flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm",
|
|
1895
|
+
selected ? "font-semibold text-[color:var(--color-accent)]" : "font-medium text-[color:var(--foreground)] hover:bg-[color:var(--panel)]"
|
|
1896
|
+
].join(" "),
|
|
1897
|
+
children: [
|
|
1898
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1899
|
+
"span",
|
|
1900
|
+
{
|
|
1901
|
+
style: { backgroundColor: o.brandColor || ORG_PILL_DEFAULT },
|
|
1902
|
+
className: "flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full text-[10px] font-bold text-white",
|
|
1903
|
+
children: resolveOrgLogoUrl(o.logoUrl) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1904
|
+
"img",
|
|
1905
|
+
{
|
|
1906
|
+
src: resolveOrgLogoUrl(o.logoUrl),
|
|
1907
|
+
alt: "",
|
|
1908
|
+
className: "h-full w-full object-cover"
|
|
1909
|
+
}
|
|
1910
|
+
) : (o.name ?? "Org").slice(0, 2).toUpperCase()
|
|
1911
|
+
}
|
|
1912
|
+
),
|
|
1913
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { title: o.name ?? o.id, className: "truncate", children: o.name ?? o.id.slice(0, 8) })
|
|
1914
|
+
]
|
|
1915
|
+
},
|
|
1916
|
+
o.id
|
|
1917
|
+
);
|
|
1918
|
+
})
|
|
1919
|
+
] })
|
|
1873
1920
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1874
1921
|
"button",
|
|
1875
1922
|
{
|