@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.js
CHANGED
|
@@ -46,9 +46,10 @@ const AccessibilityToolbar = ({
|
|
|
46
46
|
children
|
|
47
47
|
}) => {
|
|
48
48
|
const handleClick = event => {
|
|
49
|
+
var _a;
|
|
49
50
|
event.preventDefault();
|
|
50
51
|
event.stopPropagation();
|
|
51
|
-
document.getElementById("main-content")
|
|
52
|
+
(_a = document.getElementById("main-content")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
52
53
|
};
|
|
53
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
54
55
|
className: styles$c["accessibility-toolbar"]
|
|
@@ -60,16 +61,6 @@ const AccessibilityToolbar = ({
|
|
|
60
61
|
}), children);
|
|
61
62
|
};
|
|
62
63
|
|
|
63
|
-
function _extends() {
|
|
64
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
65
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
66
|
-
var t = arguments[e];
|
|
67
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
68
|
-
}
|
|
69
|
-
return n;
|
|
70
|
-
}, _extends.apply(null, arguments);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
64
|
function getDefaultExportFromCjs (x) {
|
|
74
65
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
75
66
|
}
|
|
@@ -183,7 +174,8 @@ const railsCsrfFetch = (url, {
|
|
|
183
174
|
});
|
|
184
175
|
};
|
|
185
176
|
function inferRailsCsrfToken() {
|
|
186
|
-
|
|
177
|
+
var _a, _b;
|
|
178
|
+
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;
|
|
187
179
|
}
|
|
188
180
|
function apiRequest(fetch, url, {
|
|
189
181
|
method = "GET",
|
|
@@ -229,17 +221,17 @@ const Bell = ({
|
|
|
229
221
|
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",
|
|
230
222
|
fill: "white"
|
|
231
223
|
});
|
|
232
|
-
return /*#__PURE__*/React.createElement("svg",
|
|
224
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
233
225
|
width: "24",
|
|
234
226
|
height: "24",
|
|
235
227
|
viewBox: "0 0 24 24",
|
|
236
228
|
style: {
|
|
237
229
|
display: "block",
|
|
238
230
|
...style
|
|
239
|
-
}
|
|
240
|
-
|
|
231
|
+
},
|
|
232
|
+
...props,
|
|
241
233
|
stroke: "none"
|
|
242
|
-
}
|
|
234
|
+
}, /*#__PURE__*/React.createElement("title", null, "bell"), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("mask", {
|
|
243
235
|
id: "mask-no-dot"
|
|
244
236
|
}, bellPath), /*#__PURE__*/React.createElement("mask", {
|
|
245
237
|
id: "mask-dot"
|
|
@@ -266,14 +258,15 @@ const BlankStateIcon = ({
|
|
|
266
258
|
id = "default",
|
|
267
259
|
style,
|
|
268
260
|
...nativeProps
|
|
269
|
-
}) => /*#__PURE__*/React.createElement("svg",
|
|
261
|
+
}) => (/*#__PURE__*/React.createElement("svg", {
|
|
270
262
|
fill: "none",
|
|
271
263
|
height: "123",
|
|
272
264
|
style: {
|
|
273
265
|
...style
|
|
274
266
|
},
|
|
275
|
-
width: "160"
|
|
276
|
-
|
|
267
|
+
width: "160",
|
|
268
|
+
...nativeProps
|
|
269
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
277
270
|
clipPath: `url(#clip-path-blank-state-${id})`
|
|
278
271
|
}, /*#__PURE__*/React.createElement("path", {
|
|
279
272
|
opacity: ".6",
|
|
@@ -305,70 +298,76 @@ const BlankStateIcon = ({
|
|
|
305
298
|
}, /*#__PURE__*/React.createElement("path", {
|
|
306
299
|
fill: "#fff",
|
|
307
300
|
d: "M0 0h160v122.063H0z"
|
|
308
|
-
}))));
|
|
301
|
+
})))));
|
|
309
302
|
const DisclosureChevronIcon = ({
|
|
310
303
|
className,
|
|
311
304
|
style,
|
|
312
305
|
...nativeProps
|
|
313
|
-
}) => /*#__PURE__*/React.createElement("svg",
|
|
306
|
+
}) => (/*#__PURE__*/React.createElement("svg", {
|
|
314
307
|
className: className,
|
|
315
308
|
height: "16",
|
|
316
309
|
viewBox: "0 0 16 16",
|
|
317
310
|
width: "16",
|
|
318
|
-
|
|
319
|
-
|
|
311
|
+
...{
|
|
312
|
+
style
|
|
313
|
+
},
|
|
314
|
+
...nativeProps
|
|
315
|
+
}, /*#__PURE__*/React.createElement("title", null, "chevron"), /*#__PURE__*/React.createElement("polygon", {
|
|
320
316
|
fill: "currentColor",
|
|
321
317
|
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"
|
|
322
|
-
}));
|
|
318
|
+
})));
|
|
323
319
|
const ExclamationTriangle = ({
|
|
324
320
|
fill = "#000",
|
|
325
321
|
size = 24,
|
|
326
322
|
style,
|
|
327
323
|
...nativeProps
|
|
328
|
-
}) => /*#__PURE__*/React.createElement("svg",
|
|
324
|
+
}) => (/*#__PURE__*/React.createElement("svg", {
|
|
329
325
|
height: size,
|
|
330
326
|
style: {
|
|
331
327
|
display: "block",
|
|
332
328
|
...style
|
|
333
329
|
},
|
|
334
330
|
viewBox: "0 0 16 16",
|
|
335
|
-
width: size
|
|
336
|
-
|
|
331
|
+
width: size,
|
|
332
|
+
...nativeProps
|
|
333
|
+
}, /*#__PURE__*/React.createElement("title", null, "exclamation triangle icon"), /*#__PURE__*/React.createElement("path", {
|
|
337
334
|
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",
|
|
338
335
|
fill: fill
|
|
339
|
-
}));
|
|
336
|
+
})));
|
|
340
337
|
const Spyglass = ({
|
|
341
338
|
fill = "#000",
|
|
342
339
|
style,
|
|
343
340
|
...nativeProps
|
|
344
|
-
}) => /*#__PURE__*/React.createElement("svg",
|
|
341
|
+
}) => (/*#__PURE__*/React.createElement("svg", {
|
|
345
342
|
width: "24",
|
|
346
343
|
height: "24",
|
|
347
344
|
viewBox: "0 0 24 24",
|
|
348
345
|
style: {
|
|
349
346
|
display: "block",
|
|
350
347
|
...style
|
|
351
|
-
}
|
|
352
|
-
|
|
348
|
+
},
|
|
349
|
+
...nativeProps
|
|
350
|
+
}, /*#__PURE__*/React.createElement("title", null, "search spyglass icon"), /*#__PURE__*/React.createElement("path", {
|
|
353
351
|
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",
|
|
354
352
|
fill: fill
|
|
355
|
-
}));
|
|
353
|
+
})));
|
|
356
354
|
const X = ({
|
|
357
355
|
fill = "#A0A0A0",
|
|
358
356
|
style,
|
|
359
357
|
...nativeProps
|
|
360
|
-
}) => /*#__PURE__*/React.createElement("svg",
|
|
358
|
+
}) => (/*#__PURE__*/React.createElement("svg", {
|
|
361
359
|
width: "16",
|
|
362
360
|
height: "16",
|
|
363
361
|
viewBox: "0 0 16 16",
|
|
364
362
|
style: {
|
|
365
363
|
display: "block",
|
|
366
364
|
...style
|
|
367
|
-
}
|
|
368
|
-
|
|
365
|
+
},
|
|
366
|
+
...nativeProps
|
|
367
|
+
}, /*#__PURE__*/React.createElement("title", null, "close-x"), /*#__PURE__*/React.createElement("path", {
|
|
369
368
|
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",
|
|
370
369
|
fill: fill
|
|
371
|
-
}));
|
|
370
|
+
})));
|
|
372
371
|
|
|
373
372
|
var styles$b = {"announcement":"announcement-pI5tM","announcement--platform":"announcement--platform-EcUn2","announcement-icon":"announcement-icon-Ov39-","announcement-content":"announcement-content-q2ad6","dismiss":"dismiss-wUAoU"};
|
|
374
373
|
|
|
@@ -409,9 +408,6 @@ class Provider extends React.Component {
|
|
|
409
408
|
announcements: props.initialAnnouncements
|
|
410
409
|
};
|
|
411
410
|
}
|
|
412
|
-
static defaultProps = {
|
|
413
|
-
formatter: formatter
|
|
414
|
-
};
|
|
415
411
|
dismissAnnouncements(id) {
|
|
416
412
|
this.setState(({
|
|
417
413
|
announcements
|
|
@@ -434,6 +430,9 @@ class Provider extends React.Component {
|
|
|
434
430
|
}));
|
|
435
431
|
}
|
|
436
432
|
}
|
|
433
|
+
Provider.defaultProps = {
|
|
434
|
+
formatter: formatter
|
|
435
|
+
};
|
|
437
436
|
let StyledAnnouncement$1 = class StyledAnnouncement extends React.Component {
|
|
438
437
|
render() {
|
|
439
438
|
const {
|
|
@@ -442,10 +441,11 @@ let StyledAnnouncement$1 = class StyledAnnouncement extends React.Component {
|
|
|
442
441
|
} = this.props;
|
|
443
442
|
return /*#__PURE__*/React.createElement("div", {
|
|
444
443
|
className: classnames(styles$b["announcement"], styles$b["announcement--platform"])
|
|
445
|
-
}, /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div",
|
|
444
|
+
}, /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div", {
|
|
446
445
|
className: styles$b["announcement-content"],
|
|
447
|
-
style: style
|
|
448
|
-
|
|
446
|
+
style: style,
|
|
447
|
+
...platformProps
|
|
448
|
+
}));
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
451
|
let StyleProvider$1 = class StyleProvider extends React.Component {
|
|
@@ -453,39 +453,42 @@ let StyleProvider$1 = class StyleProvider extends React.Component {
|
|
|
453
453
|
const {
|
|
454
454
|
...platformProps
|
|
455
455
|
} = this.props;
|
|
456
|
-
return /*#__PURE__*/React.createElement("div",
|
|
456
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
457
|
+
...platformProps
|
|
458
|
+
});
|
|
457
459
|
}
|
|
458
460
|
};
|
|
459
461
|
class PlatformAnnouncements extends React.Component {
|
|
460
|
-
static defaultProps = {
|
|
461
|
-
configuredFetch: defaultFetch,
|
|
462
|
-
renderItem: ({
|
|
463
|
-
announcement,
|
|
464
|
-
actions
|
|
465
|
-
}) => /*#__PURE__*/React.createElement(DissmissibleAnnouncement, {
|
|
466
|
-
key: announcement.id,
|
|
467
|
-
html: announcement.data.html,
|
|
468
|
-
onClick: () => actions.dismissAnnouncements(announcement.id)
|
|
469
|
-
})
|
|
470
|
-
};
|
|
471
462
|
render() {
|
|
472
463
|
return /*#__PURE__*/React.createElement(StyleProvider$1, null, /*#__PURE__*/React.createElement(Provider, {
|
|
473
464
|
env: this.props.env,
|
|
474
465
|
initialAnnouncements: this.props.data,
|
|
475
466
|
configuredFetch: this.props.configuredFetch
|
|
476
|
-
}, (data, actions) => Boolean(data.announcements.length > 0) ? /*#__PURE__*/React.createElement("div", null, data.announcements.map(announcement => this.props.renderItem({
|
|
467
|
+
}, (data, actions) => Boolean(data.announcements.length > 0) ? (/*#__PURE__*/React.createElement("div", null, data.announcements.map(announcement => this.props.renderItem({
|
|
477
468
|
actions,
|
|
478
469
|
announcement
|
|
479
|
-
}))) : null));
|
|
470
|
+
})))) : null));
|
|
480
471
|
}
|
|
481
472
|
}
|
|
473
|
+
PlatformAnnouncements.defaultProps = {
|
|
474
|
+
configuredFetch: defaultFetch,
|
|
475
|
+
renderItem: ({
|
|
476
|
+
announcement,
|
|
477
|
+
actions
|
|
478
|
+
}) => (/*#__PURE__*/React.createElement(DissmissibleAnnouncement, {
|
|
479
|
+
key: announcement.id,
|
|
480
|
+
html: announcement.data.html,
|
|
481
|
+
onClick: () => actions.dismissAnnouncements(announcement.id)
|
|
482
|
+
}))
|
|
483
|
+
};
|
|
482
484
|
function StyledDismissButton$1({
|
|
483
485
|
...props
|
|
484
486
|
}) {
|
|
485
|
-
return /*#__PURE__*/React.createElement("button",
|
|
487
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
486
488
|
type: "button",
|
|
487
|
-
className: styles$b.dismiss
|
|
488
|
-
|
|
489
|
+
className: styles$b.dismiss,
|
|
490
|
+
...props
|
|
491
|
+
}, /*#__PURE__*/React.createElement(X, {
|
|
489
492
|
fill: "white",
|
|
490
493
|
style: {
|
|
491
494
|
height: 20,
|
|
@@ -522,7 +525,6 @@ It should look something like this in your application's Topbar composition:
|
|
|
522
525
|
|
|
523
526
|
Attributes like `className`, `id`, `data-*`, and `aria-*` are all applied to the root element.
|
|
524
527
|
*/
|
|
525
|
-
|
|
526
528
|
function ProductAnnouncement({
|
|
527
529
|
html = "",
|
|
528
530
|
onClick = _event => {
|
|
@@ -531,7 +533,9 @@ function ProductAnnouncement({
|
|
|
531
533
|
...props
|
|
532
534
|
}) {
|
|
533
535
|
const [dismissed, updateDismissed] = React.useState(false);
|
|
534
|
-
return dismissed || !html ? null : /*#__PURE__*/React.createElement(StyleProvider,
|
|
536
|
+
return dismissed || !html ? null : (/*#__PURE__*/React.createElement(StyleProvider, {
|
|
537
|
+
...props
|
|
538
|
+
}, /*#__PURE__*/React.createElement(StyledAnnouncement, null, /*#__PURE__*/React.createElement("span", {
|
|
535
539
|
dangerouslySetInnerHTML: {
|
|
536
540
|
__html: html
|
|
537
541
|
}
|
|
@@ -540,14 +544,16 @@ function ProductAnnouncement({
|
|
|
540
544
|
onClick(event);
|
|
541
545
|
updateDismissed(true);
|
|
542
546
|
}
|
|
543
|
-
})));
|
|
547
|
+
}))));
|
|
544
548
|
}
|
|
545
549
|
class StyleProvider extends React.Component {
|
|
546
550
|
render() {
|
|
547
551
|
const {
|
|
548
552
|
...platformProps
|
|
549
553
|
} = this.props;
|
|
550
|
-
return /*#__PURE__*/React.createElement("div",
|
|
554
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
555
|
+
...platformProps
|
|
556
|
+
});
|
|
551
557
|
}
|
|
552
558
|
}
|
|
553
559
|
class StyledAnnouncement extends React.Component {
|
|
@@ -558,19 +564,21 @@ class StyledAnnouncement extends React.Component {
|
|
|
558
564
|
} = this.props;
|
|
559
565
|
return /*#__PURE__*/React.createElement("div", {
|
|
560
566
|
className: styles$b["announcement"]
|
|
561
|
-
}, /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div",
|
|
567
|
+
}, /*#__PURE__*/React.createElement(AnnouncementIcon, null), /*#__PURE__*/React.createElement("div", {
|
|
562
568
|
className: styles$b["announcement-content"],
|
|
563
|
-
style: style
|
|
564
|
-
|
|
569
|
+
style: style,
|
|
570
|
+
...platformProps
|
|
571
|
+
}));
|
|
565
572
|
}
|
|
566
573
|
}
|
|
567
574
|
function StyledDismissButton({
|
|
568
575
|
...props
|
|
569
576
|
}) {
|
|
570
|
-
return /*#__PURE__*/React.createElement("button",
|
|
577
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
571
578
|
type: "button",
|
|
572
|
-
className: styles$b.dismiss
|
|
573
|
-
|
|
579
|
+
className: styles$b.dismiss,
|
|
580
|
+
...props
|
|
581
|
+
}, /*#__PURE__*/React.createElement(X, {
|
|
574
582
|
fill: "white",
|
|
575
583
|
style: {
|
|
576
584
|
height: 20,
|
|
@@ -646,8 +654,9 @@ const useJoltChannelSubscription = ({
|
|
|
646
654
|
}, [enabled, subscribeToJoltChannel]);
|
|
647
655
|
React.useEffect(() => {
|
|
648
656
|
const pcoPageExpiredHandler = event => {
|
|
657
|
+
var _a;
|
|
649
658
|
if (!event.data.hasOwnProperty("PCOPageExpiredCurrentPersonACID")) return;
|
|
650
|
-
if (event.data.PCOPageExpiredCurrentPersonACID === window
|
|
659
|
+
if (event.data.PCOPageExpiredCurrentPersonACID === ((_a = window === null || window === void 0 ? void 0 : window.pcoPageExpired) === null || _a === void 0 ? void 0 : _a.currentPersonACID)) return;
|
|
651
660
|
if (joltInstance) joltInstance.disconnect();
|
|
652
661
|
};
|
|
653
662
|
window.addEventListener("message", pcoPageExpiredHandler);
|
|
@@ -662,7 +671,6 @@ const useJoltChannelSubscription = ({
|
|
|
662
671
|
}, [joltInstance]);
|
|
663
672
|
return joltChannel;
|
|
664
673
|
};
|
|
665
|
-
|
|
666
674
|
// TODO: This can be removed once all Topbar consumers that
|
|
667
675
|
// provide a joltPromise are updated to jolt-client v2
|
|
668
676
|
const buildLegacyJoltChannel = (jolt, channelName, fetchSubscribeTokenFn) => {
|
|
@@ -672,7 +680,8 @@ const buildLegacyJoltChannel = (jolt, channelName, fetchSubscribeTokenFn) => {
|
|
|
672
680
|
return channel;
|
|
673
681
|
};
|
|
674
682
|
const buildJoltChannel = (jolt, channelName, fetchSubscribeTokenFn) => {
|
|
675
|
-
|
|
683
|
+
var _a;
|
|
684
|
+
const channel = ((_a = jolt.allSubscriptions) === null || _a === void 0 ? void 0 : _a.find(s => s.channel === channelName)) || jolt.subscribe(channelName, {
|
|
676
685
|
fetchSubscribeTokenFn
|
|
677
686
|
});
|
|
678
687
|
channel.subscribe();
|
|
@@ -721,7 +730,6 @@ function useLocalStorage(key, initialValue) {
|
|
|
721
730
|
try {
|
|
722
731
|
// Get from local storage by key
|
|
723
732
|
const item = window.localStorage.getItem(key);
|
|
724
|
-
|
|
725
733
|
// Parse stored json or if none return initialValue
|
|
726
734
|
return item ? JSON.parse(item) : initialValue;
|
|
727
735
|
} catch (error) {
|
|
@@ -729,13 +737,11 @@ function useLocalStorage(key, initialValue) {
|
|
|
729
737
|
return initialValue;
|
|
730
738
|
}
|
|
731
739
|
});
|
|
732
|
-
|
|
733
740
|
// Reflect the state into localStorage as a side effect.
|
|
734
741
|
const localStorageRepresentation = JSON.stringify(storedValue);
|
|
735
742
|
React.useEffect(() => {
|
|
736
743
|
window.localStorage.setItem(key, localStorageRepresentation);
|
|
737
744
|
}, [key, localStorageRepresentation]);
|
|
738
|
-
|
|
739
745
|
// When we are done with this key, drop it from localStorage completely
|
|
740
746
|
const dropKey = () => window.localStorage.removeItem(key);
|
|
741
747
|
return {
|
|
@@ -826,22 +832,21 @@ const AppsProvider = ({
|
|
|
826
832
|
render,
|
|
827
833
|
userId
|
|
828
834
|
}) => {
|
|
835
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
829
836
|
const topbarResponse = useTopbarAPI({
|
|
830
837
|
configuredFetch,
|
|
831
838
|
env
|
|
832
839
|
});
|
|
833
840
|
const apps = formatter(topbarResponse);
|
|
834
|
-
const hasConnectedPeople = topbarResponse
|
|
835
|
-
const mfaConfigured = !!topbarResponse
|
|
836
|
-
const
|
|
837
|
-
const
|
|
838
|
-
const colorMode = topbarResponse?.data?.attributes?.color_mode;
|
|
839
|
-
const name = topbarResponse?.data?.attributes?.name;
|
|
841
|
+
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;
|
|
842
|
+
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);
|
|
843
|
+
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;
|
|
844
|
+
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;
|
|
840
845
|
const notificationsEnabled = !window.notificationsDisabled;
|
|
841
|
-
const organizationTimeZone = topbarResponse
|
|
846
|
+
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";
|
|
842
847
|
const algoliaSearchAuth = {
|
|
843
|
-
algoliaApplicationId: topbarResponse
|
|
844
|
-
algoliaSearchOnlyApiKey: topbarResponse
|
|
848
|
+
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,
|
|
849
|
+
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
|
|
845
850
|
};
|
|
846
851
|
const joltPromise = React.useMemo(() => {
|
|
847
852
|
return resolveJoltPromise({
|
|
@@ -893,8 +898,6 @@ const AppsProvider = ({
|
|
|
893
898
|
...state,
|
|
894
899
|
algoliaSearchAuth,
|
|
895
900
|
colorMode,
|
|
896
|
-
colorModeLaunched,
|
|
897
|
-
colorModeSelectionEnabled,
|
|
898
901
|
disconnectJoltOnUnmount: !providedJoltPromise,
|
|
899
902
|
hasConnectedPeople,
|
|
900
903
|
indicatorVisible: {
|
|
@@ -914,17 +917,16 @@ const AppsProvider = ({
|
|
|
914
917
|
organizationTimeZone,
|
|
915
918
|
userId
|
|
916
919
|
});
|
|
917
|
-
}, [colorMode,
|
|
918
|
-
|
|
920
|
+
}, [colorMode, joltPromise, mfaConfigured, name, notificationsEnabled, notificationsHasUnread, organizationTimeZone, userId]);
|
|
919
921
|
// TODO: remove `fetch` and `remove` (breaking changes)
|
|
920
922
|
return render(apps || [], {
|
|
921
923
|
fetch: () => {},
|
|
922
|
-
// no-op because we already have fresh data
|
|
923
924
|
remove: () => {} // no-op because we are no longer caching anyway
|
|
924
925
|
});
|
|
925
926
|
};
|
|
926
927
|
function mapApps(resp) {
|
|
927
|
-
|
|
928
|
+
var _a, _b;
|
|
929
|
+
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) || [];
|
|
928
930
|
}
|
|
929
931
|
|
|
930
932
|
function remove() {
|
|
@@ -940,9 +942,6 @@ class ConnectedPeopleProvider extends React.Component {
|
|
|
940
942
|
connectedPeople: []
|
|
941
943
|
};
|
|
942
944
|
}
|
|
943
|
-
static defaultProps = {
|
|
944
|
-
configuredFetch: defaultFetch
|
|
945
|
-
};
|
|
946
945
|
fetch() {
|
|
947
946
|
apiRequest(this.props.configuredFetch, `${pcoUrl(this.props.env)("api")}/login/v2/me/connected_people`).then(({
|
|
948
947
|
json,
|
|
@@ -961,7 +960,8 @@ class ConnectedPeopleProvider extends React.Component {
|
|
|
961
960
|
}).then(({
|
|
962
961
|
json
|
|
963
962
|
}) => {
|
|
964
|
-
|
|
963
|
+
var _a;
|
|
964
|
+
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);
|
|
965
965
|
});
|
|
966
966
|
}
|
|
967
967
|
switch(toId, returnPath) {
|
|
@@ -978,7 +978,8 @@ class ConnectedPeopleProvider extends React.Component {
|
|
|
978
978
|
}).then(({
|
|
979
979
|
json
|
|
980
980
|
}) => {
|
|
981
|
-
|
|
981
|
+
var _a;
|
|
982
|
+
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);
|
|
982
983
|
});
|
|
983
984
|
}
|
|
984
985
|
componentDidMount() {
|
|
@@ -997,6 +998,9 @@ class ConnectedPeopleProvider extends React.Component {
|
|
|
997
998
|
});
|
|
998
999
|
}
|
|
999
1000
|
}
|
|
1001
|
+
ConnectedPeopleProvider.defaultProps = {
|
|
1002
|
+
configuredFetch: defaultFetch
|
|
1003
|
+
};
|
|
1000
1004
|
|
|
1001
1005
|
class PointBreak extends React.Component {
|
|
1002
1006
|
constructor(props) {
|
|
@@ -1029,9 +1033,6 @@ class PointBreak extends React.Component {
|
|
|
1029
1033
|
}
|
|
1030
1034
|
}
|
|
1031
1035
|
class DisplaySwitch extends React.Component {
|
|
1032
|
-
static defaultProps = {
|
|
1033
|
-
smallBreakpoints: ["xs", "sm"]
|
|
1034
|
-
};
|
|
1035
1036
|
render() {
|
|
1036
1037
|
return /*#__PURE__*/React.createElement(PointBreak, {
|
|
1037
1038
|
render: breakpoint => {
|
|
@@ -1043,6 +1044,9 @@ class DisplaySwitch extends React.Component {
|
|
|
1043
1044
|
});
|
|
1044
1045
|
}
|
|
1045
1046
|
}
|
|
1047
|
+
DisplaySwitch.defaultProps = {
|
|
1048
|
+
smallBreakpoints: ["xs", "sm"]
|
|
1049
|
+
};
|
|
1046
1050
|
|
|
1047
1051
|
// TODO: Use Fragments when we React 16 is a baseline
|
|
1048
1052
|
function Accounts$2() {
|
|
@@ -1502,14 +1506,14 @@ function ColorAppIcon({
|
|
|
1502
1506
|
}
|
|
1503
1507
|
}, ColorAppSquircles[appName] ? (/*#__PURE__*/React.createElement(ColorAppSquircles[appName], {
|
|
1504
1508
|
key: "key1"
|
|
1505
|
-
})) : /*#__PURE__*/React.createElement("span", {
|
|
1509
|
+
})) : (/*#__PURE__*/React.createElement("span", {
|
|
1506
1510
|
key: "key1"
|
|
1507
|
-
}), AppSymbols[appName] ? (/*#__PURE__*/React.createElement(AppSymbols[appName], {
|
|
1511
|
+
})), AppSymbols[appName] ? (/*#__PURE__*/React.createElement(AppSymbols[appName], {
|
|
1508
1512
|
color: "#fff",
|
|
1509
1513
|
key: "key2"
|
|
1510
|
-
})) : /*#__PURE__*/React.createElement("div", {
|
|
1514
|
+
})) : (/*#__PURE__*/React.createElement("div", {
|
|
1511
1515
|
key: "key3"
|
|
1512
|
-
}, "appName not supported"));
|
|
1516
|
+
}, "appName not supported")));
|
|
1513
1517
|
}
|
|
1514
1518
|
|
|
1515
1519
|
const SQUIRCLE_FILL_COLORS = {
|
|
@@ -1540,7 +1544,7 @@ function MonoAppIcon({
|
|
|
1540
1544
|
size = 24,
|
|
1541
1545
|
...platformProps
|
|
1542
1546
|
}) {
|
|
1543
|
-
return /*#__PURE__*/React.createElement("svg",
|
|
1547
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
1544
1548
|
"data-logo": "mono-app-icon",
|
|
1545
1549
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1546
1550
|
width: size,
|
|
@@ -1551,19 +1555,20 @@ function MonoAppIcon({
|
|
|
1551
1555
|
style: {
|
|
1552
1556
|
display: "block",
|
|
1553
1557
|
...style
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1558
|
+
},
|
|
1559
|
+
...platformProps
|
|
1560
|
+
}, /*#__PURE__*/React.createElement("title", {
|
|
1556
1561
|
id: "title"
|
|
1557
1562
|
}, "Planning Center ", appName, " App Icon"), /*#__PURE__*/React.createElement("desc", {
|
|
1558
1563
|
id: "desc"
|
|
1559
|
-
}, "An image symbolizing the Planning Center ", appName, " app."), appName === "Accounts" ? null : /*#__PURE__*/React.createElement(Squircle, {
|
|
1564
|
+
}, "An image symbolizing the Planning Center ", appName, " app."), appName === "Accounts" ? null : (/*#__PURE__*/React.createElement(Squircle, {
|
|
1560
1565
|
appName: appName.toLowerCase()
|
|
1561
|
-
}), AppSymbols[appName] ? (/*#__PURE__*/React.createElement(AppSymbols[appName], {
|
|
1562
|
-
color: appName === "Accounts" ? "var(--t-text-color
|
|
1563
|
-
})) : /*#__PURE__*/React.createElement("div", null, "appName not supported"));
|
|
1566
|
+
})), AppSymbols[appName] ? (/*#__PURE__*/React.createElement(AppSymbols[appName], {
|
|
1567
|
+
color: appName === "Accounts" ? "var(--t-text-color)" : "var(--t-fill-color-neutral-100)"
|
|
1568
|
+
})) : (/*#__PURE__*/React.createElement("div", null, "appName not supported")));
|
|
1564
1569
|
}
|
|
1565
1570
|
|
|
1566
|
-
const fill = "var(--t-text-color
|
|
1571
|
+
const fill = "var(--t-text-color)";
|
|
1567
1572
|
function Accounts({
|
|
1568
1573
|
size = 20
|
|
1569
1574
|
}) {
|
|
@@ -1743,7 +1748,7 @@ function MonoAppName({
|
|
|
1743
1748
|
}) {
|
|
1744
1749
|
return MonoAppText[appName] ? (/*#__PURE__*/React.createElement(MonoAppText[appName], {
|
|
1745
1750
|
size
|
|
1746
|
-
})) : /*#__PURE__*/React.createElement("div", null, "appName not supported");
|
|
1751
|
+
})) : (/*#__PURE__*/React.createElement("div", null, "appName not supported"));
|
|
1747
1752
|
}
|
|
1748
1753
|
|
|
1749
1754
|
var styles$a = {"unbutton":"unbutton-lEbTR"};
|
|
@@ -1754,13 +1759,14 @@ function Unbutton({
|
|
|
1754
1759
|
type = "button",
|
|
1755
1760
|
...nativeProps
|
|
1756
1761
|
}) {
|
|
1757
|
-
return /*#__PURE__*/React.createElement("button",
|
|
1762
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
1758
1763
|
className: classnames(styles$a.unbutton, className),
|
|
1759
1764
|
style: {
|
|
1760
1765
|
...style
|
|
1761
1766
|
},
|
|
1762
|
-
type: type
|
|
1763
|
-
|
|
1767
|
+
type: type,
|
|
1768
|
+
...nativeProps
|
|
1769
|
+
});
|
|
1764
1770
|
}
|
|
1765
1771
|
|
|
1766
1772
|
var styles$9 = {"button":"button-XMbeQ","button-accounts":"button-accounts-nNh-z","chevron":"chevron-RRg9k","is-expanded":"is-expanded-zD0A0"};
|
|
@@ -1773,33 +1779,35 @@ const AppsButton = ({
|
|
|
1773
1779
|
style = null,
|
|
1774
1780
|
...nativeProps
|
|
1775
1781
|
}) => {
|
|
1776
|
-
return /*#__PURE__*/React.createElement(Unbutton,
|
|
1782
|
+
return /*#__PURE__*/React.createElement(Unbutton, {
|
|
1777
1783
|
onClick: onClick,
|
|
1778
1784
|
className: classnames(styles$9.button, {
|
|
1779
1785
|
[styles$9["is-expanded"]]: expanded
|
|
1780
1786
|
}),
|
|
1781
1787
|
type: "button",
|
|
1782
|
-
style: style
|
|
1783
|
-
|
|
1788
|
+
style: style,
|
|
1789
|
+
...nativeProps
|
|
1790
|
+
}, appName === "Accounts" ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MonoAppIcon, {
|
|
1784
1791
|
appName: "Accounts",
|
|
1785
1792
|
colors: colors
|
|
1786
1793
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1787
1794
|
className: styles$9["button-accounts"]
|
|
1788
|
-
}, "Account settings")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorAppIcon, {
|
|
1795
|
+
}, "Account settings"))) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorAppIcon, {
|
|
1789
1796
|
appName: appName.replace(/[\s-]/, "")
|
|
1790
1797
|
}), /*#__PURE__*/React.createElement(MonoAppName, {
|
|
1791
1798
|
appName: appName.replace(/[\s-]/, ""),
|
|
1792
1799
|
key: "mono-app-name",
|
|
1793
1800
|
size: 24
|
|
1794
|
-
})), /*#__PURE__*/React.createElement(DisclosureChevronIcon, {
|
|
1801
|
+
}))), /*#__PURE__*/React.createElement(DisclosureChevronIcon, {
|
|
1795
1802
|
className: styles$9.chevron,
|
|
1796
1803
|
key: "disclosure-chevron-icon"
|
|
1797
1804
|
}));
|
|
1798
1805
|
};
|
|
1799
1806
|
|
|
1800
1807
|
function getAppsSwitchProductPath(productName) {
|
|
1808
|
+
var _a, _b;
|
|
1801
1809
|
const basePath = `/apps/${productName.toLowerCase()}`;
|
|
1802
|
-
const referer = window
|
|
1810
|
+
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();
|
|
1803
1811
|
if (!referer) return basePath;
|
|
1804
1812
|
const params = new URLSearchParams();
|
|
1805
1813
|
params.append("referer", referer);
|
|
@@ -1823,14 +1831,15 @@ const HoverableListItem = ({
|
|
|
1823
1831
|
}) => {
|
|
1824
1832
|
const [entered, setEntered] = React.useState(false);
|
|
1825
1833
|
const getBackgroundColor = () => active ? "var(--t-fill-color-neutral-060)" : entered ? "var(--t-fill-color-neutral-080)" : "transparent";
|
|
1826
|
-
return /*#__PURE__*/React.createElement(C,
|
|
1834
|
+
return /*#__PURE__*/React.createElement(C, {
|
|
1827
1835
|
onMouseEnter: () => setEntered(true),
|
|
1828
1836
|
onMouseLeave: () => setEntered(false),
|
|
1829
1837
|
style: {
|
|
1830
1838
|
...style,
|
|
1831
1839
|
backgroundColor: getBackgroundColor()
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1840
|
+
},
|
|
1841
|
+
...nativeProps
|
|
1842
|
+
});
|
|
1834
1843
|
};
|
|
1835
1844
|
|
|
1836
1845
|
class Outsider extends React.Component {
|
|
@@ -1862,9 +1871,10 @@ class Outsider extends React.Component {
|
|
|
1862
1871
|
} else {
|
|
1863
1872
|
document.addEventListener("click", this.handleOutsideClick, true);
|
|
1864
1873
|
}
|
|
1865
|
-
return /*#__PURE__*/React.createElement("div",
|
|
1866
|
-
ref: c => this.container = c
|
|
1867
|
-
|
|
1874
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1875
|
+
ref: c => this.container = c,
|
|
1876
|
+
...props
|
|
1877
|
+
});
|
|
1868
1878
|
}
|
|
1869
1879
|
}
|
|
1870
1880
|
|
|
@@ -1875,17 +1885,19 @@ const Popup = ({
|
|
|
1875
1885
|
component: C = "div",
|
|
1876
1886
|
isVisible,
|
|
1877
1887
|
...nativeProps
|
|
1878
|
-
}) => /*#__PURE__*/React.createElement(C,
|
|
1888
|
+
}) => (/*#__PURE__*/React.createElement(C, {
|
|
1879
1889
|
className: classnames(styles$7.popup, {
|
|
1880
1890
|
[styles$7["is-visible"]]: isVisible
|
|
1881
|
-
}, className)
|
|
1882
|
-
|
|
1891
|
+
}, className),
|
|
1892
|
+
...nativeProps
|
|
1893
|
+
}));
|
|
1883
1894
|
|
|
1884
1895
|
const PopupRoot = ({
|
|
1885
1896
|
...nativeProps
|
|
1886
|
-
}) => /*#__PURE__*/React.createElement("div",
|
|
1887
|
-
className: styles$7["popup-root"]
|
|
1888
|
-
|
|
1897
|
+
}) => (/*#__PURE__*/React.createElement("div", {
|
|
1898
|
+
className: styles$7["popup-root"],
|
|
1899
|
+
...nativeProps
|
|
1900
|
+
}));
|
|
1889
1901
|
|
|
1890
1902
|
const AppsMenu = ({
|
|
1891
1903
|
appName,
|
|
@@ -1924,14 +1936,14 @@ const AppsMenu = ({
|
|
|
1924
1936
|
margin: 0,
|
|
1925
1937
|
padding: 0
|
|
1926
1938
|
}
|
|
1927
|
-
}, homeProduct && /*#__PURE__*/React.createElement(HoverableListItem, {
|
|
1939
|
+
}, homeProduct && (/*#__PURE__*/React.createElement(HoverableListItem, {
|
|
1928
1940
|
component: "a",
|
|
1929
1941
|
"data-pendo": `app-switcher--change-app--${homeProduct.name}`,
|
|
1930
1942
|
"data-turbolinks": false,
|
|
1931
1943
|
href: appName === homeProduct.name ? `${pcoUrl(env)("accounts")}/apps/${appName}` : pcoUrl(env)("accounts") + getAppsSwitchProductPath(homeProduct.name),
|
|
1932
1944
|
style: {
|
|
1933
1945
|
...listItemProps,
|
|
1934
|
-
borderBottom: "1px solid var(--t-border-color
|
|
1946
|
+
borderBottom: "1px solid var(--t-border-color)"
|
|
1935
1947
|
}
|
|
1936
1948
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1937
1949
|
style: {
|
|
@@ -1943,7 +1955,7 @@ const AppsMenu = ({
|
|
|
1943
1955
|
})), /*#__PURE__*/React.createElement(MonoAppName, {
|
|
1944
1956
|
appName: "Home",
|
|
1945
1957
|
size: 18
|
|
1946
|
-
})), restProducts.map(({
|
|
1958
|
+
}))), restProducts.map(({
|
|
1947
1959
|
name
|
|
1948
1960
|
}, i) => {
|
|
1949
1961
|
const isFirst = i === 0;
|
|
@@ -1971,14 +1983,14 @@ const AppsMenu = ({
|
|
|
1971
1983
|
appName: name.replace(/[\s-]/, ""),
|
|
1972
1984
|
size: 18
|
|
1973
1985
|
}));
|
|
1974
|
-
}), accountsProduct && /*#__PURE__*/React.createElement(HoverableListItem, {
|
|
1986
|
+
}), accountsProduct && (/*#__PURE__*/React.createElement(HoverableListItem, {
|
|
1975
1987
|
component: "a",
|
|
1976
1988
|
"data-pendo": `app-switcher--change-app--${accountsProduct.name}`,
|
|
1977
1989
|
"data-turbolinks": false,
|
|
1978
1990
|
href: pcoUrl(env)("accounts") + getAppsSwitchProductPath(accountsProduct.name),
|
|
1979
1991
|
style: {
|
|
1980
1992
|
...listItemProps,
|
|
1981
|
-
borderTop: "1px solid var(--t-border-color
|
|
1993
|
+
borderTop: "1px solid var(--t-border-color)",
|
|
1982
1994
|
padding: "0 12px",
|
|
1983
1995
|
textDecoration: "none"
|
|
1984
1996
|
}
|
|
@@ -1992,15 +2004,15 @@ const AppsMenu = ({
|
|
|
1992
2004
|
width: 22,
|
|
1993
2005
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1994
2006
|
}, /*#__PURE__*/React.createElement(Accounts$1, {
|
|
1995
|
-
color: "var(--t-icon-color-
|
|
2007
|
+
color: "var(--t-icon-color-secondary)",
|
|
1996
2008
|
key: "key2"
|
|
1997
2009
|
})), /*#__PURE__*/React.createElement("div", {
|
|
1998
2010
|
style: {
|
|
1999
|
-
color: "var(--t-text-color-
|
|
2011
|
+
color: "var(--t-text-color-secondary)",
|
|
2000
2012
|
fontSize: "12px",
|
|
2001
2013
|
lineHeight: "28px"
|
|
2002
2014
|
}
|
|
2003
|
-
}, "Account settings")))));
|
|
2015
|
+
}, "Account settings"))))));
|
|
2004
2016
|
};
|
|
2005
2017
|
|
|
2006
2018
|
const sortByAttribute = attr => arr => arr.slice().sort((a, b) => a[attr].localeCompare(b[attr]));
|
|
@@ -2025,7 +2037,7 @@ const useSetCurrentRouteInfo = ({
|
|
|
2025
2037
|
}) => ({
|
|
2026
2038
|
active,
|
|
2027
2039
|
name: key,
|
|
2028
|
-
url: to
|
|
2040
|
+
url: to !== null && to !== void 0 ? to : href
|
|
2029
2041
|
}))
|
|
2030
2042
|
};
|
|
2031
2043
|
}
|
|
@@ -2047,7 +2059,7 @@ function StyledRoot({
|
|
|
2047
2059
|
style,
|
|
2048
2060
|
...nativeProps
|
|
2049
2061
|
}) {
|
|
2050
|
-
return /*#__PURE__*/React.createElement("nav",
|
|
2062
|
+
return /*#__PURE__*/React.createElement("nav", {
|
|
2051
2063
|
className: "simple",
|
|
2052
2064
|
"data-pendo": "topbar",
|
|
2053
2065
|
"aria-label": "topbar-navigation",
|
|
@@ -2057,8 +2069,9 @@ function StyledRoot({
|
|
|
2057
2069
|
display: "flex",
|
|
2058
2070
|
height: "var(--topbar-height)",
|
|
2059
2071
|
...style
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2072
|
+
},
|
|
2073
|
+
...nativeProps
|
|
2074
|
+
}, /*#__PURE__*/React.createElement("style", null, `
|
|
2062
2075
|
@media only print {
|
|
2063
2076
|
.simple {
|
|
2064
2077
|
display: none !important;
|
|
@@ -2090,7 +2103,7 @@ const UserMenu = ({
|
|
|
2090
2103
|
cleanup: !userMenuVisible,
|
|
2091
2104
|
className: styles$5.popup,
|
|
2092
2105
|
isVisible: userMenuVisible
|
|
2093
|
-
}, /*#__PURE__*/React.createElement("div", null, hasConnectedPeople ? /*#__PURE__*/React.createElement("div", {
|
|
2106
|
+
}, /*#__PURE__*/React.createElement("div", null, hasConnectedPeople ? (/*#__PURE__*/React.createElement("div", {
|
|
2094
2107
|
style: {
|
|
2095
2108
|
alignItems: "center",
|
|
2096
2109
|
backgroundColor: "var(--t-fill-color-neutral-060)",
|
|
@@ -2101,7 +2114,7 @@ const UserMenu = ({
|
|
|
2101
2114
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2102
2115
|
style: {
|
|
2103
2116
|
...IEFlex1,
|
|
2104
|
-
color: "var(--t-text-color-
|
|
2117
|
+
color: "var(--t-text-color-secondary)",
|
|
2105
2118
|
fontSize: "12px",
|
|
2106
2119
|
textTransform: "uppercase",
|
|
2107
2120
|
whiteSpace: "nowrap",
|
|
@@ -2123,12 +2136,12 @@ const UserMenu = ({
|
|
|
2123
2136
|
e.preventDefault();
|
|
2124
2137
|
},
|
|
2125
2138
|
style: {
|
|
2126
|
-
color: "var(--t-text-color-
|
|
2139
|
+
color: "var(--t-text-color-secondary)",
|
|
2127
2140
|
marginLeft: "64px",
|
|
2128
2141
|
textDecoration: "none",
|
|
2129
2142
|
...fontFamily
|
|
2130
2143
|
}
|
|
2131
|
-
}, "unlink"))) : /*#__PURE__*/React.createElement("noscript", null), /*#__PURE__*/React.createElement("style", null, `
|
|
2144
|
+
}, "unlink")))) : (/*#__PURE__*/React.createElement("noscript", null)), /*#__PURE__*/React.createElement("style", null, `
|
|
2132
2145
|
.NotSmallTopbar__connected-people-list > *:first-child > * { border-top-width: 0 !important }
|
|
2133
2146
|
`), /*#__PURE__*/React.createElement("ul", {
|
|
2134
2147
|
className: "NotSmallTopbar__connected-people-list",
|
|
@@ -2140,7 +2153,7 @@ const UserMenu = ({
|
|
|
2140
2153
|
}, connectedPeopleMenuFormatter(connectedPeople).map(({
|
|
2141
2154
|
id,
|
|
2142
2155
|
attributes: person
|
|
2143
|
-
}) => /*#__PURE__*/React.createElement(HoverableListItem, {
|
|
2156
|
+
}) => (/*#__PURE__*/React.createElement(HoverableListItem, {
|
|
2144
2157
|
component: "li",
|
|
2145
2158
|
key: id
|
|
2146
2159
|
}, /*#__PURE__*/React.createElement("a", {
|
|
@@ -2152,8 +2165,8 @@ const UserMenu = ({
|
|
|
2152
2165
|
e.preventDefault();
|
|
2153
2166
|
},
|
|
2154
2167
|
style: {
|
|
2155
|
-
borderTop: "1px solid var(--t-border-color
|
|
2156
|
-
color: "var(--t-text-color
|
|
2168
|
+
borderTop: "1px solid var(--t-border-color)",
|
|
2169
|
+
color: "var(--t-text-color)",
|
|
2157
2170
|
display: "block",
|
|
2158
2171
|
lineHeight: "48px",
|
|
2159
2172
|
overflow: "hidden",
|
|
@@ -2164,7 +2177,7 @@ const UserMenu = ({
|
|
|
2164
2177
|
whiteSpace: "nowrap",
|
|
2165
2178
|
...fontFamily
|
|
2166
2179
|
}
|
|
2167
|
-
}, person.organization_name))))), /*#__PURE__*/React.createElement(tapestryReact.ThemeProvider, null, hasConnectedPeople && /*#__PURE__*/React.createElement(tapestryReact.Divider, null), /*#__PURE__*/React.createElement("form", {
|
|
2180
|
+
}, person.organization_name)))))), /*#__PURE__*/React.createElement(tapestryReact.ThemeProvider, null, hasConnectedPeople && /*#__PURE__*/React.createElement(tapestryReact.Divider, null), /*#__PURE__*/React.createElement("form", {
|
|
2168
2181
|
method: "POST",
|
|
2169
2182
|
action: logoutUrl
|
|
2170
2183
|
}, /*#__PURE__*/React.createElement(tapestryReact.Button, {
|
|
@@ -2194,11 +2207,11 @@ const UserMenu = ({
|
|
|
2194
2207
|
paddingVertical: 1.5,
|
|
2195
2208
|
spacing: 4
|
|
2196
2209
|
}, /*#__PURE__*/React.createElement(tapestryReact.Text, {
|
|
2197
|
-
color: "var(--t-text-color-
|
|
2210
|
+
color: "var(--t-text-color-secondary)",
|
|
2198
2211
|
lineHeight: "24px"
|
|
2199
2212
|
}, "Log out"), /*#__PURE__*/React.createElement(tapestryReact.Icon, {
|
|
2200
2213
|
name: "general.intoBox",
|
|
2201
|
-
fill: "var(--t-icon-color-
|
|
2214
|
+
fill: "var(--t-icon-color-secondary)"
|
|
2202
2215
|
})))))));
|
|
2203
2216
|
};
|
|
2204
2217
|
|
|
@@ -2209,15 +2222,17 @@ const Hoverable = ({
|
|
|
2209
2222
|
style = null,
|
|
2210
2223
|
...nativeProps
|
|
2211
2224
|
}) => {
|
|
2212
|
-
return /*#__PURE__*/React.createElement(C,
|
|
2225
|
+
return /*#__PURE__*/React.createElement(C, {
|
|
2213
2226
|
className: className,
|
|
2214
2227
|
style: {
|
|
2215
2228
|
...fontFamily,
|
|
2216
2229
|
...style
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2230
|
+
},
|
|
2231
|
+
...(innerRef && {
|
|
2232
|
+
ref: innerRef
|
|
2233
|
+
}),
|
|
2234
|
+
...nativeProps
|
|
2235
|
+
});
|
|
2221
2236
|
};
|
|
2222
2237
|
|
|
2223
2238
|
const UserMenuTrigger = ({
|
|
@@ -2245,9 +2260,9 @@ const UserMenuTrigger = ({
|
|
|
2245
2260
|
setUserMenuVisible(visible => !visible);
|
|
2246
2261
|
requestConnectedPeopleFetch();
|
|
2247
2262
|
}
|
|
2248
|
-
}, showOrgName && /*#__PURE__*/React.createElement("span", {
|
|
2263
|
+
}, showOrgName && (/*#__PURE__*/React.createElement("span", {
|
|
2249
2264
|
className: styles$5["trigger-orgname"]
|
|
2250
|
-
}, orgName), /*#__PURE__*/React.createElement(DisclosureChevronIcon, null)));
|
|
2265
|
+
}, orgName)), /*#__PURE__*/React.createElement(DisclosureChevronIcon, null)));
|
|
2251
2266
|
};
|
|
2252
2267
|
|
|
2253
2268
|
const NotSmallTopbar = ({
|
|
@@ -2340,9 +2355,10 @@ const NotSmallRoute = ({
|
|
|
2340
2355
|
colors,
|
|
2341
2356
|
...nativeProps
|
|
2342
2357
|
}) => {
|
|
2343
|
-
return /*#__PURE__*/React.createElement("a",
|
|
2344
|
-
className: classnames(styles$6["route"], className, active && styles$6["is-active"])
|
|
2345
|
-
|
|
2358
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
2359
|
+
className: classnames(styles$6["route"], className, active && styles$6["is-active"]),
|
|
2360
|
+
...nativeProps
|
|
2361
|
+
});
|
|
2346
2362
|
};
|
|
2347
2363
|
|
|
2348
2364
|
var styles$4 = {"avatar":"avatar-tW-wn"};
|
|
@@ -2354,19 +2370,17 @@ function Avatar({
|
|
|
2354
2370
|
...nativeProps
|
|
2355
2371
|
}) {
|
|
2356
2372
|
const url = incomingUrl || `${pcoUrl(env)("people")}/static/no_photo_thumbnail_gray.svg`;
|
|
2357
|
-
return /*#__PURE__*/React.createElement("div",
|
|
2373
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2358
2374
|
className: styles$4.avatar,
|
|
2359
2375
|
style: {
|
|
2360
2376
|
backgroundImage: `url(${url})`,
|
|
2361
2377
|
...style
|
|
2362
|
-
}
|
|
2363
|
-
|
|
2378
|
+
},
|
|
2379
|
+
...nativeProps
|
|
2380
|
+
});
|
|
2364
2381
|
}
|
|
2365
2382
|
|
|
2366
2383
|
class ClientStorage extends React.Component {
|
|
2367
|
-
static defaultProps = {
|
|
2368
|
-
method: "localStorage"
|
|
2369
|
-
};
|
|
2370
2384
|
update(value) {
|
|
2371
2385
|
window[this.props.method].setItem(this.props.item, JSON.stringify(value));
|
|
2372
2386
|
return this.forceUpdate();
|
|
@@ -2375,6 +2389,9 @@ class ClientStorage extends React.Component {
|
|
|
2375
2389
|
return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.render(JSON.parse(window[this.props.method].getItem(this.props.item)) || undefined, this.update.bind(this)));
|
|
2376
2390
|
}
|
|
2377
2391
|
}
|
|
2392
|
+
ClientStorage.defaultProps = {
|
|
2393
|
+
method: "localStorage"
|
|
2394
|
+
};
|
|
2378
2395
|
|
|
2379
2396
|
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"};
|
|
2380
2397
|
|
|
@@ -2394,16 +2411,16 @@ function AccountSettingsLink({
|
|
|
2394
2411
|
width: 24,
|
|
2395
2412
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2396
2413
|
}, /*#__PURE__*/React.createElement(Accounts$1, {
|
|
2397
|
-
color: "var(--t-icon-color-
|
|
2414
|
+
color: "var(--t-icon-color-secondary",
|
|
2398
2415
|
key: "key2"
|
|
2399
2416
|
})), /*#__PURE__*/React.createElement("span", null, "Account settings"));
|
|
2400
2417
|
}
|
|
2401
2418
|
|
|
2402
2419
|
const CloseMenuButton = ({
|
|
2403
|
-
color = "var(--t-icon-color-
|
|
2420
|
+
color = "var(--t-icon-color-dim)",
|
|
2404
2421
|
size = 24,
|
|
2405
2422
|
style = {}
|
|
2406
|
-
}) => /*#__PURE__*/React.createElement("button", {
|
|
2423
|
+
}) => (/*#__PURE__*/React.createElement("button", {
|
|
2407
2424
|
"aria-label": "Close menu",
|
|
2408
2425
|
type: "button",
|
|
2409
2426
|
className: styles$3["appmenu-close-button"],
|
|
@@ -2415,7 +2432,7 @@ const CloseMenuButton = ({
|
|
|
2415
2432
|
width: `${size}px`
|
|
2416
2433
|
},
|
|
2417
2434
|
"aria-hidden": "true"
|
|
2418
|
-
}));
|
|
2435
|
+
})));
|
|
2419
2436
|
|
|
2420
2437
|
const UserMenuAppLockup = ({
|
|
2421
2438
|
appName: originalAppName
|
|
@@ -2439,10 +2456,13 @@ const UserMenuAppLockup = ({
|
|
|
2439
2456
|
}));
|
|
2440
2457
|
};
|
|
2441
2458
|
const SmallTopbar = ({
|
|
2442
|
-
currentRouteComponent = props => /*#__PURE__*/React.createElement("span",
|
|
2459
|
+
currentRouteComponent = props => (/*#__PURE__*/React.createElement("span", {
|
|
2460
|
+
...props
|
|
2461
|
+
})),
|
|
2443
2462
|
linkToProfile = true,
|
|
2444
2463
|
...props
|
|
2445
2464
|
}) => {
|
|
2465
|
+
var _a, _b;
|
|
2446
2466
|
const [routesMenuVisible, setRoutesMenuVisible] = React.useState(false);
|
|
2447
2467
|
const [productSwitcherVisible, setProductSwitcherVisible] = React.useState(false);
|
|
2448
2468
|
const activeRoute = props.routes.filter(({
|
|
@@ -2467,7 +2487,7 @@ const SmallTopbar = ({
|
|
|
2467
2487
|
}) => name !== "Home" && name !== "Accounts");
|
|
2468
2488
|
React.useEffect(() => {
|
|
2469
2489
|
setRoutesMenuVisible(false);
|
|
2470
|
-
}, [activeRoute && activeRoute[0]
|
|
2490
|
+
}, [activeRoute && ((_b = (_a = activeRoute[0]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.href)]);
|
|
2471
2491
|
return /*#__PURE__*/React.createElement(StyledRoot, {
|
|
2472
2492
|
style: {
|
|
2473
2493
|
...props.style
|
|
@@ -2483,11 +2503,11 @@ const SmallTopbar = ({
|
|
|
2483
2503
|
}
|
|
2484
2504
|
}, /*#__PURE__*/React.createElement(ColorAppIcon, {
|
|
2485
2505
|
appName: props.appName.replace(/[\s-]/, "")
|
|
2486
|
-
})), routesMenuVisible && /*#__PURE__*/React.createElement("div", {
|
|
2506
|
+
})), routesMenuVisible && (/*#__PURE__*/React.createElement("div", {
|
|
2487
2507
|
className: styles$3["routes"]
|
|
2488
|
-
}, props.routes), /*#__PURE__*/React.createElement(ClientStorage, {
|
|
2508
|
+
}, props.routes)), /*#__PURE__*/React.createElement(ClientStorage, {
|
|
2489
2509
|
item: "Topbar:Small:Menus:Products:visibility",
|
|
2490
|
-
render: () => /*#__PURE__*/React.createElement("div", {
|
|
2510
|
+
render: () => (/*#__PURE__*/React.createElement("div", {
|
|
2491
2511
|
className: styles$3["appmenu-layer"],
|
|
2492
2512
|
style: {
|
|
2493
2513
|
...(productSwitcherVisible && {
|
|
@@ -2508,10 +2528,10 @@ const SmallTopbar = ({
|
|
|
2508
2528
|
},
|
|
2509
2529
|
className: styles$3["appmenu-container"]
|
|
2510
2530
|
}, /*#__PURE__*/React.createElement("a", {
|
|
2511
|
-
"data-pendo": `app-switcher--change-app--${homeProduct
|
|
2531
|
+
"data-pendo": `app-switcher--change-app--${homeProduct === null || homeProduct === void 0 ? void 0 : homeProduct.name}`,
|
|
2512
2532
|
"data-turbolinks": false,
|
|
2513
2533
|
className: classnames(styles$3["appmenu-list-a"], styles$3["appmenu-list-a--top"]),
|
|
2514
|
-
href: homeProduct ? pcoUrl(props.env)("accounts") + getAppsSwitchProductPath(homeProduct
|
|
2534
|
+
href: homeProduct ? pcoUrl(props.env)("accounts") + getAppsSwitchProductPath(homeProduct === null || homeProduct === void 0 ? void 0 : homeProduct.name) : undefined
|
|
2515
2535
|
}, /*#__PURE__*/React.createElement(UserMenuAppLockup, {
|
|
2516
2536
|
appName: homeProduct ? homeProduct.name : props.appName
|
|
2517
2537
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -2521,7 +2541,7 @@ const SmallTopbar = ({
|
|
|
2521
2541
|
className: styles$3["appmenu-list"]
|
|
2522
2542
|
}, appsMenuFormatter(restProducts).map(({
|
|
2523
2543
|
name
|
|
2524
|
-
}) => /*#__PURE__*/React.createElement("li", {
|
|
2544
|
+
}) => (/*#__PURE__*/React.createElement("li", {
|
|
2525
2545
|
key: name,
|
|
2526
2546
|
className: styles$3["appmenu-list-li"]
|
|
2527
2547
|
}, /*#__PURE__*/React.createElement("a", {
|
|
@@ -2531,11 +2551,11 @@ const SmallTopbar = ({
|
|
|
2531
2551
|
href: pcoUrl(props.env)("accounts") + getAppsSwitchProductPath(name)
|
|
2532
2552
|
}, /*#__PURE__*/React.createElement(UserMenuAppLockup, {
|
|
2533
2553
|
appName: name
|
|
2534
|
-
})))), accountsProduct && /*#__PURE__*/React.createElement("li", {
|
|
2554
|
+
}))))), accountsProduct && (/*#__PURE__*/React.createElement("li", {
|
|
2535
2555
|
className: styles$3["appmenu-list-li"]
|
|
2536
2556
|
}, /*#__PURE__*/React.createElement(AccountSettingsLink, {
|
|
2537
2557
|
env: props.env
|
|
2538
|
-
}))))))
|
|
2558
|
+
}))))))))
|
|
2539
2559
|
}), /*#__PURE__*/React.createElement("button", {
|
|
2540
2560
|
type: "button",
|
|
2541
2561
|
className: classnames(styles$3["current-route"], {
|
|
@@ -2548,7 +2568,10 @@ const SmallTopbar = ({
|
|
|
2548
2568
|
}, /*#__PURE__*/React.createElement(CurrentRouteComponent, null, capitalize(currentRouteText)), props.routes.length > 0 && /*#__PURE__*/React.createElement(DisclosureChevronIcon, null)), /*#__PURE__*/React.createElement("button", {
|
|
2549
2569
|
type: "button",
|
|
2550
2570
|
className: styles$3["profile-button"],
|
|
2551
|
-
onClick: () =>
|
|
2571
|
+
onClick: () => {
|
|
2572
|
+
var _a, _b;
|
|
2573
|
+
return (_b = (_a = window.topbar) === null || _a === void 0 ? void 0 : _a.openProfile) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
2574
|
+
}
|
|
2552
2575
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
2553
2576
|
env: props.env,
|
|
2554
2577
|
url: props.userAvatarPath
|
|
@@ -2558,17 +2581,19 @@ const SmallRoute = ({
|
|
|
2558
2581
|
active,
|
|
2559
2582
|
className,
|
|
2560
2583
|
...props
|
|
2561
|
-
}) => /*#__PURE__*/React.createElement("a",
|
|
2562
|
-
className: classnames(styles$3["route"], className, active && styles$3["is-active"])
|
|
2563
|
-
|
|
2584
|
+
}) => (/*#__PURE__*/React.createElement("a", {
|
|
2585
|
+
className: classnames(styles$3["route"], className, active && styles$3["is-active"]),
|
|
2586
|
+
...props
|
|
2587
|
+
}));
|
|
2564
2588
|
|
|
2565
2589
|
function getLoginProfilePath({
|
|
2566
2590
|
env,
|
|
2567
2591
|
appName,
|
|
2568
2592
|
userId
|
|
2569
2593
|
}) {
|
|
2594
|
+
var _a, _b;
|
|
2570
2595
|
const basePath = pcoUrl(env)("login") + `/people/AC${userId}`;
|
|
2571
|
-
const pathname = window
|
|
2596
|
+
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();
|
|
2572
2597
|
if (!pathname) return basePath;
|
|
2573
2598
|
const params = new URLSearchParams();
|
|
2574
2599
|
params.append("return", `${appName}/${pathname}`);
|
|
@@ -2673,7 +2698,7 @@ const topbarTheme = {
|
|
|
2673
2698
|
baseColor: "#2266f7",
|
|
2674
2699
|
key: "primary"
|
|
2675
2700
|
}),
|
|
2676
|
-
separatorTertiary: "var(--t-border-color
|
|
2701
|
+
separatorTertiary: "var(--t-border-color)"
|
|
2677
2702
|
},
|
|
2678
2703
|
icons: {
|
|
2679
2704
|
churchCenter: churchCenter__namespace,
|
|
@@ -2701,9 +2726,10 @@ function DrawerWrap({
|
|
|
2701
2726
|
className,
|
|
2702
2727
|
...props
|
|
2703
2728
|
}) {
|
|
2704
|
-
return /*#__PURE__*/React.createElement("div",
|
|
2705
|
-
className: classnames(styles$2["drawer-wrap"], className, isVisible && styles$2["is-visible"])
|
|
2706
|
-
|
|
2729
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2730
|
+
className: classnames(styles$2["drawer-wrap"], className, isVisible && styles$2["is-visible"]),
|
|
2731
|
+
...props
|
|
2732
|
+
}, children);
|
|
2707
2733
|
}
|
|
2708
2734
|
|
|
2709
2735
|
function DrawerHeader({
|
|
@@ -2719,9 +2745,9 @@ function DrawerHeader({
|
|
|
2719
2745
|
paddingTop: 1
|
|
2720
2746
|
}, /*#__PURE__*/React.createElement(tapestryReact.Box, {
|
|
2721
2747
|
flex: 1
|
|
2722
|
-
}, children), closeDrawer && /*#__PURE__*/React.createElement(tapestryReact.Button, {
|
|
2748
|
+
}, children), closeDrawer && (/*#__PURE__*/React.createElement(tapestryReact.Button, {
|
|
2723
2749
|
icon: {
|
|
2724
|
-
fill: "var(--t-icon-color-
|
|
2750
|
+
fill: "var(--t-icon-color-dim)",
|
|
2725
2751
|
name: "general.x",
|
|
2726
2752
|
size: "md"
|
|
2727
2753
|
},
|
|
@@ -2732,25 +2758,25 @@ function DrawerHeader({
|
|
|
2732
2758
|
backgroundColor: "var(--t-fill-color-neutral-070)"
|
|
2733
2759
|
},
|
|
2734
2760
|
marginTop: 0.25
|
|
2735
|
-
}));
|
|
2761
|
+
})));
|
|
2736
2762
|
}
|
|
2737
2763
|
|
|
2738
2764
|
function DrawerHeading({
|
|
2739
2765
|
children,
|
|
2740
2766
|
...props
|
|
2741
2767
|
}) {
|
|
2742
|
-
return /*#__PURE__*/React.createElement(tapestryReact.Heading,
|
|
2743
|
-
color: "var(--t-text-color-
|
|
2768
|
+
return /*#__PURE__*/React.createElement(tapestryReact.Heading, {
|
|
2769
|
+
color: "var(--t-text-color-headline)",
|
|
2744
2770
|
letterSpacing: ".002em",
|
|
2745
2771
|
level: 2,
|
|
2746
2772
|
lineHeight: "35px",
|
|
2747
|
-
weight: 700
|
|
2748
|
-
|
|
2773
|
+
weight: 700,
|
|
2774
|
+
...props
|
|
2775
|
+
}, children);
|
|
2749
2776
|
}
|
|
2750
2777
|
|
|
2751
2778
|
// TODO: This component could prob be genrealized to provide overflow-y scroll indication, as well, if needed.
|
|
2752
2779
|
// `top`/`bottom` // `left`/`right` → `start`/`end`
|
|
2753
|
-
|
|
2754
2780
|
const INDICATOR_STYLES = {
|
|
2755
2781
|
bottom: {
|
|
2756
2782
|
background: "linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.07))",
|
|
@@ -2771,22 +2797,20 @@ const ScrollContainer = ({
|
|
|
2771
2797
|
const containerRef = React.useRef(null);
|
|
2772
2798
|
const bottomEdgeRef = React.useRef(null);
|
|
2773
2799
|
const topEdgeRef = React.useRef(null);
|
|
2774
|
-
|
|
2775
2800
|
// Perf: should this be debounced?
|
|
2776
2801
|
const handleResize = () => {
|
|
2777
|
-
const container = containerRef
|
|
2802
|
+
const container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
2778
2803
|
if (container) {
|
|
2779
2804
|
const hasOverflowBottom = container.scrollHeight - container.clientHeight > container.scrollTop + 1;
|
|
2780
2805
|
setOverflowBottom(hasOverflowBottom);
|
|
2781
2806
|
}
|
|
2782
2807
|
};
|
|
2783
2808
|
React.useEffect(() => {
|
|
2784
|
-
const container = containerRef
|
|
2809
|
+
const container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
2785
2810
|
if (!container) {
|
|
2786
2811
|
return () => {}; // noop
|
|
2787
2812
|
}
|
|
2788
2813
|
setOverflowBottom(container.scrollHeight > container.clientHeight);
|
|
2789
|
-
|
|
2790
2814
|
// setup intersection observers
|
|
2791
2815
|
const options = {
|
|
2792
2816
|
root: container,
|
|
@@ -2798,15 +2822,14 @@ const ScrollContainer = ({
|
|
|
2798
2822
|
const topObserver = new IntersectionObserver(([{
|
|
2799
2823
|
isIntersecting
|
|
2800
2824
|
}]) => setOverflowTop(!isIntersecting), options);
|
|
2801
|
-
const bottomTarget = bottomEdgeRef
|
|
2802
|
-
const topTarget = topEdgeRef
|
|
2825
|
+
const bottomTarget = bottomEdgeRef === null || bottomEdgeRef === void 0 ? void 0 : bottomEdgeRef.current;
|
|
2826
|
+
const topTarget = topEdgeRef === null || topEdgeRef === void 0 ? void 0 : topEdgeRef.current;
|
|
2803
2827
|
if (bottomTarget) {
|
|
2804
2828
|
bottomObserver.observe(bottomTarget);
|
|
2805
2829
|
}
|
|
2806
2830
|
if (topTarget) {
|
|
2807
2831
|
topObserver.observe(topTarget);
|
|
2808
2832
|
}
|
|
2809
|
-
|
|
2810
2833
|
// setup resize observer
|
|
2811
2834
|
const resizeObserver = new ResizeObserver(handleResize);
|
|
2812
2835
|
resizeObserver.observe(container);
|
|
@@ -2828,7 +2851,7 @@ const ScrollContainer = ({
|
|
|
2828
2851
|
edge: "top"
|
|
2829
2852
|
}), overflowBottom && /*#__PURE__*/React.createElement(OverflowIndicator, {
|
|
2830
2853
|
edge: "bottom"
|
|
2831
|
-
}), /*#__PURE__*/React.createElement(tapestryReact.StackView,
|
|
2854
|
+
}), /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
2832
2855
|
basis: 2,
|
|
2833
2856
|
grow: 1,
|
|
2834
2857
|
innerRef: containerRef,
|
|
@@ -2837,8 +2860,9 @@ const ScrollContainer = ({
|
|
|
2837
2860
|
shrink: 1,
|
|
2838
2861
|
css: {
|
|
2839
2862
|
overscrollBehavior: "contain"
|
|
2840
|
-
}
|
|
2841
|
-
|
|
2863
|
+
},
|
|
2864
|
+
...props
|
|
2865
|
+
}, /*#__PURE__*/React.createElement(tapestryReact.Box, {
|
|
2842
2866
|
innerRef: topEdgeRef
|
|
2843
2867
|
}), children, /*#__PURE__*/React.createElement(tapestryReact.Box, {
|
|
2844
2868
|
innerRef: bottomEdgeRef
|
|
@@ -2847,15 +2871,16 @@ const ScrollContainer = ({
|
|
|
2847
2871
|
const OverflowIndicator = ({
|
|
2848
2872
|
edge
|
|
2849
2873
|
}) => {
|
|
2850
|
-
return /*#__PURE__*/React.createElement(tapestryReact.Box,
|
|
2874
|
+
return /*#__PURE__*/React.createElement(tapestryReact.Box, {
|
|
2851
2875
|
height: 1,
|
|
2852
2876
|
left: 0,
|
|
2853
2877
|
pointerEvents: "none",
|
|
2854
2878
|
position: "absolute",
|
|
2855
2879
|
right: 0,
|
|
2856
2880
|
role: "presentation",
|
|
2857
|
-
zIndex: 10
|
|
2858
|
-
|
|
2881
|
+
zIndex: 10,
|
|
2882
|
+
...INDICATOR_STYLES[edge]
|
|
2883
|
+
});
|
|
2859
2884
|
};
|
|
2860
2885
|
|
|
2861
2886
|
const SwitchView = ({
|
|
@@ -2886,7 +2911,7 @@ const SwitchView = ({
|
|
|
2886
2911
|
}));
|
|
2887
2912
|
};
|
|
2888
2913
|
|
|
2889
|
-
var styles$1 = {"color-mode-switcher":"color-mode-switcher-JpczO","color-mode-switcher-label":"color-mode-switcher-label-3jPM2","color-mode-switcher-
|
|
2914
|
+
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"};
|
|
2890
2915
|
|
|
2891
2916
|
const COLOR_MODES = [{
|
|
2892
2917
|
label: "Light",
|
|
@@ -2901,8 +2926,7 @@ const COLOR_MODES = [{
|
|
|
2901
2926
|
let COLOR_MODE_INSTANCE_COUNTER = 0;
|
|
2902
2927
|
function ColorModeSwitcher() {
|
|
2903
2928
|
const {
|
|
2904
|
-
colorMode
|
|
2905
|
-
colorModeLaunched
|
|
2929
|
+
colorMode
|
|
2906
2930
|
} = useStore();
|
|
2907
2931
|
const updateStore = useUpdateStore();
|
|
2908
2932
|
const [counter] = React.useState(() => COLOR_MODE_INSTANCE_COUNTER++);
|
|
@@ -2910,14 +2934,12 @@ function ColorModeSwitcher() {
|
|
|
2910
2934
|
className: styles$1["color-mode-switcher"]
|
|
2911
2935
|
}, /*#__PURE__*/React.createElement("legend", {
|
|
2912
2936
|
className: styles$1["color-mode-switcher-label"]
|
|
2913
|
-
}, "Appearance", " ",
|
|
2914
|
-
className: styles$1["color-mode-switcher-label-beta"]
|
|
2915
|
-
}, "beta")), /*#__PURE__*/React.createElement("div", {
|
|
2937
|
+
}, "Appearance", " "), /*#__PURE__*/React.createElement("div", {
|
|
2916
2938
|
className: styles$1["color-mode-switcher-modes"]
|
|
2917
2939
|
}, COLOR_MODES.map(({
|
|
2918
2940
|
value,
|
|
2919
2941
|
label
|
|
2920
|
-
}) => /*#__PURE__*/React.createElement("label", {
|
|
2942
|
+
}) => (/*#__PURE__*/React.createElement("label", {
|
|
2921
2943
|
key: value
|
|
2922
2944
|
}, /*#__PURE__*/React.createElement("input", {
|
|
2923
2945
|
name: `color-mode-${counter}`,
|
|
@@ -2934,7 +2956,7 @@ function ColorModeSwitcher() {
|
|
|
2934
2956
|
}
|
|
2935
2957
|
}), /*#__PURE__*/React.createElement(ColorModeIcon, {
|
|
2936
2958
|
mode: value
|
|
2937
|
-
}), label))));
|
|
2959
|
+
}), label)))));
|
|
2938
2960
|
}
|
|
2939
2961
|
function updateColorMode(mode) {
|
|
2940
2962
|
return apiRequest(railsCsrfFetch, `${window.location.origin}/~api/people/v2/me/color_mode`, {
|
|
@@ -2988,8 +3010,7 @@ function UserProfile({
|
|
|
2988
3010
|
}) {
|
|
2989
3011
|
const {
|
|
2990
3012
|
mfaConfigured,
|
|
2991
|
-
name
|
|
2992
|
-
colorModeSelectionEnabled
|
|
3013
|
+
name
|
|
2993
3014
|
} = useStore();
|
|
2994
3015
|
return /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
2995
3016
|
axis: "vertical",
|
|
@@ -3013,17 +3034,17 @@ function UserProfile({
|
|
|
3013
3034
|
}, /*#__PURE__*/React.createElement(DrawerHeading, {
|
|
3014
3035
|
paddingTop: 0.5,
|
|
3015
3036
|
lineHeight: 3.25
|
|
3016
|
-
}, name), linkToProfile && /*#__PURE__*/React.createElement(tapestryReact.Link, {
|
|
3037
|
+
}, name), linkToProfile && (/*#__PURE__*/React.createElement(tapestryReact.Link, {
|
|
3017
3038
|
to: profileUrl,
|
|
3018
3039
|
style: {
|
|
3019
|
-
color: "var(--t-icon-color-
|
|
3040
|
+
color: "var(--t-icon-color-secondary)"
|
|
3020
3041
|
},
|
|
3021
3042
|
size: 3,
|
|
3022
3043
|
onClick: () => setTimeout(() => closeDrawer(), 50)
|
|
3023
|
-
}, "My profile"), /*#__PURE__*/React.createElement(tapestryReact.Link, {
|
|
3044
|
+
}, "My profile")), /*#__PURE__*/React.createElement(tapestryReact.Link, {
|
|
3024
3045
|
to: loginSettingsUrl,
|
|
3025
3046
|
style: {
|
|
3026
|
-
color: "var(--t-icon-color-
|
|
3047
|
+
color: "var(--t-icon-color-secondary)"
|
|
3027
3048
|
},
|
|
3028
3049
|
size: 3
|
|
3029
3050
|
}, "My login settings"), /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
@@ -3034,15 +3055,15 @@ function UserProfile({
|
|
|
3034
3055
|
}, /*#__PURE__*/React.createElement(tapestryReact.Icon, {
|
|
3035
3056
|
name: mfaConfigured ? "general.lock" : "general.unlock",
|
|
3036
3057
|
size: "sm",
|
|
3037
|
-
color: mfaConfigured ? "var(--t-icon-color-status-success
|
|
3058
|
+
color: mfaConfigured ? "var(--t-icon-color-status-success)" : "var(--t-icon-color-status-error)"
|
|
3038
3059
|
}), /*#__PURE__*/React.createElement(tapestryReact.Text, {
|
|
3039
3060
|
size: 4,
|
|
3040
3061
|
weight: 400,
|
|
3041
|
-
color: "var(--t-text-color-
|
|
3062
|
+
color: "var(--t-text-color-secondary)",
|
|
3042
3063
|
wrap: true
|
|
3043
3064
|
}, "Two-step verification ", mfaConfigured ? "active" : "inactive"))), /*#__PURE__*/React.createElement(tapestryReact.Button, {
|
|
3044
3065
|
icon: {
|
|
3045
|
-
fill: "var(--t-icon-color-
|
|
3066
|
+
fill: "var(--t-icon-color-dim)",
|
|
3046
3067
|
name: "general.x",
|
|
3047
3068
|
size: "md"
|
|
3048
3069
|
},
|
|
@@ -3054,7 +3075,7 @@ function UserProfile({
|
|
|
3054
3075
|
hover: {
|
|
3055
3076
|
backgroundColor: "var(--t-fill-color-neutral-070)"
|
|
3056
3077
|
}
|
|
3057
|
-
})),
|
|
3078
|
+
})), /*#__PURE__*/React.createElement(tapestryReact.GridView, {
|
|
3058
3079
|
padding: 2
|
|
3059
3080
|
}, /*#__PURE__*/React.createElement(ColorModeSwitcher, null)), /*#__PURE__*/React.createElement("form", {
|
|
3060
3081
|
method: "POST",
|
|
@@ -3084,8 +3105,8 @@ function UserProfile({
|
|
|
3084
3105
|
size: 3
|
|
3085
3106
|
}, "Log out"), /*#__PURE__*/React.createElement(tapestryReact.Icon, {
|
|
3086
3107
|
name: "general.intoBox",
|
|
3087
|
-
fill: "var(--t-icon-color-
|
|
3088
|
-
})))), hasConnectedPeople && /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3108
|
+
fill: "var(--t-icon-color-secondary)"
|
|
3109
|
+
})))), hasConnectedPeople && (/*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3089
3110
|
mediaQueries: {
|
|
3090
3111
|
sm: {
|
|
3091
3112
|
display: "none"
|
|
@@ -3106,7 +3127,7 @@ function UserProfile({
|
|
|
3106
3127
|
}, connectedPeopleMenuFormatter(connectedPeople).map(({
|
|
3107
3128
|
id,
|
|
3108
3129
|
attributes: person
|
|
3109
|
-
}) => /*#__PURE__*/React.createElement(tapestryReact.List.Item, {
|
|
3130
|
+
}) => (/*#__PURE__*/React.createElement(tapestryReact.List.Item, {
|
|
3110
3131
|
key: id,
|
|
3111
3132
|
onClick: e => {
|
|
3112
3133
|
requestClearAppsCache();
|
|
@@ -3118,7 +3139,7 @@ function UserProfile({
|
|
|
3118
3139
|
padding: 2
|
|
3119
3140
|
}, /*#__PURE__*/React.createElement(tapestryReact.Text, {
|
|
3120
3141
|
truncate: true
|
|
3121
|
-
}, person.organization_name))), /*#__PURE__*/React.createElement(tapestryReact.List.Item, {
|
|
3142
|
+
}, person.organization_name)))), /*#__PURE__*/React.createElement(tapestryReact.List.Item, {
|
|
3122
3143
|
onClick: e => {
|
|
3123
3144
|
requestClearAppsCache();
|
|
3124
3145
|
requestClearConnectedPeopleCache();
|
|
@@ -3130,16 +3151,16 @@ function UserProfile({
|
|
|
3130
3151
|
underline: false
|
|
3131
3152
|
}, /*#__PURE__*/React.createElement(tapestryReact.Text, {
|
|
3132
3153
|
size: 3
|
|
3133
|
-
}, "Unlink my accounts")))));
|
|
3154
|
+
}, "Unlink my accounts"))))));
|
|
3134
3155
|
}
|
|
3135
3156
|
|
|
3136
|
-
var ActionType
|
|
3157
|
+
var ActionType;
|
|
3158
|
+
(function (ActionType) {
|
|
3137
3159
|
ActionType["close"] = "close";
|
|
3138
3160
|
ActionType["mount"] = "mount";
|
|
3139
3161
|
ActionType["open"] = "open";
|
|
3140
3162
|
ActionType["unmount"] = "unmount";
|
|
3141
|
-
|
|
3142
|
-
}(ActionType || {});
|
|
3163
|
+
})(ActionType || (ActionType = {}));
|
|
3143
3164
|
const initialState = {
|
|
3144
3165
|
currentContent: null,
|
|
3145
3166
|
open: false
|
|
@@ -3237,7 +3258,7 @@ const CustomSearchBox = ({
|
|
|
3237
3258
|
hits,
|
|
3238
3259
|
results
|
|
3239
3260
|
} = reactInstantsearchCore.useHits();
|
|
3240
|
-
const groups = results
|
|
3261
|
+
const groups = results === null || results === void 0 ? void 0 : results.hits.reduce((acc, hit) => {
|
|
3241
3262
|
const key = hit.category.title;
|
|
3242
3263
|
if (!acc[key]) {
|
|
3243
3264
|
acc[key] = [];
|
|
@@ -3262,7 +3283,7 @@ const CustomSearchBox = ({
|
|
|
3262
3283
|
onChange: e => setQuery(e.target.value),
|
|
3263
3284
|
onSelect: selectedValue => handleSearchSelect(selectedValue, indexName),
|
|
3264
3285
|
placement: "bottom-start"
|
|
3265
|
-
}, !hits.length && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3286
|
+
}, !hits.length && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3266
3287
|
axis: "horizontal",
|
|
3267
3288
|
alignment: "center",
|
|
3268
3289
|
paddingHorizontal: 2,
|
|
@@ -3271,7 +3292,7 @@ const CustomSearchBox = ({
|
|
|
3271
3292
|
color: "neutralDarker",
|
|
3272
3293
|
size: 4,
|
|
3273
3294
|
whiteSpace: "normal"
|
|
3274
|
-
}, "No results match your search"))), groups && Object.keys(groups).map(key => {
|
|
3295
|
+
}, "No results match your search")))), groups && Object.keys(groups).map(key => {
|
|
3275
3296
|
const hits = groups[key];
|
|
3276
3297
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
3277
3298
|
key: key
|
|
@@ -3290,11 +3311,11 @@ const CustomSearchBox = ({
|
|
|
3290
3311
|
size: 5,
|
|
3291
3312
|
color: "foregroundSecondary",
|
|
3292
3313
|
fontWeight: 500
|
|
3293
|
-
}, key)), hits.map(hit => /*#__PURE__*/React.createElement(HitResult, {
|
|
3314
|
+
}, key)), hits.map(hit => (/*#__PURE__*/React.createElement(HitResult, {
|
|
3294
3315
|
key: hit.objectID,
|
|
3295
3316
|
hit: hit,
|
|
3296
3317
|
index: resultIndex++
|
|
3297
|
-
})));
|
|
3318
|
+
}))));
|
|
3298
3319
|
})));
|
|
3299
3320
|
};
|
|
3300
3321
|
|
|
@@ -3373,15 +3394,16 @@ const Eyebrow = ({
|
|
|
3373
3394
|
dark,
|
|
3374
3395
|
style,
|
|
3375
3396
|
...props
|
|
3376
|
-
}) => /*#__PURE__*/React.createElement("div",
|
|
3397
|
+
}) => (/*#__PURE__*/React.createElement("div", {
|
|
3377
3398
|
style: {
|
|
3378
|
-
color: "var(--t-text-color
|
|
3399
|
+
color: "var(--t-text-color)",
|
|
3379
3400
|
fontSize: "12px",
|
|
3380
3401
|
fontWeight: 400,
|
|
3381
3402
|
textTransform: "uppercase",
|
|
3382
3403
|
...style
|
|
3383
|
-
}
|
|
3384
|
-
|
|
3404
|
+
},
|
|
3405
|
+
...props
|
|
3406
|
+
}));
|
|
3385
3407
|
|
|
3386
3408
|
const NotificationItem = ({
|
|
3387
3409
|
mobile = false,
|
|
@@ -3431,7 +3453,7 @@ const NotificationItem = ({
|
|
|
3431
3453
|
onClick: handleClick,
|
|
3432
3454
|
style: {
|
|
3433
3455
|
alignItems: "flex-start",
|
|
3434
|
-
borderBottom: showBottomBorder || !isLast ? "1px solid var(--t-border-color
|
|
3456
|
+
borderBottom: showBottomBorder || !isLast ? "1px solid var(--t-border-color)" : "none",
|
|
3435
3457
|
cursor: "pointer",
|
|
3436
3458
|
display: "flex",
|
|
3437
3459
|
overflow: "hidden",
|
|
@@ -3468,14 +3490,14 @@ const NotificationItem = ({
|
|
|
3468
3490
|
}
|
|
3469
3491
|
}, appName), /*#__PURE__*/React.createElement("h1", {
|
|
3470
3492
|
style: {
|
|
3471
|
-
color: "var(--t-text-color-
|
|
3493
|
+
color: "var(--t-text-color-headline)",
|
|
3472
3494
|
fontSize: "16px",
|
|
3473
3495
|
fontWeight: 500,
|
|
3474
3496
|
lineHeight: "1.3em",
|
|
3475
3497
|
margin: 0,
|
|
3476
3498
|
userSelect: "none"
|
|
3477
3499
|
}
|
|
3478
|
-
}, title)), !mobile && /*#__PURE__*/React.createElement(tapestryReact.Dropdown, {
|
|
3500
|
+
}, title)), !mobile && (/*#__PURE__*/React.createElement(tapestryReact.Dropdown, {
|
|
3479
3501
|
icon: {
|
|
3480
3502
|
name: "general.threeDots"
|
|
3481
3503
|
},
|
|
@@ -3492,21 +3514,21 @@ const NotificationItem = ({
|
|
|
3492
3514
|
e.stopPropagation();
|
|
3493
3515
|
onToggleRead();
|
|
3494
3516
|
}
|
|
3495
|
-
}, "Mark ", isRead ? "unread" : "as read"), notification.taskUrl ? /*#__PURE__*/React.createElement(tapestryReact.Dropdown.Item, {
|
|
3517
|
+
}, "Mark ", isRead ? "unread" : "as read"), notification.taskUrl ? (/*#__PURE__*/React.createElement(tapestryReact.Dropdown.Item, {
|
|
3496
3518
|
onClick: e => {
|
|
3497
3519
|
e.preventDefault();
|
|
3498
3520
|
e.stopPropagation();
|
|
3499
3521
|
window.location.href = notification.taskUrl;
|
|
3500
3522
|
}
|
|
3501
|
-
}, "Open task") : /*#__PURE__*/React.createElement(tapestryReact.Dropdown.Item, {
|
|
3523
|
+
}, "Open task")) : (/*#__PURE__*/React.createElement(tapestryReact.Dropdown.Item, {
|
|
3502
3524
|
onClick: e => {
|
|
3503
3525
|
e.preventDefault();
|
|
3504
3526
|
e.stopPropagation();
|
|
3505
3527
|
onCreateTask(notification);
|
|
3506
3528
|
}
|
|
3507
|
-
}, "Create task"))), /*#__PURE__*/React.createElement("div", {
|
|
3529
|
+
}, "Create task"))))), /*#__PURE__*/React.createElement("div", {
|
|
3508
3530
|
style: {
|
|
3509
|
-
color: "var(--t-text-color
|
|
3531
|
+
color: "var(--t-text-color)",
|
|
3510
3532
|
fontSize: "12px",
|
|
3511
3533
|
paddingLeft: "12px",
|
|
3512
3534
|
userSelect: "none"
|
|
@@ -3518,22 +3540,22 @@ const NotificationsMenuBlankState = ({
|
|
|
3518
3540
|
context,
|
|
3519
3541
|
description,
|
|
3520
3542
|
title = "No notifications"
|
|
3521
|
-
}) => /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3543
|
+
}) => (/*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3522
3544
|
alignment: "center",
|
|
3523
3545
|
distribution: "center",
|
|
3524
3546
|
padding: 4
|
|
3525
3547
|
}, /*#__PURE__*/React.createElement(BlankStateIcon, {
|
|
3526
3548
|
id: context
|
|
3527
3549
|
}), /*#__PURE__*/React.createElement(tapestryReact.Heading, {
|
|
3528
|
-
color: "var(--t-text-color-
|
|
3550
|
+
color: "var(--t-text-color-headline)",
|
|
3529
3551
|
fontWeight: 500,
|
|
3530
3552
|
marginTop: 1,
|
|
3531
3553
|
size: 3
|
|
3532
3554
|
}, title), /*#__PURE__*/React.createElement(tapestryReact.Text, {
|
|
3533
3555
|
align: "center",
|
|
3534
|
-
color: "var(--t-text-color
|
|
3556
|
+
color: "var(--t-text-color)",
|
|
3535
3557
|
size: 4
|
|
3536
|
-
}, description));
|
|
3558
|
+
}, description)));
|
|
3537
3559
|
|
|
3538
3560
|
const notificationsOrganizer = notifications => {
|
|
3539
3561
|
const {
|
|
@@ -3559,6 +3581,7 @@ const notificationsOrganizer = notifications => {
|
|
|
3559
3581
|
};
|
|
3560
3582
|
};
|
|
3561
3583
|
const buildNotificationFromApiResponse = (resp, json) => {
|
|
3584
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3562
3585
|
const findInIncluded = ({
|
|
3563
3586
|
type,
|
|
3564
3587
|
id
|
|
@@ -3567,24 +3590,23 @@ const buildNotificationFromApiResponse = (resp, json) => {
|
|
|
3567
3590
|
return i.type === type && i.id === id;
|
|
3568
3591
|
});
|
|
3569
3592
|
};
|
|
3570
|
-
const appName = findInIncluded(resp.relationships.app.data, json.included)
|
|
3571
|
-
|
|
3593
|
+
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;
|
|
3572
3594
|
// There is technically the possibility that there are multiple web payloads
|
|
3573
3595
|
// returned from the API endpoint. However, at this point I'm not sure in
|
|
3574
3596
|
// which situations that would be the case. For v1 of this feature, we'll
|
|
3575
3597
|
// assume that there is only one web payload we need to worry about and it is
|
|
3576
3598
|
// the first in the array that is returned.
|
|
3577
|
-
const notificationData = JSON.parse(findInIncluded({
|
|
3578
|
-
id: resp
|
|
3599
|
+
const notificationData = JSON.parse((_g = (_f = findInIncluded({
|
|
3600
|
+
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,
|
|
3579
3601
|
type: "Payload"
|
|
3580
|
-
}, json.included)
|
|
3602
|
+
}, json.included)) === null || _f === void 0 ? void 0 : _f.attributes) === null || _g === void 0 ? void 0 : _g.content);
|
|
3581
3603
|
return {
|
|
3582
3604
|
appName,
|
|
3583
3605
|
createdAt: new Date(resp.attributes.created_at),
|
|
3584
3606
|
id: resp.id,
|
|
3585
|
-
isRead: resp.attributes.read_at
|
|
3586
|
-
link: notificationData
|
|
3587
|
-
title: notificationData
|
|
3607
|
+
isRead: ((_h = resp.attributes.read_at) === null || _h === void 0 ? void 0 : _h.length) > 0,
|
|
3608
|
+
link: notificationData === null || notificationData === void 0 ? void 0 : notificationData.link,
|
|
3609
|
+
title: notificationData === null || notificationData === void 0 ? void 0 : notificationData.title
|
|
3588
3610
|
};
|
|
3589
3611
|
};
|
|
3590
3612
|
const useNotifications = ({
|
|
@@ -3683,7 +3705,6 @@ const useNotifications = ({
|
|
|
3683
3705
|
}).then(e => {
|
|
3684
3706
|
if (!e.ok) {
|
|
3685
3707
|
// TODO: show an alert or something?
|
|
3686
|
-
|
|
3687
3708
|
setIsLoading(false);
|
|
3688
3709
|
setHasError(true);
|
|
3689
3710
|
// Rollback any optimistic UI updates
|
|
@@ -3716,7 +3737,6 @@ const useNotifications = ({
|
|
|
3716
3737
|
}, []);
|
|
3717
3738
|
const handleToggleRead = async notification => {
|
|
3718
3739
|
const action = notification.isRead ? "unread" : "read";
|
|
3719
|
-
|
|
3720
3740
|
// optimistic UI update
|
|
3721
3741
|
setNotifications(notifications => notifications.map(n => notification.id == n.id ? {
|
|
3722
3742
|
...n,
|
|
@@ -3729,7 +3749,6 @@ const useNotifications = ({
|
|
|
3729
3749
|
};
|
|
3730
3750
|
const handleMarkAllAsRead = () => {
|
|
3731
3751
|
const unreadIds = unread.map(n => n.id);
|
|
3732
|
-
|
|
3733
3752
|
// optimistic UI update
|
|
3734
3753
|
setNotifications(notifications => notifications.map(n => unreadIds.includes(n.id) ? {
|
|
3735
3754
|
...n,
|
|
@@ -3754,23 +3773,25 @@ const SectionHeaderButton = ({
|
|
|
3754
3773
|
onClick,
|
|
3755
3774
|
title,
|
|
3756
3775
|
...props
|
|
3757
|
-
}) => /*#__PURE__*/React.createElement(tapestryReact.StackView,
|
|
3758
|
-
color: disabled ? "var(--t-text-color-
|
|
3776
|
+
}) => (/*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3777
|
+
color: disabled ? "var(--t-text-color-disabled)" : "var(--t-text-color-interaction)",
|
|
3759
3778
|
cursor: disabled ? "default" : "pointer",
|
|
3760
3779
|
fontSize: 5,
|
|
3761
3780
|
fontWeight: 600,
|
|
3762
3781
|
userSelect: "none",
|
|
3763
|
-
onClick: !disabled && onClick
|
|
3764
|
-
|
|
3782
|
+
onClick: !disabled && onClick,
|
|
3783
|
+
...props
|
|
3784
|
+
}, title));
|
|
3765
3785
|
const SectionHeaderTitle = ({
|
|
3766
3786
|
...props
|
|
3767
|
-
}) => /*#__PURE__*/React.createElement(tapestryReact.Heading,
|
|
3768
|
-
color: "var(--t-text-color-
|
|
3787
|
+
}) => (/*#__PURE__*/React.createElement(tapestryReact.Heading, {
|
|
3788
|
+
color: "var(--t-text-color-headline)",
|
|
3769
3789
|
lineHeight: 2,
|
|
3770
3790
|
size: 5,
|
|
3771
3791
|
textTransform: "uppercase",
|
|
3772
|
-
userSelect: "none"
|
|
3773
|
-
|
|
3792
|
+
userSelect: "none",
|
|
3793
|
+
...props
|
|
3794
|
+
}));
|
|
3774
3795
|
function NotificationsComponent({
|
|
3775
3796
|
closeDrawer
|
|
3776
3797
|
}) {
|
|
@@ -3814,17 +3835,17 @@ function NotificationsComponent({
|
|
|
3814
3835
|
alignment: "center",
|
|
3815
3836
|
axis: "horizontal",
|
|
3816
3837
|
spacing: 1
|
|
3817
|
-
}, /*#__PURE__*/React.createElement(DrawerHeading, null, "Notifications"), isLoading && /*#__PURE__*/React.createElement(tapestryReact.Spinner, {
|
|
3838
|
+
}, /*#__PURE__*/React.createElement(DrawerHeading, null, "Notifications"), isLoading && (/*#__PURE__*/React.createElement(tapestryReact.Spinner, {
|
|
3818
3839
|
color: "var(--t-fill-color-neutral-030)",
|
|
3819
3840
|
thickness: 2,
|
|
3820
3841
|
trackColor: "var(--t-fill-color-neutral-080)"
|
|
3821
|
-
}), hasError && /*#__PURE__*/React.createElement(ExclamationTriangle, {
|
|
3842
|
+
})), hasError && (/*#__PURE__*/React.createElement(ExclamationTriangle, {
|
|
3822
3843
|
fill: "hsl(8 60% 47%)",
|
|
3823
3844
|
size: 16
|
|
3824
|
-
})), read.length > 0 && /*#__PURE__*/React.createElement(SectionHeaderButton, {
|
|
3845
|
+
}))), read.length > 0 && (/*#__PURE__*/React.createElement(SectionHeaderButton, {
|
|
3825
3846
|
onClick: () => setShowRead(showRead => !showRead),
|
|
3826
3847
|
title: `${showRead ? "Hide" : "Show"} read`
|
|
3827
|
-
}))), /*#__PURE__*/React.createElement(ScrollContainer, null, /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3848
|
+
})))), /*#__PURE__*/React.createElement(ScrollContainer, null, /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3828
3849
|
alignment: "stretch",
|
|
3829
3850
|
spacing: 2
|
|
3830
3851
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3836,25 +3857,26 @@ function NotificationsComponent({
|
|
|
3836
3857
|
margin: 0,
|
|
3837
3858
|
padding: "4px 0"
|
|
3838
3859
|
}
|
|
3839
|
-
}, !isLoading && unread.length === 0 && /*#__PURE__*/React.createElement(NotificationsMenuBlankState,
|
|
3860
|
+
}, !isLoading && unread.length === 0 && (/*#__PURE__*/React.createElement(NotificationsMenuBlankState, {
|
|
3840
3861
|
context: "toolbar",
|
|
3841
|
-
description: `When you have ${read.length > 0 ? "unread " : ""}notifications they will show up here
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3862
|
+
description: `When you have ${read.length > 0 ? "unread " : ""}notifications they will show up here.`,
|
|
3863
|
+
...(read.length > 0 && {
|
|
3864
|
+
title: "No unread notifications"
|
|
3865
|
+
})
|
|
3866
|
+
})), unread.length > 0 && (/*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3845
3867
|
axis: "horizontal",
|
|
3846
3868
|
alignment: "center",
|
|
3847
3869
|
distribution: "space-between",
|
|
3848
3870
|
padding: 2
|
|
3849
|
-
}, /*#__PURE__*/React.createElement(SectionHeaderTitle, null, "Unread"), unread.length > 0 && /*#__PURE__*/React.createElement(SectionHeaderButton, {
|
|
3871
|
+
}, /*#__PURE__*/React.createElement(SectionHeaderTitle, null, "Unread"), unread.length > 0 && (/*#__PURE__*/React.createElement(SectionHeaderButton, {
|
|
3850
3872
|
onClick: () => handleMarkAllAsRead(),
|
|
3851
3873
|
title: `Mark ${unread.length} as read`
|
|
3852
|
-
})), /*#__PURE__*/React.createElement(reactTransitionGroup.TransitionGroup, {
|
|
3874
|
+
})))), /*#__PURE__*/React.createElement(reactTransitionGroup.TransitionGroup, {
|
|
3853
3875
|
exit: false
|
|
3854
|
-
}, unread.map((notification, idx) => /*#__PURE__*/React.createElement(reactTransitionGroup.Transition, {
|
|
3876
|
+
}, unread.map((notification, idx) => (/*#__PURE__*/React.createElement(reactTransitionGroup.Transition, {
|
|
3855
3877
|
key: notification.id,
|
|
3856
3878
|
timeout: 0
|
|
3857
|
-
}, state => /*#__PURE__*/React.createElement("div", {
|
|
3879
|
+
}, state => (/*#__PURE__*/React.createElement("div", {
|
|
3858
3880
|
style: {
|
|
3859
3881
|
...defaultStyle,
|
|
3860
3882
|
...transitionStyles[state]
|
|
@@ -3866,15 +3888,17 @@ function NotificationsComponent({
|
|
|
3866
3888
|
onToggleRead: () => handleToggleRead(notification),
|
|
3867
3889
|
onCreateTask: handleCreateTask,
|
|
3868
3890
|
showBottomBorder: read.length > 0,
|
|
3869
|
-
|
|
3870
|
-
|
|
3891
|
+
...{
|
|
3892
|
+
notification
|
|
3893
|
+
}
|
|
3894
|
+
}))))))), read.length > 0 && showRead && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionHeaderTitle, {
|
|
3871
3895
|
padding: 2
|
|
3872
3896
|
}, "Read"), /*#__PURE__*/React.createElement(reactTransitionGroup.TransitionGroup, {
|
|
3873
3897
|
exit: false
|
|
3874
|
-
}, read.map(notification => /*#__PURE__*/React.createElement(reactTransitionGroup.Transition, {
|
|
3898
|
+
}, read.map(notification => (/*#__PURE__*/React.createElement(reactTransitionGroup.Transition, {
|
|
3875
3899
|
key: notification.id,
|
|
3876
3900
|
timeout: 0
|
|
3877
|
-
}, state => /*#__PURE__*/React.createElement("div", {
|
|
3901
|
+
}, state => (/*#__PURE__*/React.createElement("div", {
|
|
3878
3902
|
style: {
|
|
3879
3903
|
...defaultStyle,
|
|
3880
3904
|
...transitionStyles[state]
|
|
@@ -3888,8 +3912,10 @@ function NotificationsComponent({
|
|
|
3888
3912
|
onToggleRead: () => handleToggleRead(notification),
|
|
3889
3913
|
onCreateTask: handleCreateTask,
|
|
3890
3914
|
showBottomBorder: true,
|
|
3891
|
-
|
|
3892
|
-
|
|
3915
|
+
...{
|
|
3916
|
+
notification
|
|
3917
|
+
}
|
|
3918
|
+
}))))))))))))));
|
|
3893
3919
|
}
|
|
3894
3920
|
const Notifications = {
|
|
3895
3921
|
component: NotificationsComponent,
|
|
@@ -3949,18 +3975,20 @@ function NavLinkWithBadge({
|
|
|
3949
3975
|
onClick,
|
|
3950
3976
|
...rest
|
|
3951
3977
|
}) {
|
|
3952
|
-
return /*#__PURE__*/React.createElement(tapestryReact.StackView,
|
|
3978
|
+
return /*#__PURE__*/React.createElement(tapestryReact.StackView, {
|
|
3953
3979
|
as: "button",
|
|
3954
3980
|
axis: "horizontal",
|
|
3955
3981
|
distribution: "space-between",
|
|
3956
3982
|
alignment: "center",
|
|
3957
3983
|
paddingBottom: 0.75,
|
|
3958
3984
|
onClick: () => onClick(),
|
|
3959
|
-
spacing: 1
|
|
3960
|
-
|
|
3985
|
+
spacing: 1,
|
|
3986
|
+
...rest
|
|
3987
|
+
}, children, badge && /*#__PURE__*/React.createElement(tapestryReact.Badge, {
|
|
3961
3988
|
size: "sm",
|
|
3962
|
-
fontWeight: "600"
|
|
3963
|
-
|
|
3989
|
+
fontWeight: "600",
|
|
3990
|
+
...badge
|
|
3991
|
+
}));
|
|
3964
3992
|
}
|
|
3965
3993
|
function TasksComponent({
|
|
3966
3994
|
closeDrawer,
|
|
@@ -3982,7 +4010,7 @@ function TasksComponent({
|
|
|
3982
4010
|
});
|
|
3983
4011
|
}, []);
|
|
3984
4012
|
const pendoTrackEvent = React.useCallback((event, properties = {}) => {
|
|
3985
|
-
if (!window
|
|
4013
|
+
if (!(window === null || window === void 0 ? void 0 : window.pendo)) {
|
|
3986
4014
|
return console.warn("`window.pendo` is undefined");
|
|
3987
4015
|
}
|
|
3988
4016
|
window.pendo.track(event, properties);
|
|
@@ -4037,7 +4065,7 @@ function JoltSubscriber({
|
|
|
4037
4065
|
} = useStore();
|
|
4038
4066
|
const joltIsV2 = useJoltIsV2(joltPromise);
|
|
4039
4067
|
const joltChannel = useJoltChannelSubscription({
|
|
4040
|
-
channelName: requestedJoltChannel
|
|
4068
|
+
channelName: requestedJoltChannel === null || requestedJoltChannel === void 0 ? void 0 : requestedJoltChannel.channelName,
|
|
4041
4069
|
disconnectJoltOnUnmount,
|
|
4042
4070
|
enabled: !!requestedJoltChannel,
|
|
4043
4071
|
env,
|
|
@@ -4057,13 +4085,13 @@ function JoltSubscriber({
|
|
|
4057
4085
|
},
|
|
4058
4086
|
joltPromise
|
|
4059
4087
|
});
|
|
4060
|
-
return joltIsV2 ? /*#__PURE__*/React.createElement(JoltEffectV2, {
|
|
4088
|
+
return joltIsV2 ? (/*#__PURE__*/React.createElement(JoltEffectV2, {
|
|
4061
4089
|
channel: joltChannel,
|
|
4062
4090
|
onMessage: onMessage
|
|
4063
|
-
}) : /*#__PURE__*/React.createElement(JoltEffectV1, {
|
|
4091
|
+
})) : (/*#__PURE__*/React.createElement(JoltEffectV1, {
|
|
4064
4092
|
channel: joltChannel,
|
|
4065
4093
|
onMessage: onMessage
|
|
4066
|
-
});
|
|
4094
|
+
}));
|
|
4067
4095
|
}
|
|
4068
4096
|
function JoltEffectV2({
|
|
4069
4097
|
channel,
|
|
@@ -4125,26 +4153,20 @@ function useHandleMessageFromChildFrame(callback, {
|
|
|
4125
4153
|
}
|
|
4126
4154
|
|
|
4127
4155
|
// TLDR; This hook is used to sync the fragment route in the browser's url without causing an annoying flicker.
|
|
4128
|
-
|
|
4129
4156
|
// It has a couple of interrelated responsibilities whose relationship may not be obvious:
|
|
4130
|
-
|
|
4131
4157
|
// First:
|
|
4132
4158
|
// It listens for messages from the child frame that indicate that the frame has navigated to a new path.
|
|
4133
4159
|
// When this happens, it updates the fragment route in the browser's url.
|
|
4134
4160
|
// 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.
|
|
4135
|
-
|
|
4136
4161
|
// Second:
|
|
4137
4162
|
// It compares the current fragment route against the internal path of the child frame.
|
|
4138
4163
|
// The only time that these would ever diverge is if the user manually changes the fragment route in the browser's url.
|
|
4139
4164
|
// When they are not the same, we update the src attribute of the iframe to match the fragment route in the browser's url.
|
|
4140
|
-
|
|
4141
4165
|
// You may be asking yourself, why all this complexity?
|
|
4142
4166
|
// Why not just update the src attribute of the iframe every time the fragment route changes?
|
|
4143
|
-
|
|
4144
4167
|
// The answer:
|
|
4145
4168
|
// If you change an iframes src attribute, it will reload the iframe and cause a very annoying flicker.
|
|
4146
4169
|
// It's not a rerender bug. It's a browser behavior that we can't control.
|
|
4147
|
-
|
|
4148
4170
|
function useStableIframeSrcAttributeAndSyncFragmentRoute({
|
|
4149
4171
|
currentPath,
|
|
4150
4172
|
setFragmentRoute,
|
|
@@ -4158,7 +4180,6 @@ function useStableIframeSrcAttributeAndSyncFragmentRoute({
|
|
|
4158
4180
|
const unencodedPath = event.data.payload.replace(/^\/?topbar/, "") // Maybe this should happen on the child side of things?
|
|
4159
4181
|
.replace(/^\/+/, "");
|
|
4160
4182
|
internalPathOfChatRef.current = unencodedPath;
|
|
4161
|
-
|
|
4162
4183
|
// URL encode the payload's query string for the fragment route
|
|
4163
4184
|
// so possible query params don't get dropped by the fragment router
|
|
4164
4185
|
setFragmentRoute(encodeQueryString(unencodedPath));
|
|
@@ -4302,8 +4323,9 @@ const Profile = {
|
|
|
4302
4323
|
|
|
4303
4324
|
const DURATION = 100;
|
|
4304
4325
|
function isToolPathExemptFromStorage(toolName, path) {
|
|
4326
|
+
var _a, _b;
|
|
4305
4327
|
const tool = toolsRouteMap[toolName];
|
|
4306
|
-
return tool
|
|
4328
|
+
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;
|
|
4307
4329
|
}
|
|
4308
4330
|
const TOOLS_MAP = {
|
|
4309
4331
|
Chat,
|
|
@@ -4348,7 +4370,7 @@ function Toolbar({
|
|
|
4348
4370
|
userId
|
|
4349
4371
|
} = {
|
|
4350
4372
|
...storeData,
|
|
4351
|
-
...(env === "development" ? _storeDataOverride
|
|
4373
|
+
...(env === "development" ? _storeDataOverride !== null && _storeDataOverride !== void 0 ? _storeDataOverride : {} : {})
|
|
4352
4374
|
};
|
|
4353
4375
|
const updateStore = useUpdateStore();
|
|
4354
4376
|
React.useEffect(() => {
|
|
@@ -4359,7 +4381,6 @@ function Toolbar({
|
|
|
4359
4381
|
document.body.style.overflow = "auto";
|
|
4360
4382
|
}
|
|
4361
4383
|
}, [open]);
|
|
4362
|
-
|
|
4363
4384
|
// Listen for external close requests from store
|
|
4364
4385
|
React.useEffect(() => {
|
|
4365
4386
|
const unsubscribe = store$1.subscribe(state => {
|
|
@@ -4382,7 +4403,6 @@ function Toolbar({
|
|
|
4382
4403
|
window.topbar.openProfile = () => handleToolOnClick(Profile);
|
|
4383
4404
|
window.topbar.openHelpdesk = () => handleToolOnClick(Helpdesk);
|
|
4384
4405
|
window.openHelpdesk = window.topbar.openHelpdesk; /* TODO: Remove when products have migrated to window.topbar.openHelpdesk */
|
|
4385
|
-
|
|
4386
4406
|
return () => {
|
|
4387
4407
|
delete window.topbar.openProfile;
|
|
4388
4408
|
delete window.topbar.openHelpdesk;
|
|
@@ -4448,30 +4468,31 @@ function Toolbar({
|
|
|
4448
4468
|
}
|
|
4449
4469
|
}, [toolbarFragmentRoute, toolStateCookie]);
|
|
4450
4470
|
React.useEffect(() => {
|
|
4451
|
-
if (toolbarFragmentRoute
|
|
4471
|
+
if ((toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.tool) && (currentContent !== toolsRouteMap[toolbarFragmentRoute.tool] || !open)) {
|
|
4452
4472
|
setToolAndOpenDrawer(toolsRouteMap[toolbarFragmentRoute.tool]);
|
|
4453
4473
|
}
|
|
4454
|
-
}, [setToolAndOpenDrawer, toolbarFragmentRoute
|
|
4474
|
+
}, [setToolAndOpenDrawer, toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.tool, currentContent, open]);
|
|
4455
4475
|
const toggleDrawer = content => {
|
|
4456
4476
|
if (!open) {
|
|
4457
4477
|
return openDrawer(content);
|
|
4458
4478
|
}
|
|
4459
|
-
return currentContent
|
|
4479
|
+
return (currentContent === null || currentContent === void 0 ? void 0 : currentContent.name) === content.name ? closeDrawer() : openDrawer(content);
|
|
4460
4480
|
};
|
|
4461
4481
|
const {
|
|
4462
4482
|
displayChatIcon,
|
|
4463
4483
|
unreadIndicator
|
|
4464
4484
|
} = useChatConfig({
|
|
4465
|
-
disconnectJoltOnUnmount: storeData
|
|
4485
|
+
disconnectJoltOnUnmount: storeData === null || storeData === void 0 ? void 0 : storeData.disconnectJoltOnUnmount,
|
|
4466
4486
|
env,
|
|
4467
4487
|
isEnabled: Boolean(userId),
|
|
4468
|
-
joltPromise: storeData
|
|
4488
|
+
joltPromise: storeData === null || storeData === void 0 ? void 0 : storeData.joltPromise,
|
|
4469
4489
|
userId
|
|
4470
4490
|
});
|
|
4471
4491
|
const TOOLS = [Notifications, Tasks, displayChatIcon && Chat].filter(Boolean);
|
|
4472
4492
|
const handleToolOnClick = tool => {
|
|
4493
|
+
var _a;
|
|
4473
4494
|
toggleDrawer(tool);
|
|
4474
|
-
document.getElementById(`toolbarDrawer${tool.name}`)
|
|
4495
|
+
(_a = document.getElementById(`toolbarDrawer${tool.name}`)) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
4475
4496
|
behavior: "smooth",
|
|
4476
4497
|
top: 0
|
|
4477
4498
|
});
|
|
@@ -4481,7 +4502,7 @@ function Toolbar({
|
|
|
4481
4502
|
appName,
|
|
4482
4503
|
closeDrawer,
|
|
4483
4504
|
connectedPeople: connectedPeople || [],
|
|
4484
|
-
hasConnectedPeople: storeData
|
|
4505
|
+
hasConnectedPeople: (storeData === null || storeData === void 0 ? void 0 : storeData.hasConnectedPeople) || false,
|
|
4485
4506
|
linkToProfile,
|
|
4486
4507
|
loginSettingsUrl,
|
|
4487
4508
|
logoutUrl,
|
|
@@ -4496,13 +4517,13 @@ function Toolbar({
|
|
|
4496
4517
|
}
|
|
4497
4518
|
};
|
|
4498
4519
|
const onChangePath = React.useCallback(path => {
|
|
4499
|
-
onChangeToolbarFragmentRoute(currentContent
|
|
4500
|
-
}, [currentContent
|
|
4501
|
-
const routeIsForCurrentTool = toolbarFragmentRoute
|
|
4520
|
+
onChangeToolbarFragmentRoute(currentContent === null || currentContent === void 0 ? void 0 : currentContent.name.toLowerCase(), path);
|
|
4521
|
+
}, [currentContent === null || currentContent === void 0 ? void 0 : currentContent.name]);
|
|
4522
|
+
const routeIsForCurrentTool = (toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.tool) && toolsRouteMap[toolbarFragmentRoute.tool] === currentContent;
|
|
4502
4523
|
const currentToolProps = {
|
|
4503
4524
|
appName,
|
|
4504
4525
|
closeDrawer,
|
|
4505
|
-
currentPath: routeIsForCurrentTool ? toolbarFragmentRoute
|
|
4526
|
+
currentPath: routeIsForCurrentTool ? toolbarFragmentRoute === null || toolbarFragmentRoute === void 0 ? void 0 : toolbarFragmentRoute.path : null,
|
|
4506
4527
|
env,
|
|
4507
4528
|
helpdeskConfig,
|
|
4508
4529
|
isOpen: open,
|
|
@@ -4545,17 +4566,19 @@ function Toolbar({
|
|
|
4545
4566
|
"aria-label": `Open ${tool.name} drawer`,
|
|
4546
4567
|
"data-pendo": getDataPendoAttribute(tool.name),
|
|
4547
4568
|
key: tool.name
|
|
4548
|
-
}, !indicator && /*#__PURE__*/React.createElement(ToolbarButtonIcon, {
|
|
4569
|
+
}, !indicator && (/*#__PURE__*/React.createElement(ToolbarButtonIcon, {
|
|
4549
4570
|
path: tool.icons.staticPath
|
|
4550
|
-
}), indicator && /*#__PURE__*/React.createElement(ToolbarButtonIcon, {
|
|
4571
|
+
})), indicator && (/*#__PURE__*/React.createElement(ToolbarButtonIcon, {
|
|
4551
4572
|
path: tool.icons.staticDotPath,
|
|
4552
4573
|
dot: true
|
|
4553
|
-
}));
|
|
4574
|
+
})));
|
|
4554
4575
|
})), /*#__PURE__*/React.createElement(DrawerWrap, {
|
|
4555
4576
|
isVisible: open
|
|
4556
|
-
}, mounted && /*#__PURE__*/React.createElement(Drawer, {
|
|
4577
|
+
}, mounted && (/*#__PURE__*/React.createElement(Drawer, {
|
|
4557
4578
|
id: `toolbarDrawer${currentContent.name}`
|
|
4558
|
-
}, /*#__PURE__*/React.createElement(currentContent.component,
|
|
4579
|
+
}, /*#__PURE__*/React.createElement(currentContent.component, {
|
|
4580
|
+
...currentToolProps
|
|
4581
|
+
}))))));
|
|
4559
4582
|
}
|
|
4560
4583
|
const ToolbarButton = ({
|
|
4561
4584
|
children,
|
|
@@ -4564,12 +4587,13 @@ const ToolbarButton = ({
|
|
|
4564
4587
|
onClick,
|
|
4565
4588
|
...restProps
|
|
4566
4589
|
}) => {
|
|
4567
|
-
return /*#__PURE__*/React.createElement("button",
|
|
4590
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
4568
4591
|
type: "button",
|
|
4569
4592
|
className: classnames(styles["toolbar-button"], className, current && styles["is-current"]),
|
|
4570
4593
|
onClick: onClick,
|
|
4571
|
-
"data-toolbar-link": "true"
|
|
4572
|
-
|
|
4594
|
+
"data-toolbar-link": "true",
|
|
4595
|
+
...restProps
|
|
4596
|
+
}, children);
|
|
4573
4597
|
};
|
|
4574
4598
|
function ToolbarButtonIcon({
|
|
4575
4599
|
dot,
|
|
@@ -4586,12 +4610,12 @@ function ToolbarButtonIcon({
|
|
|
4586
4610
|
fillRule: "evenodd",
|
|
4587
4611
|
clipRule: "evenodd",
|
|
4588
4612
|
d: path
|
|
4589
|
-
}), dot && /*#__PURE__*/React.createElement("circle", {
|
|
4590
|
-
fill: "var(--t-icon-color-status-error
|
|
4613
|
+
}), dot && (/*#__PURE__*/React.createElement("circle", {
|
|
4614
|
+
fill: "var(--t-icon-color-status-error)",
|
|
4591
4615
|
cx: "24",
|
|
4592
4616
|
cy: "8",
|
|
4593
4617
|
r: "4"
|
|
4594
|
-
}));
|
|
4618
|
+
})));
|
|
4595
4619
|
}
|
|
4596
4620
|
function getDataPendoAttribute(toolName) {
|
|
4597
4621
|
if (toolName === "Chat") {
|