@planningcenter/topbar 11.2.4 → 11.2.5-rc.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/topbar.js +29 -22
- package/dist/topbar.js.map +1 -1
- package/dist/topbar.modern.js +29 -22
- package/dist/topbar.modern.js.map +1 -1
- package/dist/topbar.module.js +29 -22
- package/dist/topbar.module.js.map +1 -1
- package/dist/topbar.umd.js +29 -22
- package/dist/topbar.umd.js.map +1 -1
- package/package.json +3 -2
package/dist/topbar.module.js
CHANGED
|
@@ -3442,12 +3442,16 @@ var styles = {"toolbar":"toolbar-KHJR5","toolbar-button":"toolbar-button-Ye4h5",
|
|
|
3442
3442
|
|
|
3443
3443
|
const pcoUrl = pcoUrl$1;
|
|
3444
3444
|
|
|
3445
|
+
// The route rides in the iframe URL fragment (`…/topbar#conversations/abc`),
|
|
3446
|
+
// not the path, so updating it is a same-document navigation that doesn't
|
|
3447
|
+
// reload the iframe, but also lets the route survive a forced reload (e.g.
|
|
3448
|
+
// Turbo re-parenting the topbar).
|
|
3445
3449
|
function buildPicobotSrc(origin, path) {
|
|
3446
3450
|
const [rawPath, queryPart] = path.replace(/^\/+/, "").split("?", 2);
|
|
3447
3451
|
const safePath = rawPath.split("/").filter(segment => segment && segment !== "." && segment !== "..").join("/");
|
|
3448
|
-
const
|
|
3449
|
-
const
|
|
3450
|
-
return
|
|
3452
|
+
const fragment = queryPart !== undefined ? `${safePath}?${queryPart}` : safePath;
|
|
3453
|
+
const base = new URL("topbar", origin).toString();
|
|
3454
|
+
return fragment ? `${base}#${fragment}` : base;
|
|
3451
3455
|
}
|
|
3452
3456
|
|
|
3453
3457
|
const handleSearchSelect = (hit, indexName) => {
|
|
@@ -3615,13 +3619,10 @@ function HelpdeskComponent({
|
|
|
3615
3619
|
onMessage
|
|
3616
3620
|
}) {
|
|
3617
3621
|
const ref = React__default.useRef(null);
|
|
3618
|
-
|
|
3619
|
-
//
|
|
3620
|
-
//
|
|
3621
|
-
|
|
3622
|
-
// no leading slash or /topbar prefix—buildPicobotSrc adds those.
|
|
3623
|
-
const lastReportedPathRef = React__default.useRef(initialPath);
|
|
3624
|
-
const [loadedPath, setLoadedPath] = React__default.useState(initialPath);
|
|
3622
|
+
// Keep the fragment in sync in both directions—external opens (deeplink /
|
|
3623
|
+
// Contact support) and picobot's own NEW_ROUTE_RENDERED reports—so it
|
|
3624
|
+
// always reflects the live conversation. See buildPicobotSrc.
|
|
3625
|
+
const [loadedPath, setLoadedPath] = React__default.useState(iframePath || "");
|
|
3625
3626
|
React__default.useEffect(() => {
|
|
3626
3627
|
if (!onIframeChangePath && !onMessage) return undefined;
|
|
3627
3628
|
const handler = e => {
|
|
@@ -3631,7 +3632,7 @@ function HelpdeskComponent({
|
|
|
3631
3632
|
if (e.source !== ref.current.contentWindow) return;
|
|
3632
3633
|
if (((_a = e.data) === null || _a === void 0 ? void 0 : _a.type) === "NEW_ROUTE_RENDERED" && onIframeChangePath) {
|
|
3633
3634
|
const reportedPath = String((_b = e.data.payload) !== null && _b !== void 0 ? _b : "");
|
|
3634
|
-
|
|
3635
|
+
setLoadedPath(reportedPath);
|
|
3635
3636
|
onIframeChangePath(reportedPath);
|
|
3636
3637
|
}
|
|
3637
3638
|
if (onMessage) onMessage(e.data);
|
|
@@ -3640,9 +3641,7 @@ function HelpdeskComponent({
|
|
|
3640
3641
|
return () => window.removeEventListener("message", handler);
|
|
3641
3642
|
}, [onIframeChangePath, onMessage]);
|
|
3642
3643
|
React__default.useEffect(() => {
|
|
3643
|
-
|
|
3644
|
-
if (lastReportedPathRef.current === incomingPath) return;
|
|
3645
|
-
setLoadedPath(incomingPath);
|
|
3644
|
+
setLoadedPath(iframePath || "");
|
|
3646
3645
|
}, [iframePath]);
|
|
3647
3646
|
const iframeSrc = buildPicobotSrc(picobotOrigin, loadedPath);
|
|
3648
3647
|
return /*#__PURE__*/React__default.createElement("iframe", {
|
|
@@ -3697,7 +3696,8 @@ const Helpdesk = {
|
|
|
3697
3696
|
staticDotPath: "",
|
|
3698
3697
|
staticPath: "M16 10C14.9391 10 13.9217 10.4214 13.1716 11.1716C12.4214 11.9217 12 12.9391 12 14H14C14 13.4696 14.2107 12.9609 14.5858 12.5858C14.9609 12.2107 15.4696 12 16 12C16.5304 12 17.0391 12.2107 17.4142 12.5858C17.7893 12.9609 18 13.4696 18 14C18 16 15 15.75 15 19H17C17 16.75 20 16.5 20 14C20 12.9391 19.5786 11.9217 18.8284 11.1716C18.0783 10.4214 17.0609 10 16 10ZM16 24C14.4178 24 12.871 23.5308 11.5554 22.6518C10.2399 21.7727 9.21447 20.5233 8.60897 19.0615C8.00347 17.5997 7.84504 15.9911 8.15372 14.4393C8.4624 12.8874 9.22433 11.462 10.3432 10.3431C11.462 9.22433 12.8874 8.4624 14.4393 8.15372C15.9911 7.84504 17.5997 8.00346 19.0615 8.60896C20.5233 9.21446 21.7727 10.2398 22.6518 11.5554C23.5308 12.871 24 14.4177 24 16C23.9974 18.1209 23.1537 20.1542 21.6539 21.6539C20.1542 23.1537 18.1209 23.9974 16 24ZM16 6C14.0222 6 12.0888 6.58649 10.4443 7.6853C8.79981 8.78412 7.51809 10.3459 6.76121 12.1732C6.00433 14.0004 5.8063 16.0111 6.19215 17.9509C6.578 19.8907 7.53041 21.6725 8.92894 23.0711C10.3275 24.4696 12.1093 25.422 14.0491 25.8079C15.9889 26.1937 17.9996 25.9957 19.8268 25.2388C21.6541 24.4819 23.2159 23.2002 24.3147 21.5557C25.4135 19.9112 26 17.9778 26 16C26 13.3478 24.9464 10.8043 23.0711 8.92893C21.1957 7.05357 18.6522 6 16 6V6ZM15 22H17V20H15V22Z"
|
|
3699
3698
|
},
|
|
3700
|
-
name: "Helpdesk"
|
|
3699
|
+
name: "Helpdesk",
|
|
3700
|
+
storageExemptPaths: ["email", "phone"]
|
|
3701
3701
|
};
|
|
3702
3702
|
|
|
3703
3703
|
const Eyebrow = ({
|
|
@@ -4628,6 +4628,13 @@ function isToolPathExemptFromStorage(toolName, path) {
|
|
|
4628
4628
|
const tool = toolsRouteMap[toolName];
|
|
4629
4629
|
return (_b = (_a = tool === null || tool === void 0 ? void 0 : tool.storageExemptPaths) === null || _a === void 0 ? void 0 : _a.includes(path)) !== null && _b !== void 0 ? _b : false;
|
|
4630
4630
|
}
|
|
4631
|
+
function scrollToolDrawerToTop(toolName) {
|
|
4632
|
+
var _a;
|
|
4633
|
+
(_a = document.getElementById(`toolbarDrawer${toolName}`)) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
4634
|
+
behavior: "smooth",
|
|
4635
|
+
top: 0
|
|
4636
|
+
});
|
|
4637
|
+
}
|
|
4631
4638
|
const TOOLS_MAP = {
|
|
4632
4639
|
Chat,
|
|
4633
4640
|
Helpdesk,
|
|
@@ -4697,17 +4704,21 @@ function Toolbar({
|
|
|
4697
4704
|
unsubscribe();
|
|
4698
4705
|
};
|
|
4699
4706
|
}, [open, clearRoute]);
|
|
4707
|
+
const openHelpdeskAtRoot = useCallback(() => {
|
|
4708
|
+
onChangeToolbarFragmentRoute(Helpdesk.name.toLowerCase(), "");
|
|
4709
|
+
scrollToolDrawerToTop(Helpdesk.name);
|
|
4710
|
+
}, [onChangeToolbarFragmentRoute]);
|
|
4700
4711
|
React__default.useEffect(() => {
|
|
4701
4712
|
window.topbar = window.topbar || {};
|
|
4702
4713
|
window.topbar.openProfile = () => handleToolOnClick(Profile);
|
|
4703
|
-
window.topbar.openHelpdesk =
|
|
4714
|
+
window.topbar.openHelpdesk = openHelpdeskAtRoot;
|
|
4704
4715
|
window.openHelpdesk = window.topbar.openHelpdesk; /* TODO: Remove when products have migrated to window.topbar.openHelpdesk */
|
|
4705
4716
|
return () => {
|
|
4706
4717
|
delete window.topbar.openProfile;
|
|
4707
4718
|
delete window.topbar.openHelpdesk;
|
|
4708
4719
|
delete window.openHelpdesk; /* TODO: Remove when products have migrated to window.topbar.openHelpdesk */
|
|
4709
4720
|
};
|
|
4710
|
-
}, [
|
|
4721
|
+
}, [Profile, openHelpdeskAtRoot]);
|
|
4711
4722
|
const loginSettingsUrl = getLoginProfilePath({
|
|
4712
4723
|
appName: appName.replace(/[\s-]/, ""),
|
|
4713
4724
|
env: env,
|
|
@@ -4789,12 +4800,8 @@ function Toolbar({
|
|
|
4789
4800
|
});
|
|
4790
4801
|
const TOOLS = [Notifications, Tasks, displayChatIcon && Chat].filter(Boolean);
|
|
4791
4802
|
const handleToolOnClick = tool => {
|
|
4792
|
-
var _a;
|
|
4793
4803
|
toggleDrawer(tool);
|
|
4794
|
-
(
|
|
4795
|
-
behavior: "smooth",
|
|
4796
|
-
top: 0
|
|
4797
|
-
});
|
|
4804
|
+
scrollToolDrawerToTop(tool.name);
|
|
4798
4805
|
};
|
|
4799
4806
|
const toolSpecificProps = {
|
|
4800
4807
|
Profile: {
|