@planningcenter/topbar 10.20.0 → 10.20.1
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.css +22 -22
- package/dist/topbar.css.map +1 -1
- package/dist/topbar.js +365 -341
- package/dist/topbar.js.map +1 -1
- package/dist/topbar.modern.js +365 -341
- package/dist/topbar.modern.js.map +1 -1
- package/dist/topbar.module.js +365 -341
- package/dist/topbar.module.js.map +1 -1
- package/dist/topbar.umd.js +365 -341
- package/dist/topbar.umd.js.map +1 -1
- package/dist/types/index.d.ts +4 -4
- package/package.json +6 -5
package/dist/topbar.module.js
CHANGED
|
@@ -22,9 +22,10 @@ const AccessibilityToolbar = ({
|
|
|
22
22
|
children
|
|
23
23
|
}) => {
|
|
24
24
|
const handleClick = event => {
|
|
25
|
+
var _a;
|
|
25
26
|
event.preventDefault();
|
|
26
27
|
event.stopPropagation();
|
|
27
|
-
document.getElementById("main-content")
|
|
28
|
+
(_a = document.getElementById("main-content")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
28
29
|
};
|
|
29
30
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
30
31
|
className: styles$c["accessibility-toolbar"]
|
|
@@ -36,16 +37,6 @@ const AccessibilityToolbar = ({
|
|
|
36
37
|
}), children);
|
|
37
38
|
};
|
|
38
39
|
|
|
39
|
-
function _extends() {
|
|
40
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
41
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
42
|
-
var t = arguments[e];
|
|
43
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
44
|
-
}
|
|
45
|
-
return n;
|
|
46
|
-
}, _extends.apply(null, arguments);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
40
|
function getDefaultExportFromCjs (x) {
|
|
50
41
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
51
42
|
}
|
|
@@ -159,7 +150,8 @@ const railsCsrfFetch = (url, {
|
|
|
159
150
|
});
|
|
160
151
|
};
|
|
161
152
|
function inferRailsCsrfToken() {
|
|
162
|
-
|
|
153
|
+
var _a, _b;
|
|
154
|
+
return ((_a = window === null || window === void 0 ? void 0 : window.Rails) === null || _a === void 0 ? void 0 : _a.csrfToken()) || ((_b = document.querySelector('meta[name="csrf-token"]')) === null || _b === void 0 ? void 0 : _b.getAttribute("content")) || null;
|
|
163
155
|
}
|
|
164
156
|
function apiRequest(fetch, url, {
|
|
165
157
|
method = "GET",
|
|
@@ -205,17 +197,17 @@ const Bell = ({
|
|
|
205
197
|
d: "M21.482,16.626,19.1,13.649V9a7,7,0,0,0-14,0v4.649L2.478,16.929A1.89,1.89,0,0,0,3.952,20H9.285a2.983,2.983,0,0,0,5.633,0H19.86a2.077,2.077,0,0,0,1.622-3.374ZM19.86,18H4.182l2.7-3.375A1,1,0,0,0,7.1,14V9a5,5,0,0,1,10,0v5a1,1,0,0,0,.219.625l2.6,3.25Z",
|
|
206
198
|
fill: "white"
|
|
207
199
|
});
|
|
208
|
-
return /*#__PURE__*/React__default.createElement("svg",
|
|
200
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
209
201
|
width: "24",
|
|
210
202
|
height: "24",
|
|
211
203
|
viewBox: "0 0 24 24",
|
|
212
204
|
style: {
|
|
213
205
|
display: "block",
|
|
214
206
|
...style
|
|
215
|
-
}
|
|
216
|
-
|
|
207
|
+
},
|
|
208
|
+
...props,
|
|
217
209
|
stroke: "none"
|
|
218
|
-
}
|
|
210
|
+
}, /*#__PURE__*/React__default.createElement("title", null, "bell"), /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("mask", {
|
|
219
211
|
id: "mask-no-dot"
|
|
220
212
|
}, bellPath), /*#__PURE__*/React__default.createElement("mask", {
|
|
221
213
|
id: "mask-dot"
|
|
@@ -242,14 +234,15 @@ const BlankStateIcon = ({
|
|
|
242
234
|
id = "default",
|
|
243
235
|
style,
|
|
244
236
|
...nativeProps
|
|
245
|
-
}) => /*#__PURE__*/React__default.createElement("svg",
|
|
237
|
+
}) => (/*#__PURE__*/React__default.createElement("svg", {
|
|
246
238
|
fill: "none",
|
|
247
239
|
height: "123",
|
|
248
240
|
style: {
|
|
249
241
|
...style
|
|
250
242
|
},
|
|
251
|
-
width: "160"
|
|
252
|
-
|
|
243
|
+
width: "160",
|
|
244
|
+
...nativeProps
|
|
245
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
253
246
|
clipPath: `url(#clip-path-blank-state-${id})`
|
|
254
247
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
255
248
|
opacity: ".6",
|
|
@@ -281,70 +274,76 @@ const BlankStateIcon = ({
|
|
|
281
274
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
282
275
|
fill: "#fff",
|
|
283
276
|
d: "M0 0h160v122.063H0z"
|
|
284
|
-
}))));
|
|
277
|
+
})))));
|
|
285
278
|
const DisclosureChevronIcon = ({
|
|
286
279
|
className,
|
|
287
280
|
style,
|
|
288
281
|
...nativeProps
|
|
289
|
-
}) => /*#__PURE__*/React__default.createElement("svg",
|
|
282
|
+
}) => (/*#__PURE__*/React__default.createElement("svg", {
|
|
290
283
|
className: className,
|
|
291
284
|
height: "16",
|
|
292
285
|
viewBox: "0 0 16 16",
|
|
293
286
|
width: "16",
|
|
294
|
-
|
|
295
|
-
|
|
287
|
+
...{
|
|
288
|
+
style
|
|
289
|
+
},
|
|
290
|
+
...nativeProps
|
|
291
|
+
}, /*#__PURE__*/React__default.createElement("title", null, "chevron"), /*#__PURE__*/React__default.createElement("polygon", {
|
|
296
292
|
fill: "currentColor",
|
|
297
293
|
points: "11.931 4.892 8 8.824 4.069 4.892 2.927 6.034 8 11.108 9.142 9.966 13.073 6.034 11.931 4.892"
|
|
298
|
-
}));
|
|
294
|
+
})));
|
|
299
295
|
const ExclamationTriangle = ({
|
|
300
296
|
fill = "#000",
|
|
301
297
|
size = 24,
|
|
302
298
|
style,
|
|
303
299
|
...nativeProps
|
|
304
|
-
}) => /*#__PURE__*/React__default.createElement("svg",
|
|
300
|
+
}) => (/*#__PURE__*/React__default.createElement("svg", {
|
|
305
301
|
height: size,
|
|
306
302
|
style: {
|
|
307
303
|
display: "block",
|
|
308
304
|
...style
|
|
309
305
|
},
|
|
310
306
|
viewBox: "0 0 16 16",
|
|
311
|
-
width: size
|
|
312
|
-
|
|
307
|
+
width: size,
|
|
308
|
+
...nativeProps
|
|
309
|
+
}, /*#__PURE__*/React__default.createElement("title", null, "exclamation triangle icon"), /*#__PURE__*/React__default.createElement("path", {
|
|
313
310
|
d: "M15.669 13.676L8.65499 1.56099C8.58867 1.44593 8.49322 1.35037 8.37823 1.28392C8.26325 1.21748 8.13279 1.1825 7.99999 1.1825C7.86718 1.1825 7.73672 1.21748 7.62174 1.28392C7.50675 1.35037 7.4113 1.44593 7.34499 1.56099L0.330986 13.676C0.264196 13.7911 0.228916 13.9217 0.2287 14.0548C0.228484 14.1878 0.26334 14.3186 0.329756 14.4339C0.396172 14.5492 0.491802 14.6449 0.60701 14.7115C0.722218 14.778 0.852933 14.813 0.985986 14.813H15.014C15.147 14.813 15.2778 14.778 15.393 14.7115C15.5082 14.6449 15.6038 14.5492 15.6702 14.4339C15.7366 14.3186 15.7715 14.1878 15.7713 14.0548C15.7711 13.9217 15.7358 13.7911 15.669 13.676ZM8.75699 12.542H7.24299V11.028H8.75699V12.542ZM8.75699 9.51399H7.24299V6.48499H8.75699V9.51399Z",
|
|
314
311
|
fill: fill
|
|
315
|
-
}));
|
|
312
|
+
})));
|
|
316
313
|
const Spyglass = ({
|
|
317
314
|
fill = "#000",
|
|
318
315
|
style,
|
|
319
316
|
...nativeProps
|
|
320
|
-
}) => /*#__PURE__*/React__default.createElement("svg",
|
|
317
|
+
}) => (/*#__PURE__*/React__default.createElement("svg", {
|
|
321
318
|
width: "24",
|
|
322
319
|
height: "24",
|
|
323
320
|
viewBox: "0 0 24 24",
|
|
324
321
|
style: {
|
|
325
322
|
display: "block",
|
|
326
323
|
...style
|
|
327
|
-
}
|
|
328
|
-
|
|
324
|
+
},
|
|
325
|
+
...nativeProps
|
|
326
|
+
}, /*#__PURE__*/React__default.createElement("title", null, "search spyglass icon"), /*#__PURE__*/React__default.createElement("path", {
|
|
329
327
|
d: "M17.352,15.481a8.517,8.517,0,1,0-2.209,2.033l4.642,4.642,2.121-2.121Zm-6.757,1.364a6.5,6.5,0,1,1,6.5-6.5A6.508,6.508,0,0,1,10.595,16.845Z",
|
|
330
328
|
fill: fill
|
|
331
|
-
}));
|
|
329
|
+
})));
|
|
332
330
|
const X = ({
|
|
333
331
|
fill = "#A0A0A0",
|
|
334
332
|
style,
|
|
335
333
|
...nativeProps
|
|
336
|
-
}) => /*#__PURE__*/React__default.createElement("svg",
|
|
334
|
+
}) => (/*#__PURE__*/React__default.createElement("svg", {
|
|
337
335
|
width: "16",
|
|
338
336
|
height: "16",
|
|
339
337
|
viewBox: "0 0 16 16",
|
|
340
338
|
style: {
|
|
341
339
|
display: "block",
|
|
342
340
|
...style
|
|
343
|
-
}
|
|
344
|
-
|
|
341
|
+
},
|
|
342
|
+
...nativeProps
|
|
343
|
+
}, /*#__PURE__*/React__default.createElement("title", null, "close-x"), /*#__PURE__*/React__default.createElement("path", {
|
|
345
344
|
d: "M9.142,8l3.814,3.814-1.142,1.142L8,9.142,4.186,12.956,3.044,11.814,6.858,8,3.044,4.186,4.186,3.044,8,6.858l3.814-3.814,1.142,1.142Z",
|
|
346
345
|
fill: fill
|
|
347
|
-
}));
|
|
346
|
+
})));
|
|
348
347
|
|
|
349
348
|
var styles$b = {"announcement":"announcement-pI5tM","announcement--platform":"announcement--platform-EcUn2","announcement-icon":"announcement-icon-Ov39-","announcement-content":"announcement-content-q2ad6","dismiss":"dismiss-wUAoU"};
|
|
350
349
|
|
|
@@ -385,9 +384,6 @@ class Provider extends React__default.Component {
|
|
|
385
384
|
announcements: props.initialAnnouncements
|
|
386
385
|
};
|
|
387
386
|
}
|
|
388
|
-
static defaultProps = {
|
|
389
|
-
formatter: formatter
|
|
390
|
-
};
|
|
391
387
|
dismissAnnouncements(id) {
|
|
392
388
|
this.setState(({
|
|
393
389
|
announcements
|
|
@@ -410,6 +406,9 @@ class Provider extends React__default.Component {
|
|
|
410
406
|
}));
|
|
411
407
|
}
|
|
412
408
|
}
|
|
409
|
+
Provider.defaultProps = {
|
|
410
|
+
formatter: formatter
|
|
411
|
+
};
|
|
413
412
|
let StyledAnnouncement$1 = class StyledAnnouncement extends React__default.Component {
|
|
414
413
|
render() {
|
|
415
414
|
const {
|
|
@@ -418,10 +417,11 @@ let StyledAnnouncement$1 = class StyledAnnouncement extends React__default.Compo
|
|
|
418
417
|
} = this.props;
|
|
419
418
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
420
419
|
className: classnames(styles$b["announcement"], styles$b["announcement--platform"])
|
|
421
|
-
}, /*#__PURE__*/React__default.createElement(AnnouncementIcon, null), /*#__PURE__*/React__default.createElement("div",
|
|
420
|
+
}, /*#__PURE__*/React__default.createElement(AnnouncementIcon, null), /*#__PURE__*/React__default.createElement("div", {
|
|
422
421
|
className: styles$b["announcement-content"],
|
|
423
|
-
style: style
|
|
424
|
-
|
|
422
|
+
style: style,
|
|
423
|
+
...platformProps
|
|
424
|
+
}));
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
427
|
let StyleProvider$1 = class StyleProvider extends React__default.Component {
|
|
@@ -429,39 +429,42 @@ let StyleProvider$1 = class StyleProvider extends React__default.Component {
|
|
|
429
429
|
const {
|
|
430
430
|
...platformProps
|
|
431
431
|
} = this.props;
|
|
432
|
-
return /*#__PURE__*/React__default.createElement("div",
|
|
432
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
433
|
+
...platformProps
|
|
434
|
+
});
|
|
433
435
|
}
|
|
434
436
|
};
|
|
435
437
|
class PlatformAnnouncements extends React__default.Component {
|
|
436
|
-
static defaultProps = {
|
|
437
|
-
configuredFetch: defaultFetch,
|
|
438
|
-
renderItem: ({
|
|
439
|
-
announcement,
|
|
440
|
-
actions
|
|
441
|
-
}) => /*#__PURE__*/React__default.createElement(DissmissibleAnnouncement, {
|
|
442
|
-
key: announcement.id,
|
|
443
|
-
html: announcement.data.html,
|
|
444
|
-
onClick: () => actions.dismissAnnouncements(announcement.id)
|
|
445
|
-
})
|
|
446
|
-
};
|
|
447
438
|
render() {
|
|
448
439
|
return /*#__PURE__*/React__default.createElement(StyleProvider$1, null, /*#__PURE__*/React__default.createElement(Provider, {
|
|
449
440
|
env: this.props.env,
|
|
450
441
|
initialAnnouncements: this.props.data,
|
|
451
442
|
configuredFetch: this.props.configuredFetch
|
|
452
|
-
}, (data, actions) => Boolean(data.announcements.length > 0) ? /*#__PURE__*/React__default.createElement("div", null, data.announcements.map(announcement => this.props.renderItem({
|
|
443
|
+
}, (data, actions) => Boolean(data.announcements.length > 0) ? (/*#__PURE__*/React__default.createElement("div", null, data.announcements.map(announcement => this.props.renderItem({
|
|
453
444
|
actions,
|
|
454
445
|
announcement
|
|
455
|
-
}))) : null));
|
|
446
|
+
})))) : null));
|
|
456
447
|
}
|
|
457
448
|
}
|
|
449
|
+
PlatformAnnouncements.defaultProps = {
|
|
450
|
+
configuredFetch: defaultFetch,
|
|
451
|
+
renderItem: ({
|
|
452
|
+
announcement,
|
|
453
|
+
actions
|
|
454
|
+
}) => (/*#__PURE__*/React__default.createElement(DissmissibleAnnouncement, {
|
|
455
|
+
key: announcement.id,
|
|
456
|
+
html: announcement.data.html,
|
|
457
|
+
onClick: () => actions.dismissAnnouncements(announcement.id)
|
|
458
|
+
}))
|
|
459
|
+
};
|
|
458
460
|
function StyledDismissButton$1({
|
|
459
461
|
...props
|
|
460
462
|
}) {
|
|
461
|
-
return /*#__PURE__*/React__default.createElement("button",
|
|
463
|
+
return /*#__PURE__*/React__default.createElement("button", {
|
|
462
464
|
type: "button",
|
|
463
|
-
className: styles$b.dismiss
|
|
464
|
-
|
|
465
|
+
className: styles$b.dismiss,
|
|
466
|
+
...props
|
|
467
|
+
}, /*#__PURE__*/React__default.createElement(X, {
|
|
465
468
|
fill: "white",
|
|
466
469
|
style: {
|
|
467
470
|
height: 20,
|
|
@@ -498,7 +501,6 @@ It should look something like this in your application's Topbar composition:
|
|
|
498
501
|
|
|
499
502
|
Attributes like `className`, `id`, `data-*`, and `aria-*` are all applied to the root element.
|
|
500
503
|
*/
|
|
501
|
-
|
|
502
504
|
function ProductAnnouncement({
|
|
503
505
|
html = "",
|
|
504
506
|
onClick = _event => {
|
|
@@ -507,7 +509,9 @@ function ProductAnnouncement({
|
|
|
507
509
|
...props
|
|
508
510
|
}) {
|
|
509
511
|
const [dismissed, updateDismissed] = React__default.useState(false);
|
|
510
|
-
return dismissed || !html ? null : /*#__PURE__*/React__default.createElement(StyleProvider,
|
|
512
|
+
return dismissed || !html ? null : (/*#__PURE__*/React__default.createElement(StyleProvider, {
|
|
513
|
+
...props
|
|
514
|
+
}, /*#__PURE__*/React__default.createElement(StyledAnnouncement, null, /*#__PURE__*/React__default.createElement("span", {
|
|
511
515
|
dangerouslySetInnerHTML: {
|
|
512
516
|
__html: html
|
|
513
517
|
}
|
|
@@ -516,14 +520,16 @@ function ProductAnnouncement({
|
|
|
516
520
|
onClick(event);
|
|
517
521
|
updateDismissed(true);
|
|
518
522
|
}
|
|
519
|
-
})));
|
|
523
|
+
}))));
|
|
520
524
|
}
|
|
521
525
|
class StyleProvider extends React__default.Component {
|
|
522
526
|
render() {
|
|
523
527
|
const {
|
|
524
528
|
...platformProps
|
|
525
529
|
} = this.props;
|
|
526
|
-
return /*#__PURE__*/React__default.createElement("div",
|
|
530
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
531
|
+
...platformProps
|
|
532
|
+
});
|
|
527
533
|
}
|
|
528
534
|
}
|
|
529
535
|
class StyledAnnouncement extends React__default.Component {
|
|
@@ -534,19 +540,21 @@ class StyledAnnouncement extends React__default.Component {
|
|
|
534
540
|
} = this.props;
|
|
535
541
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
536
542
|
className: styles$b["announcement"]
|
|
537
|
-
}, /*#__PURE__*/React__default.createElement(AnnouncementIcon, null), /*#__PURE__*/React__default.createElement("div",
|
|
543
|
+
}, /*#__PURE__*/React__default.createElement(AnnouncementIcon, null), /*#__PURE__*/React__default.createElement("div", {
|
|
538
544
|
className: styles$b["announcement-content"],
|
|
539
|
-
style: style
|
|
540
|
-
|
|
545
|
+
style: style,
|
|
546
|
+
...platformProps
|
|
547
|
+
}));
|
|
541
548
|
}
|
|
542
549
|
}
|
|
543
550
|
function StyledDismissButton({
|
|
544
551
|
...props
|
|
545
552
|
}) {
|
|
546
|
-
return /*#__PURE__*/React__default.createElement("button",
|
|
553
|
+
return /*#__PURE__*/React__default.createElement("button", {
|
|
547
554
|
type: "button",
|
|
548
|
-
className: styles$b.dismiss
|
|
549
|
-
|
|
555
|
+
className: styles$b.dismiss,
|
|
556
|
+
...props
|
|
557
|
+
}, /*#__PURE__*/React__default.createElement(X, {
|
|
550
558
|
fill: "white",
|
|
551
559
|
style: {
|
|
552
560
|
height: 20,
|
|
@@ -622,8 +630,9 @@ const useJoltChannelSubscription = ({
|
|
|
622
630
|
}, [enabled, subscribeToJoltChannel]);
|
|
623
631
|
React__default.useEffect(() => {
|
|
624
632
|
const pcoPageExpiredHandler = event => {
|
|
633
|
+
var _a;
|
|
625
634
|
if (!event.data.hasOwnProperty("PCOPageExpiredCurrentPersonACID")) return;
|
|
626
|
-
if (event.data.PCOPageExpiredCurrentPersonACID === window
|
|
635
|
+
if (event.data.PCOPageExpiredCurrentPersonACID === ((_a = window === null || window === void 0 ? void 0 : window.pcoPageExpired) === null || _a === void 0 ? void 0 : _a.currentPersonACID)) return;
|
|
627
636
|
if (joltInstance) joltInstance.disconnect();
|
|
628
637
|
};
|
|
629
638
|
window.addEventListener("message", pcoPageExpiredHandler);
|
|
@@ -638,7 +647,6 @@ const useJoltChannelSubscription = ({
|
|
|
638
647
|
}, [joltInstance]);
|
|
639
648
|
return joltChannel;
|
|
640
649
|
};
|
|
641
|
-
|
|
642
650
|
// TODO: This can be removed once all Topbar consumers that
|
|
643
651
|
// provide a joltPromise are updated to jolt-client v2
|
|
644
652
|
const buildLegacyJoltChannel = (jolt, channelName, fetchSubscribeTokenFn) => {
|
|
@@ -648,7 +656,8 @@ const buildLegacyJoltChannel = (jolt, channelName, fetchSubscribeTokenFn) => {
|
|
|
648
656
|
return channel;
|
|
649
657
|
};
|
|
650
658
|
const buildJoltChannel = (jolt, channelName, fetchSubscribeTokenFn) => {
|
|
651
|
-
|
|
659
|
+
var _a;
|
|
660
|
+
const channel = ((_a = jolt.allSubscriptions) === null || _a === void 0 ? void 0 : _a.find(s => s.channel === channelName)) || jolt.subscribe(channelName, {
|
|
652
661
|
fetchSubscribeTokenFn
|
|
653
662
|
});
|
|
654
663
|
channel.subscribe();
|
|
@@ -697,7 +706,6 @@ function useLocalStorage(key, initialValue) {
|
|
|
697
706
|
try {
|
|
698
707
|
// Get from local storage by key
|
|
699
708
|
const item = window.localStorage.getItem(key);
|
|
700
|
-
|
|
701
709
|
// Parse stored json or if none return initialValue
|
|
702
710
|
return item ? JSON.parse(item) : initialValue;
|
|
703
711
|
} catch (error) {
|
|
@@ -705,13 +713,11 @@ function useLocalStorage(key, initialValue) {
|
|
|
705
713
|
return initialValue;
|
|
706
714
|
}
|
|
707
715
|
});
|
|
708
|
-
|
|
709
716
|
// Reflect the state into localStorage as a side effect.
|
|
710
717
|
const localStorageRepresentation = JSON.stringify(storedValue);
|
|
711
718
|
useEffect(() => {
|
|
712
719
|
window.localStorage.setItem(key, localStorageRepresentation);
|
|
713
720
|
}, [key, localStorageRepresentation]);
|
|
714
|
-
|
|
715
721
|
// When we are done with this key, drop it from localStorage completely
|
|
716
722
|
const dropKey = () => window.localStorage.removeItem(key);
|
|
717
723
|
return {
|
|
@@ -802,22 +808,21 @@ const AppsProvider = ({
|
|
|
802
808
|
render,
|
|
803
809
|
userId
|
|
804
810
|
}) => {
|
|
811
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
805
812
|
const topbarResponse = useTopbarAPI({
|
|
806
813
|
configuredFetch,
|
|
807
814
|
env
|
|
808
815
|
});
|
|
809
816
|
const apps = formatter(topbarResponse);
|
|
810
|
-
const hasConnectedPeople = topbarResponse
|
|
811
|
-
const mfaConfigured = !!topbarResponse
|
|
812
|
-
const
|
|
813
|
-
const
|
|
814
|
-
const colorMode = topbarResponse?.data?.attributes?.color_mode;
|
|
815
|
-
const name = topbarResponse?.data?.attributes?.name;
|
|
817
|
+
const hasConnectedPeople = (_b = (_a = topbarResponse === null || topbarResponse === void 0 ? void 0 : topbarResponse.data) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b.has_connected_people;
|
|
818
|
+
const mfaConfigured = !!((_d = (_c = topbarResponse === null || topbarResponse === void 0 ? void 0 : topbarResponse.data) === null || _c === void 0 ? void 0 : _c.attributes) === null || _d === void 0 ? void 0 : _d.mfa_configured);
|
|
819
|
+
const colorMode = (_f = (_e = topbarResponse === null || topbarResponse === void 0 ? void 0 : topbarResponse.data) === null || _e === void 0 ? void 0 : _e.attributes) === null || _f === void 0 ? void 0 : _f.color_mode;
|
|
820
|
+
const name = (_h = (_g = topbarResponse === null || topbarResponse === void 0 ? void 0 : topbarResponse.data) === null || _g === void 0 ? void 0 : _g.attributes) === null || _h === void 0 ? void 0 : _h.name;
|
|
816
821
|
const notificationsEnabled = !window.notificationsDisabled;
|
|
817
|
-
const organizationTimeZone = topbarResponse
|
|
822
|
+
const organizationTimeZone = ((_k = (_j = topbarResponse === null || topbarResponse === void 0 ? void 0 : topbarResponse.data) === null || _j === void 0 ? void 0 : _j.attributes) === null || _k === void 0 ? void 0 : _k.org_time_zone) || "America/Los_Angeles";
|
|
818
823
|
const algoliaSearchAuth = {
|
|
819
|
-
algoliaApplicationId: topbarResponse
|
|
820
|
-
algoliaSearchOnlyApiKey: topbarResponse
|
|
824
|
+
algoliaApplicationId: (_m = (_l = topbarResponse === null || topbarResponse === void 0 ? void 0 : topbarResponse.data) === null || _l === void 0 ? void 0 : _l.attributes) === null || _m === void 0 ? void 0 : _m.algolia_application_identifier,
|
|
825
|
+
algoliaSearchOnlyApiKey: (_p = (_o = topbarResponse === null || topbarResponse === void 0 ? void 0 : topbarResponse.data) === null || _o === void 0 ? void 0 : _o.attributes) === null || _p === void 0 ? void 0 : _p.algolia_search_key
|
|
821
826
|
};
|
|
822
827
|
const joltPromise = useMemo(() => {
|
|
823
828
|
return resolveJoltPromise({
|
|
@@ -869,8 +874,6 @@ const AppsProvider = ({
|
|
|
869
874
|
...state,
|
|
870
875
|
algoliaSearchAuth,
|
|
871
876
|
colorMode,
|
|
872
|
-
colorModeLaunched,
|
|
873
|
-
colorModeSelectionEnabled,
|
|
874
877
|
disconnectJoltOnUnmount: !providedJoltPromise,
|
|
875
878
|
hasConnectedPeople,
|
|
876
879
|
indicatorVisible: {
|
|
@@ -890,17 +893,16 @@ const AppsProvider = ({
|
|
|
890
893
|
organizationTimeZone,
|
|
891
894
|
userId
|
|
892
895
|
});
|
|
893
|
-
}, [colorMode,
|
|
894
|
-
|
|
896
|
+
}, [colorMode, joltPromise, mfaConfigured, name, notificationsEnabled, notificationsHasUnread, organizationTimeZone, userId]);
|
|
895
897
|
// TODO: remove `fetch` and `remove` (breaking changes)
|
|
896
898
|
return render(apps || [], {
|
|
897
899
|
fetch: () => {},
|
|
898
|
-
// no-op because we already have fresh data
|
|
899
900
|
remove: () => {} // no-op because we are no longer caching anyway
|
|
900
901
|
});
|
|
901
902
|
};
|
|
902
903
|
function mapApps(resp) {
|
|
903
|
-
|
|
904
|
+
var _a, _b;
|
|
905
|
+
return ((_b = (_a = resp === null || resp === void 0 ? void 0 : resp.data) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b.apps) || [];
|
|
904
906
|
}
|
|
905
907
|
|
|
906
908
|
function remove() {
|
|
@@ -916,9 +918,6 @@ class ConnectedPeopleProvider extends React__default.Component {
|
|
|
916
918
|
connectedPeople: []
|
|
917
919
|
};
|
|
918
920
|
}
|
|
919
|
-
static defaultProps = {
|
|
920
|
-
configuredFetch: defaultFetch
|
|
921
|
-
};
|
|
922
921
|
fetch() {
|
|
923
922
|
apiRequest(this.props.configuredFetch, `${pcoUrl(this.props.env)("api")}/login/v2/me/connected_people`).then(({
|
|
924
923
|
json,
|
|
@@ -937,7 +936,8 @@ class ConnectedPeopleProvider extends React__default.Component {
|
|
|
937
936
|
}).then(({
|
|
938
937
|
json
|
|
939
938
|
}) => {
|
|
940
|
-
|
|
939
|
+
var _a;
|
|
940
|
+
if ((_a = json === null || json === void 0 ? void 0 : json.meta) === null || _a === void 0 ? void 0 : _a.redirect_to) navigateTo(json.meta.redirect_to);
|
|
941
941
|
});
|
|
942
942
|
}
|
|
943
943
|
switch(toId, returnPath) {
|
|
@@ -954,7 +954,8 @@ class ConnectedPeopleProvider extends React__default.Component {
|
|
|
954
954
|
}).then(({
|
|
955
955
|
json
|
|
956
956
|
}) => {
|
|
957
|
-
|
|
957
|
+
var _a;
|
|
958
|
+
if ((_a = json === null || json === void 0 ? void 0 : json.meta) === null || _a === void 0 ? void 0 : _a.redirect_to) navigateTo(json.meta.redirect_to);
|
|
958
959
|
});
|
|
959
960
|
}
|
|
960
961
|
componentDidMount() {
|
|
@@ -973,6 +974,9 @@ class ConnectedPeopleProvider extends React__default.Component {
|
|
|
973
974
|
});
|
|
974
975
|
}
|
|
975
976
|
}
|
|
977
|
+
ConnectedPeopleProvider.defaultProps = {
|
|
978
|
+
configuredFetch: defaultFetch
|
|
979
|
+
};
|
|
976
980
|
|
|
977
981
|
class PointBreak extends React__default.Component {
|
|
978
982
|
constructor(props) {
|
|
@@ -1005,9 +1009,6 @@ class PointBreak extends React__default.Component {
|
|
|
1005
1009
|
}
|
|
1006
1010
|
}
|
|
1007
1011
|
class DisplaySwitch extends React__default.Component {
|
|
1008
|
-
static defaultProps = {
|
|
1009
|
-
smallBreakpoints: ["xs", "sm"]
|
|
1010
|
-
};
|
|
1011
1012
|
render() {
|
|
1012
1013
|
return /*#__PURE__*/React__default.createElement(PointBreak, {
|
|
1013
1014
|
render: breakpoint => {
|
|
@@ -1019,6 +1020,9 @@ class DisplaySwitch extends React__default.Component {
|
|
|
1019
1020
|
});
|
|
1020
1021
|
}
|
|
1021
1022
|
}
|
|
1023
|
+
DisplaySwitch.defaultProps = {
|
|
1024
|
+
smallBreakpoints: ["xs", "sm"]
|
|
1025
|
+
};
|
|
1022
1026
|
|
|
1023
1027
|
// TODO: Use Fragments when we React 16 is a baseline
|
|
1024
1028
|
function Accounts$2() {
|
|
@@ -1478,14 +1482,14 @@ function ColorAppIcon({
|
|
|
1478
1482
|
}
|
|
1479
1483
|
}, ColorAppSquircles[appName] ? (/*#__PURE__*/React__default.createElement(ColorAppSquircles[appName], {
|
|
1480
1484
|
key: "key1"
|
|
1481
|
-
})) : /*#__PURE__*/React__default.createElement("span", {
|
|
1485
|
+
})) : (/*#__PURE__*/React__default.createElement("span", {
|
|
1482
1486
|
key: "key1"
|
|
1483
|
-
}), AppSymbols[appName] ? (/*#__PURE__*/React__default.createElement(AppSymbols[appName], {
|
|
1487
|
+
})), AppSymbols[appName] ? (/*#__PURE__*/React__default.createElement(AppSymbols[appName], {
|
|
1484
1488
|
color: "#fff",
|
|
1485
1489
|
key: "key2"
|
|
1486
|
-
})) : /*#__PURE__*/React__default.createElement("div", {
|
|
1490
|
+
})) : (/*#__PURE__*/React__default.createElement("div", {
|
|
1487
1491
|
key: "key3"
|
|
1488
|
-
}, "appName not supported"));
|
|
1492
|
+
}, "appName not supported")));
|
|
1489
1493
|
}
|
|
1490
1494
|
|
|
1491
1495
|
const SQUIRCLE_FILL_COLORS = {
|
|
@@ -1516,7 +1520,7 @@ function MonoAppIcon({
|
|
|
1516
1520
|
size = 24,
|
|
1517
1521
|
...platformProps
|
|
1518
1522
|
}) {
|
|
1519
|
-
return /*#__PURE__*/React__default.createElement("svg",
|
|
1523
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
1520
1524
|
"data-logo": "mono-app-icon",
|
|
1521
1525
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1522
1526
|
width: size,
|
|
@@ -1527,19 +1531,20 @@ function MonoAppIcon({
|
|
|
1527
1531
|
style: {
|
|
1528
1532
|
display: "block",
|
|
1529
1533
|
...style
|
|
1530
|
-
}
|
|
1531
|
-
|
|
1534
|
+
},
|
|
1535
|
+
...platformProps
|
|
1536
|
+
}, /*#__PURE__*/React__default.createElement("title", {
|
|
1532
1537
|
id: "title"
|
|
1533
1538
|
}, "Planning Center ", appName, " App Icon"), /*#__PURE__*/React__default.createElement("desc", {
|
|
1534
1539
|
id: "desc"
|
|
1535
|
-
}, "An image symbolizing the Planning Center ", appName, " app."), appName === "Accounts" ? null : /*#__PURE__*/React__default.createElement(Squircle, {
|
|
1540
|
+
}, "An image symbolizing the Planning Center ", appName, " app."), appName === "Accounts" ? null : (/*#__PURE__*/React__default.createElement(Squircle, {
|
|
1536
1541
|
appName: appName.toLowerCase()
|
|
1537
|
-
}), AppSymbols[appName] ? (/*#__PURE__*/React__default.createElement(AppSymbols[appName], {
|
|
1538
|
-
color: appName === "Accounts" ? "var(--t-text-color
|
|
1539
|
-
})) : /*#__PURE__*/React__default.createElement("div", null, "appName not supported"));
|
|
1542
|
+
})), AppSymbols[appName] ? (/*#__PURE__*/React__default.createElement(AppSymbols[appName], {
|
|
1543
|
+
color: appName === "Accounts" ? "var(--t-text-color)" : "var(--t-fill-color-neutral-100)"
|
|
1544
|
+
})) : (/*#__PURE__*/React__default.createElement("div", null, "appName not supported")));
|
|
1540
1545
|
}
|
|
1541
1546
|
|
|
1542
|
-
const fill = "var(--t-text-color
|
|
1547
|
+
const fill = "var(--t-text-color)";
|
|
1543
1548
|
function Accounts({
|
|
1544
1549
|
size = 20
|
|
1545
1550
|
}) {
|
|
@@ -1719,7 +1724,7 @@ function MonoAppName({
|
|
|
1719
1724
|
}) {
|
|
1720
1725
|
return MonoAppText[appName] ? (/*#__PURE__*/React__default.createElement(MonoAppText[appName], {
|
|
1721
1726
|
size
|
|
1722
|
-
})) : /*#__PURE__*/React__default.createElement("div", null, "appName not supported");
|
|
1727
|
+
})) : (/*#__PURE__*/React__default.createElement("div", null, "appName not supported"));
|
|
1723
1728
|
}
|
|
1724
1729
|
|
|
1725
1730
|
var styles$a = {"unbutton":"unbutton-lEbTR"};
|
|
@@ -1730,13 +1735,14 @@ function Unbutton({
|
|
|
1730
1735
|
type = "button",
|
|
1731
1736
|
...nativeProps
|
|
1732
1737
|
}) {
|
|
1733
|
-
return /*#__PURE__*/React__default.createElement("button",
|
|
1738
|
+
return /*#__PURE__*/React__default.createElement("button", {
|
|
1734
1739
|
className: classnames(styles$a.unbutton, className),
|
|
1735
1740
|
style: {
|
|
1736
1741
|
...style
|
|
1737
1742
|
},
|
|
1738
|
-
type: type
|
|
1739
|
-
|
|
1743
|
+
type: type,
|
|
1744
|
+
...nativeProps
|
|
1745
|
+
});
|
|
1740
1746
|
}
|
|
1741
1747
|
|
|
1742
1748
|
var styles$9 = {"button":"button-XMbeQ","button-accounts":"button-accounts-nNh-z","chevron":"chevron-RRg9k","is-expanded":"is-expanded-zD0A0"};
|
|
@@ -1749,33 +1755,35 @@ const AppsButton = ({
|
|
|
1749
1755
|
style = null,
|
|
1750
1756
|
...nativeProps
|
|
1751
1757
|
}) => {
|
|
1752
|
-
return /*#__PURE__*/React__default.createElement(Unbutton,
|
|
1758
|
+
return /*#__PURE__*/React__default.createElement(Unbutton, {
|
|
1753
1759
|
onClick: onClick,
|
|
1754
1760
|
className: classnames(styles$9.button, {
|
|
1755
1761
|
[styles$9["is-expanded"]]: expanded
|
|
1756
1762
|
}),
|
|
1757
1763
|
type: "button",
|
|
1758
|
-
style: style
|
|
1759
|
-
|
|
1764
|
+
style: style,
|
|
1765
|
+
...nativeProps
|
|
1766
|
+
}, appName === "Accounts" ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MonoAppIcon, {
|
|
1760
1767
|
appName: "Accounts",
|
|
1761
1768
|
colors: colors
|
|
1762
1769
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1763
1770
|
className: styles$9["button-accounts"]
|
|
1764
|
-
}, "Account settings")) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ColorAppIcon, {
|
|
1771
|
+
}, "Account settings"))) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ColorAppIcon, {
|
|
1765
1772
|
appName: appName.replace(/[\s-]/, "")
|
|
1766
1773
|
}), /*#__PURE__*/React__default.createElement(MonoAppName, {
|
|
1767
1774
|
appName: appName.replace(/[\s-]/, ""),
|
|
1768
1775
|
key: "mono-app-name",
|
|
1769
1776
|
size: 24
|
|
1770
|
-
})), /*#__PURE__*/React__default.createElement(DisclosureChevronIcon, {
|
|
1777
|
+
}))), /*#__PURE__*/React__default.createElement(DisclosureChevronIcon, {
|
|
1771
1778
|
className: styles$9.chevron,
|
|
1772
1779
|
key: "disclosure-chevron-icon"
|
|
1773
1780
|
}));
|
|
1774
1781
|
};
|
|
1775
1782
|
|
|
1776
1783
|
function getAppsSwitchProductPath(productName) {
|
|
1784
|
+
var _a, _b;
|
|
1777
1785
|
const basePath = `/apps/${productName.toLowerCase()}`;
|
|
1778
|
-
const referer = window
|
|
1786
|
+
const referer = (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.pathname) === null || _b === void 0 ? void 0 : _b.toString();
|
|
1779
1787
|
if (!referer) return basePath;
|
|
1780
1788
|
const params = new URLSearchParams();
|
|
1781
1789
|
params.append("referer", referer);
|
|
@@ -1799,14 +1807,15 @@ const HoverableListItem = ({
|
|
|
1799
1807
|
}) => {
|
|
1800
1808
|
const [entered, setEntered] = React__default.useState(false);
|
|
1801
1809
|
const getBackgroundColor = () => active ? "var(--t-fill-color-neutral-060)" : entered ? "var(--t-fill-color-neutral-080)" : "transparent";
|
|
1802
|
-
return /*#__PURE__*/React__default.createElement(C,
|
|
1810
|
+
return /*#__PURE__*/React__default.createElement(C, {
|
|
1803
1811
|
onMouseEnter: () => setEntered(true),
|
|
1804
1812
|
onMouseLeave: () => setEntered(false),
|
|
1805
1813
|
style: {
|
|
1806
1814
|
...style,
|
|
1807
1815
|
backgroundColor: getBackgroundColor()
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1816
|
+
},
|
|
1817
|
+
...nativeProps
|
|
1818
|
+
});
|
|
1810
1819
|
};
|
|
1811
1820
|
|
|
1812
1821
|
class Outsider extends React__default.Component {
|
|
@@ -1838,9 +1847,10 @@ class Outsider extends React__default.Component {
|
|
|
1838
1847
|
} else {
|
|
1839
1848
|
document.addEventListener("click", this.handleOutsideClick, true);
|
|
1840
1849
|
}
|
|
1841
|
-
return /*#__PURE__*/React__default.createElement("div",
|
|
1842
|
-
ref: c => this.container = c
|
|
1843
|
-
|
|
1850
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1851
|
+
ref: c => this.container = c,
|
|
1852
|
+
...props
|
|
1853
|
+
});
|
|
1844
1854
|
}
|
|
1845
1855
|
}
|
|
1846
1856
|
|
|
@@ -1851,17 +1861,19 @@ const Popup = ({
|
|
|
1851
1861
|
component: C = "div",
|
|
1852
1862
|
isVisible,
|
|
1853
1863
|
...nativeProps
|
|
1854
|
-
}) => /*#__PURE__*/React__default.createElement(C,
|
|
1864
|
+
}) => (/*#__PURE__*/React__default.createElement(C, {
|
|
1855
1865
|
className: classnames(styles$7.popup, {
|
|
1856
1866
|
[styles$7["is-visible"]]: isVisible
|
|
1857
|
-
}, className)
|
|
1858
|
-
|
|
1867
|
+
}, className),
|
|
1868
|
+
...nativeProps
|
|
1869
|
+
}));
|
|
1859
1870
|
|
|
1860
1871
|
const PopupRoot = ({
|
|
1861
1872
|
...nativeProps
|
|
1862
|
-
}) => /*#__PURE__*/React__default.createElement("div",
|
|
1863
|
-
className: styles$7["popup-root"]
|
|
1864
|
-
|
|
1873
|
+
}) => (/*#__PURE__*/React__default.createElement("div", {
|
|
1874
|
+
className: styles$7["popup-root"],
|
|
1875
|
+
...nativeProps
|
|
1876
|
+
}));
|
|
1865
1877
|
|
|
1866
1878
|
const AppsMenu = ({
|
|
1867
1879
|
appName,
|
|
@@ -1900,14 +1912,14 @@ const AppsMenu = ({
|
|
|
1900
1912
|
margin: 0,
|
|
1901
1913
|
padding: 0
|
|
1902
1914
|
}
|
|
1903
|
-
}, homeProduct && /*#__PURE__*/React__default.createElement(HoverableListItem, {
|
|
1915
|
+
}, homeProduct && (/*#__PURE__*/React__default.createElement(HoverableListItem, {
|
|
1904
1916
|
component: "a",
|
|
1905
1917
|
"data-pendo": `app-switcher--change-app--${homeProduct.name}`,
|
|
1906
1918
|
"data-turbolinks": false,
|
|
1907
1919
|
href: appName === homeProduct.name ? `${pcoUrl(env)("accounts")}/apps/${appName}` : pcoUrl(env)("accounts") + getAppsSwitchProductPath(homeProduct.name),
|
|
1908
1920
|
style: {
|
|
1909
1921
|
...listItemProps,
|
|
1910
|
-
borderBottom: "1px solid var(--t-border-color
|
|
1922
|
+
borderBottom: "1px solid var(--t-border-color)"
|
|
1911
1923
|
}
|
|
1912
1924
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1913
1925
|
style: {
|
|
@@ -1919,7 +1931,7 @@ const AppsMenu = ({
|
|
|
1919
1931
|
})), /*#__PURE__*/React__default.createElement(MonoAppName, {
|
|
1920
1932
|
appName: "Home",
|
|
1921
1933
|
size: 18
|
|
1922
|
-
})), restProducts.map(({
|
|
1934
|
+
}))), restProducts.map(({
|
|
1923
1935
|
name
|
|
1924
1936
|
}, i) => {
|
|
1925
1937
|
const isFirst = i === 0;
|
|
@@ -1947,14 +1959,14 @@ const AppsMenu = ({
|
|
|
1947
1959
|
appName: name.replace(/[\s-]/, ""),
|
|
1948
1960
|
size: 18
|
|
1949
1961
|
}));
|
|
1950
|
-
}), accountsProduct && /*#__PURE__*/React__default.createElement(HoverableListItem, {
|
|
1962
|
+
}), accountsProduct && (/*#__PURE__*/React__default.createElement(HoverableListItem, {
|
|
1951
1963
|
component: "a",
|
|
1952
1964
|
"data-pendo": `app-switcher--change-app--${accountsProduct.name}`,
|
|
1953
1965
|
"data-turbolinks": false,
|
|
1954
1966
|
href: pcoUrl(env)("accounts") + getAppsSwitchProductPath(accountsProduct.name),
|
|
1955
1967
|
style: {
|
|
1956
1968
|
...listItemProps,
|
|
1957
|
-
borderTop: "1px solid var(--t-border-color
|
|
1969
|
+
borderTop: "1px solid var(--t-border-color)",
|
|
1958
1970
|
padding: "0 12px",
|
|
1959
1971
|
textDecoration: "none"
|
|
1960
1972
|
}
|
|
@@ -1968,15 +1980,15 @@ const AppsMenu = ({
|
|
|
1968
1980
|
width: 22,
|
|
1969
1981
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1970
1982
|
}, /*#__PURE__*/React__default.createElement(Accounts$1, {
|
|
1971
|
-
color: "var(--t-icon-color-
|
|
1983
|
+
color: "var(--t-icon-color-secondary)",
|
|
1972
1984
|
key: "key2"
|
|
1973
1985
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
1974
1986
|
style: {
|
|
1975
|
-
color: "var(--t-text-color-
|
|
1987
|
+
color: "var(--t-text-color-secondary)",
|
|
1976
1988
|
fontSize: "12px",
|
|
1977
1989
|
lineHeight: "28px"
|
|
1978
1990
|
}
|
|
1979
|
-
}, "Account settings")))));
|
|
1991
|
+
}, "Account settings"))))));
|
|
1980
1992
|
};
|
|
1981
1993
|
|
|
1982
1994
|
const sortByAttribute = attr => arr => arr.slice().sort((a, b) => a[attr].localeCompare(b[attr]));
|
|
@@ -2001,7 +2013,7 @@ const useSetCurrentRouteInfo = ({
|
|
|
2001
2013
|
}) => ({
|
|
2002
2014
|
active,
|
|
2003
2015
|
name: key,
|
|
2004
|
-
url: to
|
|
2016
|
+
url: to !== null && to !== void 0 ? to : href
|
|
2005
2017
|
}))
|
|
2006
2018
|
};
|
|
2007
2019
|
}
|
|
@@ -2023,7 +2035,7 @@ function StyledRoot({
|
|
|
2023
2035
|
style,
|
|
2024
2036
|
...nativeProps
|
|
2025
2037
|
}) {
|
|
2026
|
-
return /*#__PURE__*/React__default.createElement("nav",
|
|
2038
|
+
return /*#__PURE__*/React__default.createElement("nav", {
|
|
2027
2039
|
className: "simple",
|
|
2028
2040
|
"data-pendo": "topbar",
|
|
2029
2041
|
"aria-label": "topbar-navigation",
|
|
@@ -2033,8 +2045,9 @@ function StyledRoot({
|
|
|
2033
2045
|
display: "flex",
|
|
2034
2046
|
height: "var(--topbar-height)",
|
|
2035
2047
|
...style
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2048
|
+
},
|
|
2049
|
+
...nativeProps
|
|
2050
|
+
}, /*#__PURE__*/React__default.createElement("style", null, `
|
|
2038
2051
|
@media only print {
|
|
2039
2052
|
.simple {
|
|
2040
2053
|
display: none !important;
|
|
@@ -2066,7 +2079,7 @@ const UserMenu = ({
|
|
|
2066
2079
|
cleanup: !userMenuVisible,
|
|
2067
2080
|
className: styles$5.popup,
|
|
2068
2081
|
isVisible: userMenuVisible
|
|
2069
|
-
}, /*#__PURE__*/React__default.createElement("div", null, hasConnectedPeople ? /*#__PURE__*/React__default.createElement("div", {
|
|
2082
|
+
}, /*#__PURE__*/React__default.createElement("div", null, hasConnectedPeople ? (/*#__PURE__*/React__default.createElement("div", {
|
|
2070
2083
|
style: {
|
|
2071
2084
|
alignItems: "center",
|
|
2072
2085
|
backgroundColor: "var(--t-fill-color-neutral-060)",
|
|
@@ -2077,7 +2090,7 @@ const UserMenu = ({
|
|
|
2077
2090
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2078
2091
|
style: {
|
|
2079
2092
|
...IEFlex1,
|
|
2080
|
-
color: "var(--t-text-color-
|
|
2093
|
+
color: "var(--t-text-color-secondary)",
|
|
2081
2094
|
fontSize: "12px",
|
|
2082
2095
|
textTransform: "uppercase",
|
|
2083
2096
|
whiteSpace: "nowrap",
|
|
@@ -2099,12 +2112,12 @@ const UserMenu = ({
|
|
|
2099
2112
|
e.preventDefault();
|
|
2100
2113
|
},
|
|
2101
2114
|
style: {
|
|
2102
|
-
color: "var(--t-text-color-
|
|
2115
|
+
color: "var(--t-text-color-secondary)",
|
|
2103
2116
|
marginLeft: "64px",
|
|
2104
2117
|
textDecoration: "none",
|
|
2105
2118
|
...fontFamily
|
|
2106
2119
|
}
|
|
2107
|
-
}, "unlink"))) : /*#__PURE__*/React__default.createElement("noscript", null), /*#__PURE__*/React__default.createElement("style", null, `
|
|
2120
|
+
}, "unlink")))) : (/*#__PURE__*/React__default.createElement("noscript", null)), /*#__PURE__*/React__default.createElement("style", null, `
|
|
2108
2121
|
.NotSmallTopbar__connected-people-list > *:first-child > * { border-top-width: 0 !important }
|
|
2109
2122
|
`), /*#__PURE__*/React__default.createElement("ul", {
|
|
2110
2123
|
className: "NotSmallTopbar__connected-people-list",
|
|
@@ -2116,7 +2129,7 @@ const UserMenu = ({
|
|
|
2116
2129
|
}, connectedPeopleMenuFormatter(connectedPeople).map(({
|
|
2117
2130
|
id,
|
|
2118
2131
|
attributes: person
|
|
2119
|
-
}) => /*#__PURE__*/React__default.createElement(HoverableListItem, {
|
|
2132
|
+
}) => (/*#__PURE__*/React__default.createElement(HoverableListItem, {
|
|
2120
2133
|
component: "li",
|
|
2121
2134
|
key: id
|
|
2122
2135
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -2128,8 +2141,8 @@ const UserMenu = ({
|
|
|
2128
2141
|
e.preventDefault();
|
|
2129
2142
|
},
|
|
2130
2143
|
style: {
|
|
2131
|
-
borderTop: "1px solid var(--t-border-color
|
|
2132
|
-
color: "var(--t-text-color
|
|
2144
|
+
borderTop: "1px solid var(--t-border-color)",
|
|
2145
|
+
color: "var(--t-text-color)",
|
|
2133
2146
|
display: "block",
|
|
2134
2147
|
lineHeight: "48px",
|
|
2135
2148
|
overflow: "hidden",
|
|
@@ -2140,7 +2153,7 @@ const UserMenu = ({
|
|
|
2140
2153
|
whiteSpace: "nowrap",
|
|
2141
2154
|
...fontFamily
|
|
2142
2155
|
}
|
|
2143
|
-
}, person.organization_name))))), /*#__PURE__*/React__default.createElement(ThemeProvider, null, hasConnectedPeople && /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement("form", {
|
|
2156
|
+
}, person.organization_name)))))), /*#__PURE__*/React__default.createElement(ThemeProvider, null, hasConnectedPeople && /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement("form", {
|
|
2144
2157
|
method: "POST",
|
|
2145
2158
|
action: logoutUrl
|
|
2146
2159
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
@@ -2170,11 +2183,11 @@ const UserMenu = ({
|
|
|
2170
2183
|
paddingVertical: 1.5,
|
|
2171
2184
|
spacing: 4
|
|
2172
2185
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
2173
|
-
color: "var(--t-text-color-
|
|
2186
|
+
color: "var(--t-text-color-secondary)",
|
|
2174
2187
|
lineHeight: "24px"
|
|
2175
2188
|
}, "Log out"), /*#__PURE__*/React__default.createElement(Icon, {
|
|
2176
2189
|
name: "general.intoBox",
|
|
2177
|
-
fill: "var(--t-icon-color-
|
|
2190
|
+
fill: "var(--t-icon-color-secondary)"
|
|
2178
2191
|
})))))));
|
|
2179
2192
|
};
|
|
2180
2193
|
|
|
@@ -2185,15 +2198,17 @@ const Hoverable = ({
|
|
|
2185
2198
|
style = null,
|
|
2186
2199
|
...nativeProps
|
|
2187
2200
|
}) => {
|
|
2188
|
-
return /*#__PURE__*/React__default.createElement(C,
|
|
2201
|
+
return /*#__PURE__*/React__default.createElement(C, {
|
|
2189
2202
|
className: className,
|
|
2190
2203
|
style: {
|
|
2191
2204
|
...fontFamily,
|
|
2192
2205
|
...style
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2206
|
+
},
|
|
2207
|
+
...(innerRef && {
|
|
2208
|
+
ref: innerRef
|
|
2209
|
+
}),
|
|
2210
|
+
...nativeProps
|
|
2211
|
+
});
|
|
2197
2212
|
};
|
|
2198
2213
|
|
|
2199
2214
|
const UserMenuTrigger = ({
|
|
@@ -2221,9 +2236,9 @@ const UserMenuTrigger = ({
|
|
|
2221
2236
|
setUserMenuVisible(visible => !visible);
|
|
2222
2237
|
requestConnectedPeopleFetch();
|
|
2223
2238
|
}
|
|
2224
|
-
}, showOrgName && /*#__PURE__*/React__default.createElement("span", {
|
|
2239
|
+
}, showOrgName && (/*#__PURE__*/React__default.createElement("span", {
|
|
2225
2240
|
className: styles$5["trigger-orgname"]
|
|
2226
|
-
}, orgName), /*#__PURE__*/React__default.createElement(DisclosureChevronIcon, null)));
|
|
2241
|
+
}, orgName)), /*#__PURE__*/React__default.createElement(DisclosureChevronIcon, null)));
|
|
2227
2242
|
};
|
|
2228
2243
|
|
|
2229
2244
|
const NotSmallTopbar = ({
|
|
@@ -2316,9 +2331,10 @@ const NotSmallRoute = ({
|
|
|
2316
2331
|
colors,
|
|
2317
2332
|
...nativeProps
|
|
2318
2333
|
}) => {
|
|
2319
|
-
return /*#__PURE__*/React__default.createElement("a",
|
|
2320
|
-
className: classnames(styles$6["route"], className, active && styles$6["is-active"])
|
|
2321
|
-
|
|
2334
|
+
return /*#__PURE__*/React__default.createElement("a", {
|
|
2335
|
+
className: classnames(styles$6["route"], className, active && styles$6["is-active"]),
|
|
2336
|
+
...nativeProps
|
|
2337
|
+
});
|
|
2322
2338
|
};
|
|
2323
2339
|
|
|
2324
2340
|
var styles$4 = {"avatar":"avatar-tW-wn"};
|
|
@@ -2330,19 +2346,17 @@ function Avatar({
|
|
|
2330
2346
|
...nativeProps
|
|
2331
2347
|
}) {
|
|
2332
2348
|
const url = incomingUrl || `${pcoUrl(env)("people")}/static/no_photo_thumbnail_gray.svg`;
|
|
2333
|
-
return /*#__PURE__*/React__default.createElement("div",
|
|
2349
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2334
2350
|
className: styles$4.avatar,
|
|
2335
2351
|
style: {
|
|
2336
2352
|
backgroundImage: `url(${url})`,
|
|
2337
2353
|
...style
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2354
|
+
},
|
|
2355
|
+
...nativeProps
|
|
2356
|
+
});
|
|
2340
2357
|
}
|
|
2341
2358
|
|
|
2342
2359
|
class ClientStorage extends React__default.Component {
|
|
2343
|
-
static defaultProps = {
|
|
2344
|
-
method: "localStorage"
|
|
2345
|
-
};
|
|
2346
2360
|
update(value) {
|
|
2347
2361
|
window[this.props.method].setItem(this.props.item, JSON.stringify(value));
|
|
2348
2362
|
return this.forceUpdate();
|
|
@@ -2351,6 +2365,9 @@ class ClientStorage extends React__default.Component {
|
|
|
2351
2365
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, this.props.render(JSON.parse(window[this.props.method].getItem(this.props.item)) || undefined, this.update.bind(this)));
|
|
2352
2366
|
}
|
|
2353
2367
|
}
|
|
2368
|
+
ClientStorage.defaultProps = {
|
|
2369
|
+
method: "localStorage"
|
|
2370
|
+
};
|
|
2354
2371
|
|
|
2355
2372
|
var styles$3 = {"appmenu-button":"appmenu-button-b0UvT","appmenu-layer":"appmenu-layer-0IQpN","appmenu-container":"appmenu-container-gackd","appmenu-scroll":"appmenu-scroll-mPSx0","appmenu-list":"appmenu-list-h7clX","appmenu-list-a":"appmenu-list-a-rGIQN","appmenu-list-a--top":"appmenu-list-a--top-RT-2F","appmenu-list-a--bottom":"appmenu-list-a--bottom-YDeBC","appmenu-close-button":"appmenu-close-button-vv9bV","current-route":"current-route-wpJgz","is-active":"is-active-wy8Bg","routes":"routes-Nmt1S","route":"route-kkknQ","profile-button":"profile-button-a2WO2"};
|
|
2356
2373
|
|
|
@@ -2370,16 +2387,16 @@ function AccountSettingsLink({
|
|
|
2370
2387
|
width: 24,
|
|
2371
2388
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2372
2389
|
}, /*#__PURE__*/React__default.createElement(Accounts$1, {
|
|
2373
|
-
color: "var(--t-icon-color-
|
|
2390
|
+
color: "var(--t-icon-color-secondary",
|
|
2374
2391
|
key: "key2"
|
|
2375
2392
|
})), /*#__PURE__*/React__default.createElement("span", null, "Account settings"));
|
|
2376
2393
|
}
|
|
2377
2394
|
|
|
2378
2395
|
const CloseMenuButton = ({
|
|
2379
|
-
color = "var(--t-icon-color-
|
|
2396
|
+
color = "var(--t-icon-color-dim)",
|
|
2380
2397
|
size = 24,
|
|
2381
2398
|
style = {}
|
|
2382
|
-
}) => /*#__PURE__*/React__default.createElement("button", {
|
|
2399
|
+
}) => (/*#__PURE__*/React__default.createElement("button", {
|
|
2383
2400
|
"aria-label": "Close menu",
|
|
2384
2401
|
type: "button",
|
|
2385
2402
|
className: styles$3["appmenu-close-button"],
|
|
@@ -2391,7 +2408,7 @@ const CloseMenuButton = ({
|
|
|
2391
2408
|
width: `${size}px`
|
|
2392
2409
|
},
|
|
2393
2410
|
"aria-hidden": "true"
|
|
2394
|
-
}));
|
|
2411
|
+
})));
|
|
2395
2412
|
|
|
2396
2413
|
const UserMenuAppLockup = ({
|
|
2397
2414
|
appName: originalAppName
|
|
@@ -2415,10 +2432,13 @@ const UserMenuAppLockup = ({
|
|
|
2415
2432
|
}));
|
|
2416
2433
|
};
|
|
2417
2434
|
const SmallTopbar = ({
|
|
2418
|
-
currentRouteComponent = props => /*#__PURE__*/React__default.createElement("span",
|
|
2435
|
+
currentRouteComponent = props => (/*#__PURE__*/React__default.createElement("span", {
|
|
2436
|
+
...props
|
|
2437
|
+
})),
|
|
2419
2438
|
linkToProfile = true,
|
|
2420
2439
|
...props
|
|
2421
2440
|
}) => {
|
|
2441
|
+
var _a, _b;
|
|
2422
2442
|
const [routesMenuVisible, setRoutesMenuVisible] = React__default.useState(false);
|
|
2423
2443
|
const [productSwitcherVisible, setProductSwitcherVisible] = React__default.useState(false);
|
|
2424
2444
|
const activeRoute = props.routes.filter(({
|
|
@@ -2443,7 +2463,7 @@ const SmallTopbar = ({
|
|
|
2443
2463
|
}) => name !== "Home" && name !== "Accounts");
|
|
2444
2464
|
React__default.useEffect(() => {
|
|
2445
2465
|
setRoutesMenuVisible(false);
|
|
2446
|
-
}, [activeRoute && activeRoute[0]
|
|
2466
|
+
}, [activeRoute && ((_b = (_a = activeRoute[0]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.href)]);
|
|
2447
2467
|
return /*#__PURE__*/React__default.createElement(StyledRoot, {
|
|
2448
2468
|
style: {
|
|
2449
2469
|
...props.style
|
|
@@ -2459,11 +2479,11 @@ const SmallTopbar = ({
|
|
|
2459
2479
|
}
|
|
2460
2480
|
}, /*#__PURE__*/React__default.createElement(ColorAppIcon, {
|
|
2461
2481
|
appName: props.appName.replace(/[\s-]/, "")
|
|
2462
|
-
})), routesMenuVisible && /*#__PURE__*/React__default.createElement("div", {
|
|
2482
|
+
})), routesMenuVisible && (/*#__PURE__*/React__default.createElement("div", {
|
|
2463
2483
|
className: styles$3["routes"]
|
|
2464
|
-
}, props.routes), /*#__PURE__*/React__default.createElement(ClientStorage, {
|
|
2484
|
+
}, props.routes)), /*#__PURE__*/React__default.createElement(ClientStorage, {
|
|
2465
2485
|
item: "Topbar:Small:Menus:Products:visibility",
|
|
2466
|
-
render: () => /*#__PURE__*/React__default.createElement("div", {
|
|
2486
|
+
render: () => (/*#__PURE__*/React__default.createElement("div", {
|
|
2467
2487
|
className: styles$3["appmenu-layer"],
|
|
2468
2488
|
style: {
|
|
2469
2489
|
...(productSwitcherVisible && {
|
|
@@ -2484,10 +2504,10 @@ const SmallTopbar = ({
|
|
|
2484
2504
|
},
|
|
2485
2505
|
className: styles$3["appmenu-container"]
|
|
2486
2506
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
2487
|
-
"data-pendo": `app-switcher--change-app--${homeProduct
|
|
2507
|
+
"data-pendo": `app-switcher--change-app--${homeProduct === null || homeProduct === void 0 ? void 0 : homeProduct.name}`,
|
|
2488
2508
|
"data-turbolinks": false,
|
|
2489
2509
|
className: classnames(styles$3["appmenu-list-a"], styles$3["appmenu-list-a--top"]),
|
|
2490
|
-
href: homeProduct ? pcoUrl(props.env)("accounts") + getAppsSwitchProductPath(homeProduct
|
|
2510
|
+
href: homeProduct ? pcoUrl(props.env)("accounts") + getAppsSwitchProductPath(homeProduct === null || homeProduct === void 0 ? void 0 : homeProduct.name) : undefined
|
|
2491
2511
|
}, /*#__PURE__*/React__default.createElement(UserMenuAppLockup, {
|
|
2492
2512
|
appName: homeProduct ? homeProduct.name : props.appName
|
|
2493
2513
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -2497,7 +2517,7 @@ const SmallTopbar = ({
|
|
|
2497
2517
|
className: styles$3["appmenu-list"]
|
|
2498
2518
|
}, appsMenuFormatter(restProducts).map(({
|
|
2499
2519
|
name
|
|
2500
|
-
}) => /*#__PURE__*/React__default.createElement("li", {
|
|
2520
|
+
}) => (/*#__PURE__*/React__default.createElement("li", {
|
|
2501
2521
|
key: name,
|
|
2502
2522
|
className: styles$3["appmenu-list-li"]
|
|
2503
2523
|
}, /*#__PURE__*/React__default.createElement("a", {
|
|
@@ -2507,11 +2527,11 @@ const SmallTopbar = ({
|
|
|
2507
2527
|
href: pcoUrl(props.env)("accounts") + getAppsSwitchProductPath(name)
|
|
2508
2528
|
}, /*#__PURE__*/React__default.createElement(UserMenuAppLockup, {
|
|
2509
2529
|
appName: name
|
|
2510
|
-
})))), accountsProduct && /*#__PURE__*/React__default.createElement("li", {
|
|
2530
|
+
}))))), accountsProduct && (/*#__PURE__*/React__default.createElement("li", {
|
|
2511
2531
|
className: styles$3["appmenu-list-li"]
|
|
2512
2532
|
}, /*#__PURE__*/React__default.createElement(AccountSettingsLink, {
|
|
2513
2533
|
env: props.env
|
|
2514
|
-
}))))))
|
|
2534
|
+
}))))))))
|
|
2515
2535
|
}), /*#__PURE__*/React__default.createElement("button", {
|
|
2516
2536
|
type: "button",
|
|
2517
2537
|
className: classnames(styles$3["current-route"], {
|
|
@@ -2524,7 +2544,10 @@ const SmallTopbar = ({
|
|
|
2524
2544
|
}, /*#__PURE__*/React__default.createElement(CurrentRouteComponent, null, capitalize(currentRouteText)), props.routes.length > 0 && /*#__PURE__*/React__default.createElement(DisclosureChevronIcon, null)), /*#__PURE__*/React__default.createElement("button", {
|
|
2525
2545
|
type: "button",
|
|
2526
2546
|
className: styles$3["profile-button"],
|
|
2527
|
-
onClick: () =>
|
|
2547
|
+
onClick: () => {
|
|
2548
|
+
var _a, _b;
|
|
2549
|
+
return (_b = (_a = window.topbar) === null || _a === void 0 ? void 0 : _a.openProfile) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
2550
|
+
}
|
|
2528
2551
|
}, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
2529
2552
|
env: props.env,
|
|
2530
2553
|
url: props.userAvatarPath
|
|
@@ -2534,17 +2557,19 @@ const SmallRoute = ({
|
|
|
2534
2557
|
active,
|
|
2535
2558
|
className,
|
|
2536
2559
|
...props
|
|
2537
|
-
}) => /*#__PURE__*/React__default.createElement("a",
|
|
2538
|
-
className: classnames(styles$3["route"], className, active && styles$3["is-active"])
|
|
2539
|
-
|
|
2560
|
+
}) => (/*#__PURE__*/React__default.createElement("a", {
|
|
2561
|
+
className: classnames(styles$3["route"], className, active && styles$3["is-active"]),
|
|
2562
|
+
...props
|
|
2563
|
+
}));
|
|
2540
2564
|
|
|
2541
2565
|
function getLoginProfilePath({
|
|
2542
2566
|
env,
|
|
2543
2567
|
appName,
|
|
2544
2568
|
userId
|
|
2545
2569
|
}) {
|
|
2570
|
+
var _a, _b;
|
|
2546
2571
|
const basePath = pcoUrl(env)("login") + `/people/AC${userId}`;
|
|
2547
|
-
const pathname = window
|
|
2572
|
+
const pathname = (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.pathname) === null || _b === void 0 ? void 0 : _b.toString();
|
|
2548
2573
|
if (!pathname) return basePath;
|
|
2549
2574
|
const params = new URLSearchParams();
|
|
2550
2575
|
params.append("return", `${appName}/${pathname}`);
|
|
@@ -2649,7 +2674,7 @@ const topbarTheme = {
|
|
|
2649
2674
|
baseColor: "#2266f7",
|
|
2650
2675
|
key: "primary"
|
|
2651
2676
|
}),
|
|
2652
|
-
separatorTertiary: "var(--t-border-color
|
|
2677
|
+
separatorTertiary: "var(--t-border-color)"
|
|
2653
2678
|
},
|
|
2654
2679
|
icons: {
|
|
2655
2680
|
churchCenter,
|
|
@@ -2677,9 +2702,10 @@ function DrawerWrap({
|
|
|
2677
2702
|
className,
|
|
2678
2703
|
...props
|
|
2679
2704
|
}) {
|
|
2680
|
-
return /*#__PURE__*/React__default.createElement("div",
|
|
2681
|
-
className: classnames(styles$2["drawer-wrap"], className, isVisible && styles$2["is-visible"])
|
|
2682
|
-
|
|
2705
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2706
|
+
className: classnames(styles$2["drawer-wrap"], className, isVisible && styles$2["is-visible"]),
|
|
2707
|
+
...props
|
|
2708
|
+
}, children);
|
|
2683
2709
|
}
|
|
2684
2710
|
|
|
2685
2711
|
function DrawerHeader({
|
|
@@ -2695,9 +2721,9 @@ function DrawerHeader({
|
|
|
2695
2721
|
paddingTop: 1
|
|
2696
2722
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
2697
2723
|
flex: 1
|
|
2698
|
-
}, children), closeDrawer && /*#__PURE__*/React__default.createElement(Button, {
|
|
2724
|
+
}, children), closeDrawer && (/*#__PURE__*/React__default.createElement(Button, {
|
|
2699
2725
|
icon: {
|
|
2700
|
-
fill: "var(--t-icon-color-
|
|
2726
|
+
fill: "var(--t-icon-color-dim)",
|
|
2701
2727
|
name: "general.x",
|
|
2702
2728
|
size: "md"
|
|
2703
2729
|
},
|
|
@@ -2708,25 +2734,25 @@ function DrawerHeader({
|
|
|
2708
2734
|
backgroundColor: "var(--t-fill-color-neutral-070)"
|
|
2709
2735
|
},
|
|
2710
2736
|
marginTop: 0.25
|
|
2711
|
-
}));
|
|
2737
|
+
})));
|
|
2712
2738
|
}
|
|
2713
2739
|
|
|
2714
2740
|
function DrawerHeading({
|
|
2715
2741
|
children,
|
|
2716
2742
|
...props
|
|
2717
2743
|
}) {
|
|
2718
|
-
return /*#__PURE__*/React__default.createElement(Heading,
|
|
2719
|
-
color: "var(--t-text-color-
|
|
2744
|
+
return /*#__PURE__*/React__default.createElement(Heading, {
|
|
2745
|
+
color: "var(--t-text-color-headline)",
|
|
2720
2746
|
letterSpacing: ".002em",
|
|
2721
2747
|
level: 2,
|
|
2722
2748
|
lineHeight: "35px",
|
|
2723
|
-
weight: 700
|
|
2724
|
-
|
|
2749
|
+
weight: 700,
|
|
2750
|
+
...props
|
|
2751
|
+
}, children);
|
|
2725
2752
|
}
|
|
2726
2753
|
|
|
2727
2754
|
// TODO: This component could prob be genrealized to provide overflow-y scroll indication, as well, if needed.
|
|
2728
2755
|
// `top`/`bottom` // `left`/`right` → `start`/`end`
|
|
2729
|
-
|
|
2730
2756
|
const INDICATOR_STYLES = {
|
|
2731
2757
|
bottom: {
|
|
2732
2758
|
background: "linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.07))",
|
|
@@ -2747,22 +2773,20 @@ const ScrollContainer = ({
|
|
|
2747
2773
|
const containerRef = useRef(null);
|
|
2748
2774
|
const bottomEdgeRef = useRef(null);
|
|
2749
2775
|
const topEdgeRef = useRef(null);
|
|
2750
|
-
|
|
2751
2776
|
// Perf: should this be debounced?
|
|
2752
2777
|
const handleResize = () => {
|
|
2753
|
-
const container = containerRef
|
|
2778
|
+
const container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
2754
2779
|
if (container) {
|
|
2755
2780
|
const hasOverflowBottom = container.scrollHeight - container.clientHeight > container.scrollTop + 1;
|
|
2756
2781
|
setOverflowBottom(hasOverflowBottom);
|
|
2757
2782
|
}
|
|
2758
2783
|
};
|
|
2759
2784
|
useEffect(() => {
|
|
2760
|
-
const container = containerRef
|
|
2785
|
+
const container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
2761
2786
|
if (!container) {
|
|
2762
2787
|
return () => {}; // noop
|
|
2763
2788
|
}
|
|
2764
2789
|
setOverflowBottom(container.scrollHeight > container.clientHeight);
|
|
2765
|
-
|
|
2766
2790
|
// setup intersection observers
|
|
2767
2791
|
const options = {
|
|
2768
2792
|
root: container,
|
|
@@ -2774,15 +2798,14 @@ const ScrollContainer = ({
|
|
|
2774
2798
|
const topObserver = new IntersectionObserver(([{
|
|
2775
2799
|
isIntersecting
|
|
2776
2800
|
}]) => setOverflowTop(!isIntersecting), options);
|
|
2777
|
-
const bottomTarget = bottomEdgeRef
|
|
2778
|
-
const topTarget = topEdgeRef
|
|
2801
|
+
const bottomTarget = bottomEdgeRef === null || bottomEdgeRef === void 0 ? void 0 : bottomEdgeRef.current;
|
|
2802
|
+
const topTarget = topEdgeRef === null || topEdgeRef === void 0 ? void 0 : topEdgeRef.current;
|
|
2779
2803
|
if (bottomTarget) {
|
|
2780
2804
|
bottomObserver.observe(bottomTarget);
|
|
2781
2805
|
}
|
|
2782
2806
|
if (topTarget) {
|
|
2783
2807
|
topObserver.observe(topTarget);
|
|
2784
2808
|
}
|
|
2785
|
-
|
|
2786
2809
|
// setup resize observer
|
|
2787
2810
|
const resizeObserver = new ResizeObserver(handleResize);
|
|
2788
2811
|
resizeObserver.observe(container);
|
|
@@ -2804,7 +2827,7 @@ const ScrollContainer = ({
|
|
|
2804
2827
|
edge: "top"
|
|
2805
2828
|
}), overflowBottom && /*#__PURE__*/React__default.createElement(OverflowIndicator, {
|
|
2806
2829
|
edge: "bottom"
|
|
2807
|
-
}), /*#__PURE__*/React__default.createElement(StackView$2,
|
|
2830
|
+
}), /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
2808
2831
|
basis: 2,
|
|
2809
2832
|
grow: 1,
|
|
2810
2833
|
innerRef: containerRef,
|
|
@@ -2813,8 +2836,9 @@ const ScrollContainer = ({
|
|
|
2813
2836
|
shrink: 1,
|
|
2814
2837
|
css: {
|
|
2815
2838
|
overscrollBehavior: "contain"
|
|
2816
|
-
}
|
|
2817
|
-
|
|
2839
|
+
},
|
|
2840
|
+
...props
|
|
2841
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
2818
2842
|
innerRef: topEdgeRef
|
|
2819
2843
|
}), children, /*#__PURE__*/React__default.createElement(Box, {
|
|
2820
2844
|
innerRef: bottomEdgeRef
|
|
@@ -2823,15 +2847,16 @@ const ScrollContainer = ({
|
|
|
2823
2847
|
const OverflowIndicator = ({
|
|
2824
2848
|
edge
|
|
2825
2849
|
}) => {
|
|
2826
|
-
return /*#__PURE__*/React__default.createElement(Box,
|
|
2850
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
2827
2851
|
height: 1,
|
|
2828
2852
|
left: 0,
|
|
2829
2853
|
pointerEvents: "none",
|
|
2830
2854
|
position: "absolute",
|
|
2831
2855
|
right: 0,
|
|
2832
2856
|
role: "presentation",
|
|
2833
|
-
zIndex: 10
|
|
2834
|
-
|
|
2857
|
+
zIndex: 10,
|
|
2858
|
+
...INDICATOR_STYLES[edge]
|
|
2859
|
+
});
|
|
2835
2860
|
};
|
|
2836
2861
|
|
|
2837
2862
|
const SwitchView = ({
|
|
@@ -2862,7 +2887,7 @@ const SwitchView = ({
|
|
|
2862
2887
|
}));
|
|
2863
2888
|
};
|
|
2864
2889
|
|
|
2865
|
-
var styles$1 = {"color-mode-switcher":"color-mode-switcher-JpczO","color-mode-switcher-label":"color-mode-switcher-label-3jPM2","color-mode-switcher-
|
|
2890
|
+
var styles$1 = {"color-mode-switcher":"color-mode-switcher-JpczO","color-mode-switcher-label":"color-mode-switcher-label-3jPM2","color-mode-switcher-modes":"color-mode-switcher-modes-u-bic"};
|
|
2866
2891
|
|
|
2867
2892
|
const COLOR_MODES = [{
|
|
2868
2893
|
label: "Light",
|
|
@@ -2877,8 +2902,7 @@ const COLOR_MODES = [{
|
|
|
2877
2902
|
let COLOR_MODE_INSTANCE_COUNTER = 0;
|
|
2878
2903
|
function ColorModeSwitcher() {
|
|
2879
2904
|
const {
|
|
2880
|
-
colorMode
|
|
2881
|
-
colorModeLaunched
|
|
2905
|
+
colorMode
|
|
2882
2906
|
} = useStore();
|
|
2883
2907
|
const updateStore = useUpdateStore();
|
|
2884
2908
|
const [counter] = useState(() => COLOR_MODE_INSTANCE_COUNTER++);
|
|
@@ -2886,14 +2910,12 @@ function ColorModeSwitcher() {
|
|
|
2886
2910
|
className: styles$1["color-mode-switcher"]
|
|
2887
2911
|
}, /*#__PURE__*/React__default.createElement("legend", {
|
|
2888
2912
|
className: styles$1["color-mode-switcher-label"]
|
|
2889
|
-
}, "Appearance", " ",
|
|
2890
|
-
className: styles$1["color-mode-switcher-label-beta"]
|
|
2891
|
-
}, "beta")), /*#__PURE__*/React__default.createElement("div", {
|
|
2913
|
+
}, "Appearance", " "), /*#__PURE__*/React__default.createElement("div", {
|
|
2892
2914
|
className: styles$1["color-mode-switcher-modes"]
|
|
2893
2915
|
}, COLOR_MODES.map(({
|
|
2894
2916
|
value,
|
|
2895
2917
|
label
|
|
2896
|
-
}) => /*#__PURE__*/React__default.createElement("label", {
|
|
2918
|
+
}) => (/*#__PURE__*/React__default.createElement("label", {
|
|
2897
2919
|
key: value
|
|
2898
2920
|
}, /*#__PURE__*/React__default.createElement("input", {
|
|
2899
2921
|
name: `color-mode-${counter}`,
|
|
@@ -2910,7 +2932,7 @@ function ColorModeSwitcher() {
|
|
|
2910
2932
|
}
|
|
2911
2933
|
}), /*#__PURE__*/React__default.createElement(ColorModeIcon, {
|
|
2912
2934
|
mode: value
|
|
2913
|
-
}), label))));
|
|
2935
|
+
}), label)))));
|
|
2914
2936
|
}
|
|
2915
2937
|
function updateColorMode(mode) {
|
|
2916
2938
|
return apiRequest(railsCsrfFetch, `${window.location.origin}/~api/people/v2/me/color_mode`, {
|
|
@@ -2964,8 +2986,7 @@ function UserProfile({
|
|
|
2964
2986
|
}) {
|
|
2965
2987
|
const {
|
|
2966
2988
|
mfaConfigured,
|
|
2967
|
-
name
|
|
2968
|
-
colorModeSelectionEnabled
|
|
2989
|
+
name
|
|
2969
2990
|
} = useStore();
|
|
2970
2991
|
return /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
2971
2992
|
axis: "vertical",
|
|
@@ -2989,17 +3010,17 @@ function UserProfile({
|
|
|
2989
3010
|
}, /*#__PURE__*/React__default.createElement(DrawerHeading, {
|
|
2990
3011
|
paddingTop: 0.5,
|
|
2991
3012
|
lineHeight: 3.25
|
|
2992
|
-
}, name), linkToProfile && /*#__PURE__*/React__default.createElement(Link$1, {
|
|
3013
|
+
}, name), linkToProfile && (/*#__PURE__*/React__default.createElement(Link$1, {
|
|
2993
3014
|
to: profileUrl,
|
|
2994
3015
|
style: {
|
|
2995
|
-
color: "var(--t-icon-color-
|
|
3016
|
+
color: "var(--t-icon-color-secondary)"
|
|
2996
3017
|
},
|
|
2997
3018
|
size: 3,
|
|
2998
3019
|
onClick: () => setTimeout(() => closeDrawer(), 50)
|
|
2999
|
-
}, "My profile"), /*#__PURE__*/React__default.createElement(Link$1, {
|
|
3020
|
+
}, "My profile")), /*#__PURE__*/React__default.createElement(Link$1, {
|
|
3000
3021
|
to: loginSettingsUrl,
|
|
3001
3022
|
style: {
|
|
3002
|
-
color: "var(--t-icon-color-
|
|
3023
|
+
color: "var(--t-icon-color-secondary)"
|
|
3003
3024
|
},
|
|
3004
3025
|
size: 3
|
|
3005
3026
|
}, "My login settings"), /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
@@ -3010,15 +3031,15 @@ function UserProfile({
|
|
|
3010
3031
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
3011
3032
|
name: mfaConfigured ? "general.lock" : "general.unlock",
|
|
3012
3033
|
size: "sm",
|
|
3013
|
-
color: mfaConfigured ? "var(--t-icon-color-status-success
|
|
3034
|
+
color: mfaConfigured ? "var(--t-icon-color-status-success)" : "var(--t-icon-color-status-error)"
|
|
3014
3035
|
}), /*#__PURE__*/React__default.createElement(Text, {
|
|
3015
3036
|
size: 4,
|
|
3016
3037
|
weight: 400,
|
|
3017
|
-
color: "var(--t-text-color-
|
|
3038
|
+
color: "var(--t-text-color-secondary)",
|
|
3018
3039
|
wrap: true
|
|
3019
3040
|
}, "Two-step verification ", mfaConfigured ? "active" : "inactive"))), /*#__PURE__*/React__default.createElement(Button, {
|
|
3020
3041
|
icon: {
|
|
3021
|
-
fill: "var(--t-icon-color-
|
|
3042
|
+
fill: "var(--t-icon-color-dim)",
|
|
3022
3043
|
name: "general.x",
|
|
3023
3044
|
size: "md"
|
|
3024
3045
|
},
|
|
@@ -3030,7 +3051,7 @@ function UserProfile({
|
|
|
3030
3051
|
hover: {
|
|
3031
3052
|
backgroundColor: "var(--t-fill-color-neutral-070)"
|
|
3032
3053
|
}
|
|
3033
|
-
})),
|
|
3054
|
+
})), /*#__PURE__*/React__default.createElement(GridView, {
|
|
3034
3055
|
padding: 2
|
|
3035
3056
|
}, /*#__PURE__*/React__default.createElement(ColorModeSwitcher, null)), /*#__PURE__*/React__default.createElement("form", {
|
|
3036
3057
|
method: "POST",
|
|
@@ -3060,8 +3081,8 @@ function UserProfile({
|
|
|
3060
3081
|
size: 3
|
|
3061
3082
|
}, "Log out"), /*#__PURE__*/React__default.createElement(Icon, {
|
|
3062
3083
|
name: "general.intoBox",
|
|
3063
|
-
fill: "var(--t-icon-color-
|
|
3064
|
-
})))), hasConnectedPeople && /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3084
|
+
fill: "var(--t-icon-color-secondary)"
|
|
3085
|
+
})))), hasConnectedPeople && (/*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3065
3086
|
mediaQueries: {
|
|
3066
3087
|
sm: {
|
|
3067
3088
|
display: "none"
|
|
@@ -3082,7 +3103,7 @@ function UserProfile({
|
|
|
3082
3103
|
}, connectedPeopleMenuFormatter(connectedPeople).map(({
|
|
3083
3104
|
id,
|
|
3084
3105
|
attributes: person
|
|
3085
|
-
}) => /*#__PURE__*/React__default.createElement(List.Item, {
|
|
3106
|
+
}) => (/*#__PURE__*/React__default.createElement(List.Item, {
|
|
3086
3107
|
key: id,
|
|
3087
3108
|
onClick: e => {
|
|
3088
3109
|
requestClearAppsCache();
|
|
@@ -3094,7 +3115,7 @@ function UserProfile({
|
|
|
3094
3115
|
padding: 2
|
|
3095
3116
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
3096
3117
|
truncate: true
|
|
3097
|
-
}, person.organization_name))), /*#__PURE__*/React__default.createElement(List.Item, {
|
|
3118
|
+
}, person.organization_name)))), /*#__PURE__*/React__default.createElement(List.Item, {
|
|
3098
3119
|
onClick: e => {
|
|
3099
3120
|
requestClearAppsCache();
|
|
3100
3121
|
requestClearConnectedPeopleCache();
|
|
@@ -3106,16 +3127,16 @@ function UserProfile({
|
|
|
3106
3127
|
underline: false
|
|
3107
3128
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
3108
3129
|
size: 3
|
|
3109
|
-
}, "Unlink my accounts")))));
|
|
3130
|
+
}, "Unlink my accounts"))))));
|
|
3110
3131
|
}
|
|
3111
3132
|
|
|
3112
|
-
var ActionType
|
|
3133
|
+
var ActionType;
|
|
3134
|
+
(function (ActionType) {
|
|
3113
3135
|
ActionType["close"] = "close";
|
|
3114
3136
|
ActionType["mount"] = "mount";
|
|
3115
3137
|
ActionType["open"] = "open";
|
|
3116
3138
|
ActionType["unmount"] = "unmount";
|
|
3117
|
-
|
|
3118
|
-
}(ActionType || {});
|
|
3139
|
+
})(ActionType || (ActionType = {}));
|
|
3119
3140
|
const initialState = {
|
|
3120
3141
|
currentContent: null,
|
|
3121
3142
|
open: false
|
|
@@ -3213,7 +3234,7 @@ const CustomSearchBox = ({
|
|
|
3213
3234
|
hits,
|
|
3214
3235
|
results
|
|
3215
3236
|
} = useHits();
|
|
3216
|
-
const groups = results
|
|
3237
|
+
const groups = results === null || results === void 0 ? void 0 : results.hits.reduce((acc, hit) => {
|
|
3217
3238
|
const key = hit.category.title;
|
|
3218
3239
|
if (!acc[key]) {
|
|
3219
3240
|
acc[key] = [];
|
|
@@ -3238,7 +3259,7 @@ const CustomSearchBox = ({
|
|
|
3238
3259
|
onChange: e => setQuery(e.target.value),
|
|
3239
3260
|
onSelect: selectedValue => handleSearchSelect(selectedValue, indexName),
|
|
3240
3261
|
placement: "bottom-start"
|
|
3241
|
-
}, !hits.length && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3262
|
+
}, !hits.length && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3242
3263
|
axis: "horizontal",
|
|
3243
3264
|
alignment: "center",
|
|
3244
3265
|
paddingHorizontal: 2,
|
|
@@ -3247,7 +3268,7 @@ const CustomSearchBox = ({
|
|
|
3247
3268
|
color: "neutralDarker",
|
|
3248
3269
|
size: 4,
|
|
3249
3270
|
whiteSpace: "normal"
|
|
3250
|
-
}, "No results match your search"))), groups && Object.keys(groups).map(key => {
|
|
3271
|
+
}, "No results match your search")))), groups && Object.keys(groups).map(key => {
|
|
3251
3272
|
const hits = groups[key];
|
|
3252
3273
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
3253
3274
|
key: key
|
|
@@ -3266,11 +3287,11 @@ const CustomSearchBox = ({
|
|
|
3266
3287
|
size: 5,
|
|
3267
3288
|
color: "foregroundSecondary",
|
|
3268
3289
|
fontWeight: 500
|
|
3269
|
-
}, key)), hits.map(hit => /*#__PURE__*/React__default.createElement(HitResult, {
|
|
3290
|
+
}, key)), hits.map(hit => (/*#__PURE__*/React__default.createElement(HitResult, {
|
|
3270
3291
|
key: hit.objectID,
|
|
3271
3292
|
hit: hit,
|
|
3272
3293
|
index: resultIndex++
|
|
3273
|
-
})));
|
|
3294
|
+
}))));
|
|
3274
3295
|
})));
|
|
3275
3296
|
};
|
|
3276
3297
|
|
|
@@ -3349,15 +3370,16 @@ const Eyebrow = ({
|
|
|
3349
3370
|
dark,
|
|
3350
3371
|
style,
|
|
3351
3372
|
...props
|
|
3352
|
-
}) => /*#__PURE__*/React__default.createElement("div",
|
|
3373
|
+
}) => (/*#__PURE__*/React__default.createElement("div", {
|
|
3353
3374
|
style: {
|
|
3354
|
-
color: "var(--t-text-color
|
|
3375
|
+
color: "var(--t-text-color)",
|
|
3355
3376
|
fontSize: "12px",
|
|
3356
3377
|
fontWeight: 400,
|
|
3357
3378
|
textTransform: "uppercase",
|
|
3358
3379
|
...style
|
|
3359
|
-
}
|
|
3360
|
-
|
|
3380
|
+
},
|
|
3381
|
+
...props
|
|
3382
|
+
}));
|
|
3361
3383
|
|
|
3362
3384
|
const NotificationItem = ({
|
|
3363
3385
|
mobile = false,
|
|
@@ -3407,7 +3429,7 @@ const NotificationItem = ({
|
|
|
3407
3429
|
onClick: handleClick,
|
|
3408
3430
|
style: {
|
|
3409
3431
|
alignItems: "flex-start",
|
|
3410
|
-
borderBottom: showBottomBorder || !isLast ? "1px solid var(--t-border-color
|
|
3432
|
+
borderBottom: showBottomBorder || !isLast ? "1px solid var(--t-border-color)" : "none",
|
|
3411
3433
|
cursor: "pointer",
|
|
3412
3434
|
display: "flex",
|
|
3413
3435
|
overflow: "hidden",
|
|
@@ -3444,14 +3466,14 @@ const NotificationItem = ({
|
|
|
3444
3466
|
}
|
|
3445
3467
|
}, appName), /*#__PURE__*/React__default.createElement("h1", {
|
|
3446
3468
|
style: {
|
|
3447
|
-
color: "var(--t-text-color-
|
|
3469
|
+
color: "var(--t-text-color-headline)",
|
|
3448
3470
|
fontSize: "16px",
|
|
3449
3471
|
fontWeight: 500,
|
|
3450
3472
|
lineHeight: "1.3em",
|
|
3451
3473
|
margin: 0,
|
|
3452
3474
|
userSelect: "none"
|
|
3453
3475
|
}
|
|
3454
|
-
}, title)), !mobile && /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
3476
|
+
}, title)), !mobile && (/*#__PURE__*/React__default.createElement(Dropdown, {
|
|
3455
3477
|
icon: {
|
|
3456
3478
|
name: "general.threeDots"
|
|
3457
3479
|
},
|
|
@@ -3468,21 +3490,21 @@ const NotificationItem = ({
|
|
|
3468
3490
|
e.stopPropagation();
|
|
3469
3491
|
onToggleRead();
|
|
3470
3492
|
}
|
|
3471
|
-
}, "Mark ", isRead ? "unread" : "as read"), notification.taskUrl ? /*#__PURE__*/React__default.createElement(Dropdown.Item, {
|
|
3493
|
+
}, "Mark ", isRead ? "unread" : "as read"), notification.taskUrl ? (/*#__PURE__*/React__default.createElement(Dropdown.Item, {
|
|
3472
3494
|
onClick: e => {
|
|
3473
3495
|
e.preventDefault();
|
|
3474
3496
|
e.stopPropagation();
|
|
3475
3497
|
window.location.href = notification.taskUrl;
|
|
3476
3498
|
}
|
|
3477
|
-
}, "Open task") : /*#__PURE__*/React__default.createElement(Dropdown.Item, {
|
|
3499
|
+
}, "Open task")) : (/*#__PURE__*/React__default.createElement(Dropdown.Item, {
|
|
3478
3500
|
onClick: e => {
|
|
3479
3501
|
e.preventDefault();
|
|
3480
3502
|
e.stopPropagation();
|
|
3481
3503
|
onCreateTask(notification);
|
|
3482
3504
|
}
|
|
3483
|
-
}, "Create task"))), /*#__PURE__*/React__default.createElement("div", {
|
|
3505
|
+
}, "Create task"))))), /*#__PURE__*/React__default.createElement("div", {
|
|
3484
3506
|
style: {
|
|
3485
|
-
color: "var(--t-text-color
|
|
3507
|
+
color: "var(--t-text-color)",
|
|
3486
3508
|
fontSize: "12px",
|
|
3487
3509
|
paddingLeft: "12px",
|
|
3488
3510
|
userSelect: "none"
|
|
@@ -3494,22 +3516,22 @@ const NotificationsMenuBlankState = ({
|
|
|
3494
3516
|
context,
|
|
3495
3517
|
description,
|
|
3496
3518
|
title = "No notifications"
|
|
3497
|
-
}) => /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3519
|
+
}) => (/*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3498
3520
|
alignment: "center",
|
|
3499
3521
|
distribution: "center",
|
|
3500
3522
|
padding: 4
|
|
3501
3523
|
}, /*#__PURE__*/React__default.createElement(BlankStateIcon, {
|
|
3502
3524
|
id: context
|
|
3503
3525
|
}), /*#__PURE__*/React__default.createElement(Heading, {
|
|
3504
|
-
color: "var(--t-text-color-
|
|
3526
|
+
color: "var(--t-text-color-headline)",
|
|
3505
3527
|
fontWeight: 500,
|
|
3506
3528
|
marginTop: 1,
|
|
3507
3529
|
size: 3
|
|
3508
3530
|
}, title), /*#__PURE__*/React__default.createElement(Text, {
|
|
3509
3531
|
align: "center",
|
|
3510
|
-
color: "var(--t-text-color
|
|
3532
|
+
color: "var(--t-text-color)",
|
|
3511
3533
|
size: 4
|
|
3512
|
-
}, description));
|
|
3534
|
+
}, description)));
|
|
3513
3535
|
|
|
3514
3536
|
const notificationsOrganizer = notifications => {
|
|
3515
3537
|
const {
|
|
@@ -3535,6 +3557,7 @@ const notificationsOrganizer = notifications => {
|
|
|
3535
3557
|
};
|
|
3536
3558
|
};
|
|
3537
3559
|
const buildNotificationFromApiResponse = (resp, json) => {
|
|
3560
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3538
3561
|
const findInIncluded = ({
|
|
3539
3562
|
type,
|
|
3540
3563
|
id
|
|
@@ -3543,24 +3566,23 @@ const buildNotificationFromApiResponse = (resp, json) => {
|
|
|
3543
3566
|
return i.type === type && i.id === id;
|
|
3544
3567
|
});
|
|
3545
3568
|
};
|
|
3546
|
-
const appName = findInIncluded(resp.relationships.app.data, json.included)
|
|
3547
|
-
|
|
3569
|
+
const appName = (_b = (_a = findInIncluded(resp.relationships.app.data, json.included)) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b.name;
|
|
3548
3570
|
// There is technically the possibility that there are multiple web payloads
|
|
3549
3571
|
// returned from the API endpoint. However, at this point I'm not sure in
|
|
3550
3572
|
// which situations that would be the case. For v1 of this feature, we'll
|
|
3551
3573
|
// assume that there is only one web payload we need to worry about and it is
|
|
3552
3574
|
// the first in the array that is returned.
|
|
3553
|
-
const notificationData = JSON.parse(findInIncluded({
|
|
3554
|
-
id: resp
|
|
3575
|
+
const notificationData = JSON.parse((_g = (_f = findInIncluded({
|
|
3576
|
+
id: (_e = (_d = (_c = resp === null || resp === void 0 ? void 0 : resp.relationships) === null || _c === void 0 ? void 0 : _c.web_payloads) === null || _d === void 0 ? void 0 : _d.data[0]) === null || _e === void 0 ? void 0 : _e.id,
|
|
3555
3577
|
type: "Payload"
|
|
3556
|
-
}, json.included)
|
|
3578
|
+
}, json.included)) === null || _f === void 0 ? void 0 : _f.attributes) === null || _g === void 0 ? void 0 : _g.content);
|
|
3557
3579
|
return {
|
|
3558
3580
|
appName,
|
|
3559
3581
|
createdAt: new Date(resp.attributes.created_at),
|
|
3560
3582
|
id: resp.id,
|
|
3561
|
-
isRead: resp.attributes.read_at
|
|
3562
|
-
link: notificationData
|
|
3563
|
-
title: notificationData
|
|
3583
|
+
isRead: ((_h = resp.attributes.read_at) === null || _h === void 0 ? void 0 : _h.length) > 0,
|
|
3584
|
+
link: notificationData === null || notificationData === void 0 ? void 0 : notificationData.link,
|
|
3585
|
+
title: notificationData === null || notificationData === void 0 ? void 0 : notificationData.title
|
|
3564
3586
|
};
|
|
3565
3587
|
};
|
|
3566
3588
|
const useNotifications = ({
|
|
@@ -3659,7 +3681,6 @@ const useNotifications = ({
|
|
|
3659
3681
|
}).then(e => {
|
|
3660
3682
|
if (!e.ok) {
|
|
3661
3683
|
// TODO: show an alert or something?
|
|
3662
|
-
|
|
3663
3684
|
setIsLoading(false);
|
|
3664
3685
|
setHasError(true);
|
|
3665
3686
|
// Rollback any optimistic UI updates
|
|
@@ -3692,7 +3713,6 @@ const useNotifications = ({
|
|
|
3692
3713
|
}, []);
|
|
3693
3714
|
const handleToggleRead = async notification => {
|
|
3694
3715
|
const action = notification.isRead ? "unread" : "read";
|
|
3695
|
-
|
|
3696
3716
|
// optimistic UI update
|
|
3697
3717
|
setNotifications(notifications => notifications.map(n => notification.id == n.id ? {
|
|
3698
3718
|
...n,
|
|
@@ -3705,7 +3725,6 @@ const useNotifications = ({
|
|
|
3705
3725
|
};
|
|
3706
3726
|
const handleMarkAllAsRead = () => {
|
|
3707
3727
|
const unreadIds = unread.map(n => n.id);
|
|
3708
|
-
|
|
3709
3728
|
// optimistic UI update
|
|
3710
3729
|
setNotifications(notifications => notifications.map(n => unreadIds.includes(n.id) ? {
|
|
3711
3730
|
...n,
|
|
@@ -3730,23 +3749,25 @@ const SectionHeaderButton = ({
|
|
|
3730
3749
|
onClick,
|
|
3731
3750
|
title,
|
|
3732
3751
|
...props
|
|
3733
|
-
}) => /*#__PURE__*/React__default.createElement(StackView$2,
|
|
3734
|
-
color: disabled ? "var(--t-text-color-
|
|
3752
|
+
}) => (/*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3753
|
+
color: disabled ? "var(--t-text-color-disabled)" : "var(--t-text-color-interaction)",
|
|
3735
3754
|
cursor: disabled ? "default" : "pointer",
|
|
3736
3755
|
fontSize: 5,
|
|
3737
3756
|
fontWeight: 600,
|
|
3738
3757
|
userSelect: "none",
|
|
3739
|
-
onClick: !disabled && onClick
|
|
3740
|
-
|
|
3758
|
+
onClick: !disabled && onClick,
|
|
3759
|
+
...props
|
|
3760
|
+
}, title));
|
|
3741
3761
|
const SectionHeaderTitle = ({
|
|
3742
3762
|
...props
|
|
3743
|
-
}) => /*#__PURE__*/React__default.createElement(Heading,
|
|
3744
|
-
color: "var(--t-text-color-
|
|
3763
|
+
}) => (/*#__PURE__*/React__default.createElement(Heading, {
|
|
3764
|
+
color: "var(--t-text-color-headline)",
|
|
3745
3765
|
lineHeight: 2,
|
|
3746
3766
|
size: 5,
|
|
3747
3767
|
textTransform: "uppercase",
|
|
3748
|
-
userSelect: "none"
|
|
3749
|
-
|
|
3768
|
+
userSelect: "none",
|
|
3769
|
+
...props
|
|
3770
|
+
}));
|
|
3750
3771
|
function NotificationsComponent({
|
|
3751
3772
|
closeDrawer
|
|
3752
3773
|
}) {
|
|
@@ -3790,17 +3811,17 @@ function NotificationsComponent({
|
|
|
3790
3811
|
alignment: "center",
|
|
3791
3812
|
axis: "horizontal",
|
|
3792
3813
|
spacing: 1
|
|
3793
|
-
}, /*#__PURE__*/React__default.createElement(DrawerHeading, null, "Notifications"), isLoading && /*#__PURE__*/React__default.createElement(Spinner, {
|
|
3814
|
+
}, /*#__PURE__*/React__default.createElement(DrawerHeading, null, "Notifications"), isLoading && (/*#__PURE__*/React__default.createElement(Spinner, {
|
|
3794
3815
|
color: "var(--t-fill-color-neutral-030)",
|
|
3795
3816
|
thickness: 2,
|
|
3796
3817
|
trackColor: "var(--t-fill-color-neutral-080)"
|
|
3797
|
-
}), hasError && /*#__PURE__*/React__default.createElement(ExclamationTriangle, {
|
|
3818
|
+
})), hasError && (/*#__PURE__*/React__default.createElement(ExclamationTriangle, {
|
|
3798
3819
|
fill: "hsl(8 60% 47%)",
|
|
3799
3820
|
size: 16
|
|
3800
|
-
})), read.length > 0 && /*#__PURE__*/React__default.createElement(SectionHeaderButton, {
|
|
3821
|
+
}))), read.length > 0 && (/*#__PURE__*/React__default.createElement(SectionHeaderButton, {
|
|
3801
3822
|
onClick: () => setShowRead(showRead => !showRead),
|
|
3802
3823
|
title: `${showRead ? "Hide" : "Show"} read`
|
|
3803
|
-
}))), /*#__PURE__*/React__default.createElement(ScrollContainer, null, /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3824
|
+
})))), /*#__PURE__*/React__default.createElement(ScrollContainer, null, /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3804
3825
|
alignment: "stretch",
|
|
3805
3826
|
spacing: 2
|
|
3806
3827
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3812,25 +3833,26 @@ function NotificationsComponent({
|
|
|
3812
3833
|
margin: 0,
|
|
3813
3834
|
padding: "4px 0"
|
|
3814
3835
|
}
|
|
3815
|
-
}, !isLoading && unread.length === 0 && /*#__PURE__*/React__default.createElement(NotificationsMenuBlankState,
|
|
3836
|
+
}, !isLoading && unread.length === 0 && (/*#__PURE__*/React__default.createElement(NotificationsMenuBlankState, {
|
|
3816
3837
|
context: "toolbar",
|
|
3817
|
-
description: `When you have ${read.length > 0 ? "unread " : ""}notifications they will show up here
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3838
|
+
description: `When you have ${read.length > 0 ? "unread " : ""}notifications they will show up here.`,
|
|
3839
|
+
...(read.length > 0 && {
|
|
3840
|
+
title: "No unread notifications"
|
|
3841
|
+
})
|
|
3842
|
+
})), unread.length > 0 && (/*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3821
3843
|
axis: "horizontal",
|
|
3822
3844
|
alignment: "center",
|
|
3823
3845
|
distribution: "space-between",
|
|
3824
3846
|
padding: 2
|
|
3825
|
-
}, /*#__PURE__*/React__default.createElement(SectionHeaderTitle, null, "Unread"), unread.length > 0 && /*#__PURE__*/React__default.createElement(SectionHeaderButton, {
|
|
3847
|
+
}, /*#__PURE__*/React__default.createElement(SectionHeaderTitle, null, "Unread"), unread.length > 0 && (/*#__PURE__*/React__default.createElement(SectionHeaderButton, {
|
|
3826
3848
|
onClick: () => handleMarkAllAsRead(),
|
|
3827
3849
|
title: `Mark ${unread.length} as read`
|
|
3828
|
-
})), /*#__PURE__*/React__default.createElement(TransitionGroup, {
|
|
3850
|
+
})))), /*#__PURE__*/React__default.createElement(TransitionGroup, {
|
|
3829
3851
|
exit: false
|
|
3830
|
-
}, unread.map((notification, idx) => /*#__PURE__*/React__default.createElement(Transition, {
|
|
3852
|
+
}, unread.map((notification, idx) => (/*#__PURE__*/React__default.createElement(Transition, {
|
|
3831
3853
|
key: notification.id,
|
|
3832
3854
|
timeout: 0
|
|
3833
|
-
}, state => /*#__PURE__*/React__default.createElement("div", {
|
|
3855
|
+
}, state => (/*#__PURE__*/React__default.createElement("div", {
|
|
3834
3856
|
style: {
|
|
3835
3857
|
...defaultStyle,
|
|
3836
3858
|
...transitionStyles[state]
|
|
@@ -3842,15 +3864,17 @@ function NotificationsComponent({
|
|
|
3842
3864
|
onToggleRead: () => handleToggleRead(notification),
|
|
3843
3865
|
onCreateTask: handleCreateTask,
|
|
3844
3866
|
showBottomBorder: read.length > 0,
|
|
3845
|
-
|
|
3846
|
-
|
|
3867
|
+
...{
|
|
3868
|
+
notification
|
|
3869
|
+
}
|
|
3870
|
+
}))))))), read.length > 0 && showRead && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SectionHeaderTitle, {
|
|
3847
3871
|
padding: 2
|
|
3848
3872
|
}, "Read"), /*#__PURE__*/React__default.createElement(TransitionGroup, {
|
|
3849
3873
|
exit: false
|
|
3850
|
-
}, read.map(notification => /*#__PURE__*/React__default.createElement(Transition, {
|
|
3874
|
+
}, read.map(notification => (/*#__PURE__*/React__default.createElement(Transition, {
|
|
3851
3875
|
key: notification.id,
|
|
3852
3876
|
timeout: 0
|
|
3853
|
-
}, state => /*#__PURE__*/React__default.createElement("div", {
|
|
3877
|
+
}, state => (/*#__PURE__*/React__default.createElement("div", {
|
|
3854
3878
|
style: {
|
|
3855
3879
|
...defaultStyle,
|
|
3856
3880
|
...transitionStyles[state]
|
|
@@ -3864,8 +3888,10 @@ function NotificationsComponent({
|
|
|
3864
3888
|
onToggleRead: () => handleToggleRead(notification),
|
|
3865
3889
|
onCreateTask: handleCreateTask,
|
|
3866
3890
|
showBottomBorder: true,
|
|
3867
|
-
|
|
3868
|
-
|
|
3891
|
+
...{
|
|
3892
|
+
notification
|
|
3893
|
+
}
|
|
3894
|
+
}))))))))))))));
|
|
3869
3895
|
}
|
|
3870
3896
|
const Notifications = {
|
|
3871
3897
|
component: NotificationsComponent,
|
|
@@ -3925,18 +3951,20 @@ function NavLinkWithBadge({
|
|
|
3925
3951
|
onClick,
|
|
3926
3952
|
...rest
|
|
3927
3953
|
}) {
|
|
3928
|
-
return /*#__PURE__*/React__default.createElement(StackView$2,
|
|
3954
|
+
return /*#__PURE__*/React__default.createElement(StackView$2, {
|
|
3929
3955
|
as: "button",
|
|
3930
3956
|
axis: "horizontal",
|
|
3931
3957
|
distribution: "space-between",
|
|
3932
3958
|
alignment: "center",
|
|
3933
3959
|
paddingBottom: 0.75,
|
|
3934
3960
|
onClick: () => onClick(),
|
|
3935
|
-
spacing: 1
|
|
3936
|
-
|
|
3961
|
+
spacing: 1,
|
|
3962
|
+
...rest
|
|
3963
|
+
}, children, badge && /*#__PURE__*/React__default.createElement(Badge, {
|
|
3937
3964
|
size: "sm",
|
|
3938
|
-
fontWeight: "600"
|
|
3939
|
-
|
|
3965
|
+
fontWeight: "600",
|
|
3966
|
+
...badge
|
|
3967
|
+
}));
|
|
3940
3968
|
}
|
|
3941
3969
|
function TasksComponent({
|
|
3942
3970
|
closeDrawer,
|
|
@@ -3958,7 +3986,7 @@ function TasksComponent({
|
|
|
3958
3986
|
});
|
|
3959
3987
|
}, []);
|
|
3960
3988
|
const pendoTrackEvent = useCallback((event, properties = {}) => {
|
|
3961
|
-
if (!window
|
|
3989
|
+
if (!(window === null || window === void 0 ? void 0 : window.pendo)) {
|
|
3962
3990
|
return console.warn("`window.pendo` is undefined");
|
|
3963
3991
|
}
|
|
3964
3992
|
window.pendo.track(event, properties);
|
|
@@ -4013,7 +4041,7 @@ function JoltSubscriber({
|
|
|
4013
4041
|
} = useStore();
|
|
4014
4042
|
const joltIsV2 = useJoltIsV2(joltPromise);
|
|
4015
4043
|
const joltChannel = useJoltChannelSubscription({
|
|
4016
|
-
channelName: requestedJoltChannel
|
|
4044
|
+
channelName: requestedJoltChannel === null || requestedJoltChannel === void 0 ? void 0 : requestedJoltChannel.channelName,
|
|
4017
4045
|
disconnectJoltOnUnmount,
|
|
4018
4046
|
enabled: !!requestedJoltChannel,
|
|
4019
4047
|
env,
|
|
@@ -4033,13 +4061,13 @@ function JoltSubscriber({
|
|
|
4033
4061
|
},
|
|
4034
4062
|
joltPromise
|
|
4035
4063
|
});
|
|
4036
|
-
return joltIsV2 ? /*#__PURE__*/React__default.createElement(JoltEffectV2, {
|
|
4064
|
+
return joltIsV2 ? (/*#__PURE__*/React__default.createElement(JoltEffectV2, {
|
|
4037
4065
|
channel: joltChannel,
|
|
4038
4066
|
onMessage: onMessage
|
|
4039
|
-
}) : /*#__PURE__*/React__default.createElement(JoltEffectV1, {
|
|
4067
|
+
})) : (/*#__PURE__*/React__default.createElement(JoltEffectV1, {
|
|
4040
4068
|
channel: joltChannel,
|
|
4041
4069
|
onMessage: onMessage
|
|
4042
|
-
});
|
|
4070
|
+
}));
|
|
4043
4071
|
}
|
|
4044
4072
|
function JoltEffectV2({
|
|
4045
4073
|
channel,
|
|
@@ -4101,26 +4129,20 @@ function useHandleMessageFromChildFrame(callback, {
|
|
|
4101
4129
|
}
|
|
4102
4130
|
|
|
4103
4131
|
// TLDR; This hook is used to sync the fragment route in the browser's url without causing an annoying flicker.
|
|
4104
|
-
|
|
4105
4132
|
// It has a couple of interrelated responsibilities whose relationship may not be obvious:
|
|
4106
|
-
|
|
4107
4133
|
// First:
|
|
4108
4134
|
// It listens for messages from the child frame that indicate that the frame has navigated to a new path.
|
|
4109
4135
|
// When this happens, it updates the fragment route in the browser's url.
|
|
4110
4136
|
// We also track the internal path of the child frame in a ref so that we can compare it to the fragment route in the browser's url.
|
|
4111
|
-
|
|
4112
4137
|
// Second:
|
|
4113
4138
|
// It compares the current fragment route against the internal path of the child frame.
|
|
4114
4139
|
// The only time that these would ever diverge is if the user manually changes the fragment route in the browser's url.
|
|
4115
4140
|
// When they are not the same, we update the src attribute of the iframe to match the fragment route in the browser's url.
|
|
4116
|
-
|
|
4117
4141
|
// You may be asking yourself, why all this complexity?
|
|
4118
4142
|
// Why not just update the src attribute of the iframe every time the fragment route changes?
|
|
4119
|
-
|
|
4120
4143
|
// The answer:
|
|
4121
4144
|
// If you change an iframes src attribute, it will reload the iframe and cause a very annoying flicker.
|
|
4122
4145
|
// It's not a rerender bug. It's a browser behavior that we can't control.
|
|
4123
|
-
|
|
4124
4146
|
function useStableIframeSrcAttributeAndSyncFragmentRoute({
|
|
4125
4147
|
currentPath,
|
|
4126
4148
|
setFragmentRoute,
|
|
@@ -4134,7 +4156,6 @@ function useStableIframeSrcAttributeAndSyncFragmentRoute({
|
|
|
4134
4156
|
const unencodedPath = event.data.payload.replace(/^\/?topbar/, "") // Maybe this should happen on the child side of things?
|
|
4135
4157
|
.replace(/^\/+/, "");
|
|
4136
4158
|
internalPathOfChatRef.current = unencodedPath;
|
|
4137
|
-
|
|
4138
4159
|
// URL encode the payload's query string for the fragment route
|
|
4139
4160
|
// so possible query params don't get dropped by the fragment router
|
|
4140
4161
|
setFragmentRoute(encodeQueryString(unencodedPath));
|
|
@@ -4278,8 +4299,9 @@ const Profile = {
|
|
|
4278
4299
|
|
|
4279
4300
|
const DURATION = 100;
|
|
4280
4301
|
function isToolPathExemptFromStorage(toolName, path) {
|
|
4302
|
+
var _a, _b;
|
|
4281
4303
|
const tool = toolsRouteMap[toolName];
|
|
4282
|
-
return tool
|
|
4304
|
+
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;
|
|
4283
4305
|
}
|
|
4284
4306
|
const TOOLS_MAP = {
|
|
4285
4307
|
Chat,
|
|
@@ -4324,7 +4346,7 @@ function Toolbar({
|
|
|
4324
4346
|
userId
|
|
4325
4347
|
} = {
|
|
4326
4348
|
...storeData,
|
|
4327
|
-
...(env === "development" ? _storeDataOverride
|
|
4349
|
+
...(env === "development" ? _storeDataOverride !== null && _storeDataOverride !== void 0 ? _storeDataOverride : {} : {})
|
|
4328
4350
|
};
|
|
4329
4351
|
const updateStore = useUpdateStore();
|
|
4330
4352
|
React__default.useEffect(() => {
|
|
@@ -4335,7 +4357,6 @@ function Toolbar({
|
|
|
4335
4357
|
document.body.style.overflow = "auto";
|
|
4336
4358
|
}
|
|
4337
4359
|
}, [open]);
|
|
4338
|
-
|
|
4339
4360
|
// Listen for external close requests from store
|
|
4340
4361
|
React__default.useEffect(() => {
|
|
4341
4362
|
const unsubscribe = store$1.subscribe(state => {
|
|
@@ -4358,7 +4379,6 @@ function Toolbar({
|
|
|
4358
4379
|
window.topbar.openProfile = () => handleToolOnClick(Profile);
|
|
4359
4380
|
window.topbar.openHelpdesk = () => handleToolOnClick(Helpdesk);
|
|
4360
4381
|
window.openHelpdesk = window.topbar.openHelpdesk; /* TODO: Remove when products have migrated to window.topbar.openHelpdesk */
|
|
4361
|
-
|
|
4362
4382
|
return () => {
|
|
4363
4383
|
delete window.topbar.openProfile;
|
|
4364
4384
|
delete window.topbar.openHelpdesk;
|
|
@@ -4424,30 +4444,31 @@ function Toolbar({
|
|
|
4424
4444
|
}
|
|
4425
4445
|
}, [toolbarFragmentRoute, toolStateCookie]);
|
|
4426
4446
|
React__default.useEffect(() => {
|
|
4427
|
-
if (toolbarFragmentRoute
|
|
4447
|
+
if ((toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.tool) && (currentContent !== toolsRouteMap[toolbarFragmentRoute.tool] || !open)) {
|
|
4428
4448
|
setToolAndOpenDrawer(toolsRouteMap[toolbarFragmentRoute.tool]);
|
|
4429
4449
|
}
|
|
4430
|
-
}, [setToolAndOpenDrawer, toolbarFragmentRoute
|
|
4450
|
+
}, [setToolAndOpenDrawer, toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.tool, currentContent, open]);
|
|
4431
4451
|
const toggleDrawer = content => {
|
|
4432
4452
|
if (!open) {
|
|
4433
4453
|
return openDrawer(content);
|
|
4434
4454
|
}
|
|
4435
|
-
return currentContent
|
|
4455
|
+
return (currentContent === null || currentContent === void 0 ? void 0 : currentContent.name) === content.name ? closeDrawer() : openDrawer(content);
|
|
4436
4456
|
};
|
|
4437
4457
|
const {
|
|
4438
4458
|
displayChatIcon,
|
|
4439
4459
|
unreadIndicator
|
|
4440
4460
|
} = useChatConfig({
|
|
4441
|
-
disconnectJoltOnUnmount: storeData
|
|
4461
|
+
disconnectJoltOnUnmount: storeData === null || storeData === void 0 ? void 0 : storeData.disconnectJoltOnUnmount,
|
|
4442
4462
|
env,
|
|
4443
4463
|
isEnabled: Boolean(userId),
|
|
4444
|
-
joltPromise: storeData
|
|
4464
|
+
joltPromise: storeData === null || storeData === void 0 ? void 0 : storeData.joltPromise,
|
|
4445
4465
|
userId
|
|
4446
4466
|
});
|
|
4447
4467
|
const TOOLS = [Notifications, Tasks, displayChatIcon && Chat].filter(Boolean);
|
|
4448
4468
|
const handleToolOnClick = tool => {
|
|
4469
|
+
var _a;
|
|
4449
4470
|
toggleDrawer(tool);
|
|
4450
|
-
document.getElementById(`toolbarDrawer${tool.name}`)
|
|
4471
|
+
(_a = document.getElementById(`toolbarDrawer${tool.name}`)) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
4451
4472
|
behavior: "smooth",
|
|
4452
4473
|
top: 0
|
|
4453
4474
|
});
|
|
@@ -4457,7 +4478,7 @@ function Toolbar({
|
|
|
4457
4478
|
appName,
|
|
4458
4479
|
closeDrawer,
|
|
4459
4480
|
connectedPeople: connectedPeople || [],
|
|
4460
|
-
hasConnectedPeople: storeData
|
|
4481
|
+
hasConnectedPeople: (storeData === null || storeData === void 0 ? void 0 : storeData.hasConnectedPeople) || false,
|
|
4461
4482
|
linkToProfile,
|
|
4462
4483
|
loginSettingsUrl,
|
|
4463
4484
|
logoutUrl,
|
|
@@ -4472,13 +4493,13 @@ function Toolbar({
|
|
|
4472
4493
|
}
|
|
4473
4494
|
};
|
|
4474
4495
|
const onChangePath = useCallback(path => {
|
|
4475
|
-
onChangeToolbarFragmentRoute(currentContent
|
|
4476
|
-
}, [currentContent
|
|
4477
|
-
const routeIsForCurrentTool = toolbarFragmentRoute
|
|
4496
|
+
onChangeToolbarFragmentRoute(currentContent === null || currentContent === void 0 ? void 0 : currentContent.name.toLowerCase(), path);
|
|
4497
|
+
}, [currentContent === null || currentContent === void 0 ? void 0 : currentContent.name]);
|
|
4498
|
+
const routeIsForCurrentTool = (toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.tool) && toolsRouteMap[toolbarFragmentRoute.tool] === currentContent;
|
|
4478
4499
|
const currentToolProps = {
|
|
4479
4500
|
appName,
|
|
4480
4501
|
closeDrawer,
|
|
4481
|
-
currentPath: routeIsForCurrentTool ? toolbarFragmentRoute
|
|
4502
|
+
currentPath: routeIsForCurrentTool ? toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.path : null,
|
|
4482
4503
|
env,
|
|
4483
4504
|
helpdeskConfig,
|
|
4484
4505
|
isOpen: open,
|
|
@@ -4521,17 +4542,19 @@ function Toolbar({
|
|
|
4521
4542
|
"aria-label": `Open ${tool.name} drawer`,
|
|
4522
4543
|
"data-pendo": getDataPendoAttribute(tool.name),
|
|
4523
4544
|
key: tool.name
|
|
4524
|
-
}, !indicator && /*#__PURE__*/React__default.createElement(ToolbarButtonIcon, {
|
|
4545
|
+
}, !indicator && (/*#__PURE__*/React__default.createElement(ToolbarButtonIcon, {
|
|
4525
4546
|
path: tool.icons.staticPath
|
|
4526
|
-
}), indicator && /*#__PURE__*/React__default.createElement(ToolbarButtonIcon, {
|
|
4547
|
+
})), indicator && (/*#__PURE__*/React__default.createElement(ToolbarButtonIcon, {
|
|
4527
4548
|
path: tool.icons.staticDotPath,
|
|
4528
4549
|
dot: true
|
|
4529
|
-
}));
|
|
4550
|
+
})));
|
|
4530
4551
|
})), /*#__PURE__*/React__default.createElement(DrawerWrap, {
|
|
4531
4552
|
isVisible: open
|
|
4532
|
-
}, mounted && /*#__PURE__*/React__default.createElement(Drawer, {
|
|
4553
|
+
}, mounted && (/*#__PURE__*/React__default.createElement(Drawer, {
|
|
4533
4554
|
id: `toolbarDrawer${currentContent.name}`
|
|
4534
|
-
}, /*#__PURE__*/React__default.createElement(currentContent.component,
|
|
4555
|
+
}, /*#__PURE__*/React__default.createElement(currentContent.component, {
|
|
4556
|
+
...currentToolProps
|
|
4557
|
+
}))))));
|
|
4535
4558
|
}
|
|
4536
4559
|
const ToolbarButton = ({
|
|
4537
4560
|
children,
|
|
@@ -4540,12 +4563,13 @@ const ToolbarButton = ({
|
|
|
4540
4563
|
onClick,
|
|
4541
4564
|
...restProps
|
|
4542
4565
|
}) => {
|
|
4543
|
-
return /*#__PURE__*/React__default.createElement("button",
|
|
4566
|
+
return /*#__PURE__*/React__default.createElement("button", {
|
|
4544
4567
|
type: "button",
|
|
4545
4568
|
className: classnames(styles["toolbar-button"], className, current && styles["is-current"]),
|
|
4546
4569
|
onClick: onClick,
|
|
4547
|
-
"data-toolbar-link": "true"
|
|
4548
|
-
|
|
4570
|
+
"data-toolbar-link": "true",
|
|
4571
|
+
...restProps
|
|
4572
|
+
}, children);
|
|
4549
4573
|
};
|
|
4550
4574
|
function ToolbarButtonIcon({
|
|
4551
4575
|
dot,
|
|
@@ -4562,12 +4586,12 @@ function ToolbarButtonIcon({
|
|
|
4562
4586
|
fillRule: "evenodd",
|
|
4563
4587
|
clipRule: "evenodd",
|
|
4564
4588
|
d: path
|
|
4565
|
-
}), dot && /*#__PURE__*/React__default.createElement("circle", {
|
|
4566
|
-
fill: "var(--t-icon-color-status-error
|
|
4589
|
+
}), dot && (/*#__PURE__*/React__default.createElement("circle", {
|
|
4590
|
+
fill: "var(--t-icon-color-status-error)",
|
|
4567
4591
|
cx: "24",
|
|
4568
4592
|
cy: "8",
|
|
4569
4593
|
r: "4"
|
|
4570
|
-
}));
|
|
4594
|
+
})));
|
|
4571
4595
|
}
|
|
4572
4596
|
function getDataPendoAttribute(toolName) {
|
|
4573
4597
|
if (toolName === "Chat") {
|