@planningcenter/topbar 8.2.0-rc.2 → 8.2.0-rc.3

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/README.md +4 -2
  3. package/dist/modules/api_request.d.ts +0 -5
  4. package/dist/modules/apps_provider.d.ts +1 -1
  5. package/dist/modules/client_storage.d.ts +1 -1
  6. package/dist/modules/color_app_squircles.d.ts +1 -0
  7. package/dist/modules/colors.d.ts +46 -0
  8. package/dist/modules/components/NotificationsMenuBlankState.d.ts +12 -0
  9. package/dist/modules/components/apps_menu.d.ts +2 -6
  10. package/dist/modules/components/conditional_wrap.d.ts +7 -0
  11. package/dist/modules/components/notification_item.d.ts +5 -1
  12. package/dist/modules/components/notifications_inbox.d.ts +18 -0
  13. package/dist/modules/components/notifications_menu.d.ts +9 -3
  14. package/dist/modules/components/notifications_menu_Wrapper.d.ts +7 -0
  15. package/dist/modules/components/notifications_menu_blank_state.d.ts +8 -0
  16. package/dist/modules/components/popover_root.d.ts +6 -0
  17. package/dist/modules/components/spinner.d.ts +4 -0
  18. package/dist/modules/connected_people_provider.d.ts +1 -1
  19. package/dist/modules/display_switch.d.ts +1 -1
  20. package/dist/modules/dummy_data.d.ts +3 -3
  21. package/dist/modules/formatters.d.ts +1 -13
  22. package/dist/modules/hooks/use_hover.d.ts +3 -0
  23. package/dist/modules/hooks/use_local_storage.d.ts +10 -0
  24. package/dist/modules/hooks/use_notifications.d.ts +16 -0
  25. package/dist/modules/hooks/use_topbar_api.d.ts +8 -0
  26. package/dist/modules/mono_app_symbols.d.ts +4 -0
  27. package/dist/modules/mono_app_text.d.ts +5 -0
  28. package/dist/modules/not_small_topbar.d.ts +35 -15
  29. package/dist/modules/symbols.d.ts +8 -15
  30. package/dist/modules/topbar_context.d.ts +5 -0
  31. package/dist/topbar +2 -0
  32. package/dist/topbar.js +1 -1
  33. package/dist/topbar.js.map +1 -1
  34. package/dist/topbar.map +1 -0
  35. package/dist/topbar.modern.css +2 -0
  36. package/dist/topbar.modern.css.map +1 -0
  37. package/dist/topbar.modern.js +1 -1
  38. package/dist/topbar.modern.js.map +1 -1
  39. package/dist/topbar.module.css +2 -0
  40. package/dist/topbar.module.css.map +1 -0
  41. package/dist/topbar.module.js +1 -1
  42. package/dist/topbar.module.js.map +1 -1
  43. package/dist/topbar.umd.js +1 -1
  44. package/dist/topbar.umd.js.map +1 -1
  45. package/dist/types/modules/hooks/use_notifications.d.ts.map +1 -1
  46. package/dist/types/modules/interfaces.d.ts +55 -0
  47. package/dist/types/modules/interfaces.d.ts.map +1 -0
  48. package/dist/types/modules/medium_topbar.d.ts +39 -0
  49. package/dist/types/modules/medium_topbar.d.ts.map +1 -0
  50. package/dist/types/modules/profile_container.d.ts +10 -0
  51. package/dist/types/modules/profile_container.d.ts.map +1 -0
  52. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -5,7 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [8.2.0-rc.2] - 2022-05-18
8
+ ## [8.2.0] - 2021-05-11
9
+
10
+ ### Added
11
+
12
+ - Make whether Jolt sends its logs to console configurable (`enableJoltLogging` prop) and default to `false`
13
+
14
+ ### Changed
15
+
16
+ - Add more info regarding troubleshooting `yalc` issues to the README
17
+ - Send a `fetchAuthTokenFn` to `jolt-client` instead of `authToken`. Over time, the auth token can get stale. Sending a function instead of a value allows the client to refresh itself when required.
18
+ - Instead of fetching the WSS URLs for authorization from an api endpoint, hard-code them instead. After the change adding `fetchAuthTokenFn`, this change reduces required API calls by 1.
9
19
 
10
20
  ### Fixed
11
21
 
package/README.md CHANGED
@@ -34,8 +34,10 @@ If a Jolt connection is not shared with topbar, it will gladly initiate its own
34
34
  To reuse your app's Jolt connection, topbar requires a Promise that resolves into a [Jolt client](https://github.com/ministrycentered/jolt-client/) connection.
35
35
  If nothing is passed—or if a Promise is passed that resolves to `undefined` or `void`—topbar will initiate its own connection.
36
36
 
37
- Topbar hooks into `pco-page-expired` and will `disconnect` either its internal, or passed in jolt instance when the session is invalidated (i.e. logged out in a different tab).
38
- CSRF tokens are invalidated when the session is invalidated, and non-GET APIv2 requests (i.e. auth/subscribe) require a valid CSRF token and will never succeed in that state.
37
+ Topbar hooks into `pco-page-expired` and will `disconnect` when the session is invalidated (i.e. logged out in a different tab).
38
+ This occurs for `topbar`-created jolt instances as well as jolt instances provided to `topbar` via the `joltPromise` prop.
39
+ CSRF tokens are invalidated when the session is invalidated.
40
+ Non-GET APIv2 requests (i.e. auth/subscribe) require a valid CSRF token and will never succeed in that state.
39
41
 
40
42
  #### Example
41
43
 
@@ -1,10 +1,5 @@
1
- import { Environment } from "@planningcenter/url";
2
1
  declare global {
3
2
  interface Window {
4
- railsEnv?: Environment;
5
- currentPerson?: {
6
- id: number;
7
- };
8
3
  Rails?: {
9
4
  csrfToken: () => string;
10
5
  };
@@ -17,7 +17,7 @@ export declare class AppsProvider extends React.Component<{
17
17
  fetch(): void;
18
18
  remove(): void;
19
19
  componentDidMount(): void;
20
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
20
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
21
21
  }
22
22
  interface App {
23
23
  attributes: {
@@ -8,5 +8,5 @@ export declare class ClientStorage extends React.Component<{
8
8
  method: string;
9
9
  };
10
10
  update(value: any): void;
11
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
11
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
12
12
  }
@@ -6,6 +6,7 @@ export declare function CheckIns(): JSX.Element[];
6
6
  export declare function ChurchCenter(): JSX.Element[];
7
7
  export declare function Giving(): JSX.Element[];
8
8
  export declare function Groups(): JSX.Element[];
9
+ export declare function Home(): JSX.Element[];
9
10
  export declare function People(): JSX.Element[];
10
11
  export declare function Publishing(): JSX.Element[];
11
12
  export declare function Registrations(): JSX.Element[];
@@ -0,0 +1,46 @@
1
+ declare const colors: {
2
+ danger43: string;
3
+ danger45: string;
4
+ danger47: string;
5
+ danger93: string;
6
+ danger97: string;
7
+ darkNeutral07: string;
8
+ darkNeutral12: string;
9
+ darkNeutral15: string;
10
+ darkNeutral17: string;
11
+ darkNeutral19: string;
12
+ darkNeutral24: string;
13
+ darkNeutral32: string;
14
+ darkNeutral50: string;
15
+ darkNeutral68: string;
16
+ darkNeutral88: string;
17
+ darkNeutral98: string;
18
+ interaction45: string;
19
+ interaction50: string;
20
+ interaction55: string;
21
+ interaction66: string;
22
+ interaction91: string;
23
+ interaction93: string;
24
+ lightNeutral100: string;
25
+ lightNeutral12: string;
26
+ lightNeutral24: string;
27
+ lightNeutral45: string;
28
+ lightNeutral62: string;
29
+ lightNeutral81: string;
30
+ lightNeutral88: string;
31
+ lightNeutral93: string;
32
+ lightNeutral95: string;
33
+ lightNeutral97: string;
34
+ lightNeutral98: string;
35
+ success23: string;
36
+ success25: string;
37
+ success27: string;
38
+ success91: string;
39
+ success97: string;
40
+ warning49: string;
41
+ warning55: string;
42
+ warning63: string;
43
+ warning94: string;
44
+ warning97: string;
45
+ };
46
+ export default colors;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ declare const NotificationsMenuBlankState: ({
3
+ description,
4
+ style,
5
+ title,
6
+ ...props
7
+ }: {
8
+ description: string
9
+ style?: object
10
+ title?: string
11
+ }) => JSX.Element
12
+ export default NotificationsMenuBlankState
@@ -1,13 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import * as PCO_URL from "@planningcenter/url";
3
+ import { App } from "../interfaces";
3
4
  declare const AppsMenu: ({ appName, apps, env, toggle, visible, }: {
4
5
  appName: string;
5
- apps: {
6
- attributes: {
7
- name: string;
8
- url: string;
9
- };
10
- }[];
6
+ apps: App[];
11
7
  env: PCO_URL.Environment;
12
8
  toggle: any;
13
9
  visible: boolean;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare const ConditionalWrap: ({ children, condition, wrap, }: {
3
+ children: React.ReactNode;
4
+ condition?: boolean;
5
+ wrap: any;
6
+ }) => any;
7
+ export default ConditionalWrap;
@@ -1,7 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { Notification } from "../interfaces";
3
- declare const NotificationItem: ({ isLast, notification: { appName, createdAt, isRead, link, title }, }: {
3
+ declare const NotificationItem: ({ mobile, isLast, onMarkAsRead, onToggleRead, showBottomBorder, notification, }: {
4
+ mobile?: boolean;
4
5
  isLast?: boolean;
6
+ onMarkAsRead?: (notification: Notification) => any;
7
+ onToggleRead: any;
8
+ showBottomBorder?: boolean;
5
9
  notification: Notification;
6
10
  }) => JSX.Element;
7
11
  export default NotificationItem;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import * as PCO_URL from "@planningcenter/url"
3
+ import { Notification } from "../interfaces"
4
+ declare const NotificationsInbox: ({
5
+ env,
6
+ render,
7
+ userId,
8
+ }: {
9
+ env: PCO_URL.Environment
10
+ render: (props: {
11
+ handleMarkAllAsRead: () => any
12
+ handleToggleRead: (notification: Notification) => any
13
+ read: Notification[]
14
+ unread: Notification[]
15
+ }) => JSX.Element
16
+ userId: string
17
+ }) => JSX.Element
18
+ export default NotificationsInbox
@@ -1,11 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { Notification } from "../interfaces";
3
- declare const NotificationsMenu: ({ notifications: { read, unread }, toggle, visible, }: {
3
+ declare const NotificationsMenu: ({ handleMarkAllAsRead, handleMarkAsRead, handleToggleRead, hasError, isLoading, mobile, notifications: { read, unread }, toggle, visible, }: {
4
+ handleMarkAllAsRead: () => any;
5
+ handleMarkAsRead: (notification: Notification) => any;
6
+ handleToggleRead: (notification: Notification) => any;
7
+ hasError?: boolean;
8
+ isLoading?: boolean;
9
+ mobile?: boolean;
4
10
  notifications: {
5
11
  read: Notification[];
6
12
  unread: Notification[];
7
13
  };
8
- toggle: any;
9
- visible: boolean;
14
+ toggle?: any;
15
+ visible?: boolean;
10
16
  }) => JSX.Element;
11
17
  export default NotificationsMenu;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare const NotificationsMenuWrapper: ({ children, toggle, visible, ...nativeProps }: {
3
+ children: React.ReactNode;
4
+ toggle: any;
5
+ visible: boolean;
6
+ }) => JSX.Element;
7
+ export default NotificationsMenuWrapper;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const NotificationsMenuBlankState: ({ dark, description, style, title, }: {
3
+ dark?: boolean;
4
+ description: string;
5
+ style?: object;
6
+ title?: string;
7
+ }) => JSX.Element;
8
+ export default NotificationsMenuBlankState;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare const PopupRoot: ({ style, ...nativeProps }: {
3
+ children?: React.ReactNode;
4
+ style?: object;
5
+ }) => JSX.Element;
6
+ export default PopupRoot;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import "./spinner.css";
3
+ declare const Spinner: (props: any) => JSX.Element;
4
+ export default Spinner;
@@ -17,5 +17,5 @@ export declare class ConnectedPeopleProvider extends React.Component<{
17
17
  unlink(): void;
18
18
  switch(toId: string, returnPath: string): void;
19
19
  componentDidMount(): void;
20
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
20
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
21
21
  }
@@ -9,7 +9,7 @@ export declare class PointBreak extends React.Component<{
9
9
  componentDidMount(): void;
10
10
  componentWillUnmount(): void;
11
11
  breakpointString(width: any): "xs" | "sm" | "md" | "lg" | "xl";
12
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
12
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
13
13
  }
14
14
  export declare class DisplaySwitch extends React.Component<{
15
15
  smallBreakpoints: String[];
@@ -1,3 +1,3 @@
1
- import { Notification } from "./interfaces";
2
- export declare const DUMMY_DATA_UNREAD: Notification[];
3
- export declare const DUMMY_DATA_READ: Notification[];
1
+ import { Notification } from "./interfaces"
2
+ export declare const DUMMY_DATA_UNREAD: Notification[]
3
+ export declare const DUMMY_DATA_READ: Notification[]
@@ -1,15 +1,3 @@
1
- export interface App {
2
- attributes: {
3
- name: string;
4
- url: string;
5
- };
6
- }
7
- export interface ConnectedPerson {
8
- id: number;
9
- attributes: {
10
- name: string;
11
- organization_name: string;
12
- };
13
- }
1
+ import { App, ConnectedPerson } from "./interfaces";
14
2
  export declare const appsMenuFormatter: (apps: App[]) => App[];
15
3
  export declare const connectedPeopleMenuFormatter: (connectedPeople: ConnectedPerson[]) => ConnectedPerson[];
@@ -0,0 +1,3 @@
1
+ import { RefObject } from "react";
2
+ declare function useHover<T extends HTMLElement = HTMLElement>(elementRef: RefObject<T>): boolean;
3
+ export default useHover;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare function useLocalStorage(
3
+ key: string,
4
+ initialValue: any
5
+ ): {
6
+ storedValue: any
7
+ setStoredValue: import("react").Dispatch<any>
8
+ dropKey: () => void
9
+ }
10
+ export default useLocalStorage
@@ -0,0 +1,16 @@
1
+ import * as PCO_URL from "@planningcenter/url";
2
+ import { Notification } from "../interfaces";
3
+ declare const useNotifications: ({ disabled, env, userId, }: {
4
+ disabled?: boolean;
5
+ env: PCO_URL.Environment;
6
+ userId: string;
7
+ }) => {
8
+ handleMarkAllAsRead: () => any;
9
+ handleMarkAsRead: (notification: Notification) => any;
10
+ handleToggleRead: (notification: Notification) => any;
11
+ hasError: boolean;
12
+ isLoading: boolean;
13
+ read: Notification[];
14
+ unread: Notification[];
15
+ };
16
+ export default useNotifications;
@@ -0,0 +1,8 @@
1
+ import * as PCO_URL from "@planningcenter/url";
2
+ import { Fetch } from "../api_request";
3
+ import { TopbarAPIResponse } from "../interfaces";
4
+ declare const useTopbarAPI: ({ configuredFetch, env, }: {
5
+ configuredFetch: Fetch;
6
+ env: PCO_URL.Environment;
7
+ }) => TopbarAPIResponse;
8
+ export default useTopbarAPI;
@@ -31,6 +31,10 @@ export declare function Groups({ color, ...platformProps }: {
31
31
  [x: string]: any;
32
32
  color: any;
33
33
  }): JSX.Element;
34
+ export declare function Home({ color, ...platformProps }: {
35
+ [x: string]: any;
36
+ color: any;
37
+ }): JSX.Element;
34
38
  export declare function People({ color, ...platformProps }: {
35
39
  [x: string]: any;
36
40
  color: any;
@@ -29,6 +29,11 @@ export declare function Giving({ color, size, ...platformProps }: {
29
29
  color: any;
30
30
  size?: number;
31
31
  }): JSX.Element;
32
+ export declare function Home({ color, size, ...platformProps }: {
33
+ [x: string]: any;
34
+ color: any;
35
+ size?: number;
36
+ }): JSX.Element;
32
37
  export declare function Groups({ color, size, ...platformProps }: {
33
38
  [x: string]: any;
34
39
  color: any;
@@ -1,6 +1,36 @@
1
1
  import * as React from "react";
2
2
  import * as PCO_URL from "@planningcenter/url";
3
- import { Notification } from "./interfaces";
3
+ export declare class AppsButton extends React.Component<{
4
+ appName: string;
5
+ colors: any;
6
+ expanded: boolean;
7
+ style?: object;
8
+ onClick: any;
9
+ displayIconOnly?: boolean;
10
+ }, {
11
+ entered: boolean;
12
+ down: boolean;
13
+ }> {
14
+ constructor(props: any);
15
+ static defaultProps: {
16
+ displayIconOnly: boolean;
17
+ };
18
+ render(): JSX.Element;
19
+ }
20
+ export declare class Hoverable extends React.Component<{
21
+ component?: any;
22
+ style?: object;
23
+ hover?: any;
24
+ active?: any;
25
+ type?: string;
26
+ onClick?: any;
27
+ }, {
28
+ entered: boolean;
29
+ down: boolean;
30
+ }> {
31
+ constructor(props: any);
32
+ render(): JSX.Element;
33
+ }
4
34
  export declare class Topbar extends React.Component<{
5
35
  apps: {
6
36
  attributes: {
@@ -21,40 +51,30 @@ export declare class Topbar extends React.Component<{
21
51
  search?: any;
22
52
  style?: any;
23
53
  showOrgName?: boolean;
54
+ notifications?: any;
24
55
  requestAppsFetch: any;
25
56
  requestConnectedPeopleFetch: any;
26
57
  requestUnlinkConnectedPeople: any;
27
58
  requestSwitchConnectedPerson: any;
28
59
  requestClearAppsCache: any;
29
60
  requestClearConnectedPeopleCache: any;
30
- useDummyNotifications?: boolean;
31
61
  linkToProfile?: boolean;
62
+ onLinkToProfileClick?: () => any;
32
63
  }, {
33
64
  appsMenuVisible: boolean;
34
- notificationsMenuVisible: boolean;
35
- routesVisible: boolean;
36
65
  userMenuVisible: boolean;
37
- notifications: {
38
- unread: Notification[];
39
- read: Notification[];
40
- };
66
+ routesVisible: boolean;
41
67
  }> {
42
68
  static defaultProps: {
69
+ notifications: () => any;
43
70
  search: () => any;
44
71
  linkToProfile: boolean;
45
72
  showOrgName: boolean;
46
- useDummyNotifications: boolean;
47
73
  };
48
74
  constructor(props: any);
49
75
  hideRoutes(): void;
50
76
  showRoutes(): void;
51
77
  getTextColor(): any;
52
- findInIncluded({ type, id }: {
53
- type: any;
54
- id: any;
55
- }, included: any): any;
56
- subscribeToJoltChannel(): void;
57
- componentDidMount(): void;
58
78
  render(): JSX.Element;
59
79
  }
60
80
  export declare class Route extends React.Component<{
@@ -1,23 +1,16 @@
1
- /// <reference types="react" />
2
- export declare const Bell: ({ dot, dotFill, fill, style, ...props }: {
1
+ import * as React from "react";
2
+ export declare const Bell: React.StatelessComponent<{
3
3
  dot?: boolean;
4
4
  dotFill?: string;
5
5
  fill?: string;
6
+ stroke?: string;
6
7
  style?: object;
7
- }) => JSX.Element;
8
- export declare const DisclosureChevronIcon: ({ colors, style, ...nativeProps }: {
9
- colors: any;
10
- style?: object;
11
- }) => JSX.Element;
12
- export declare const HelpIcon: ({ colors, style, ...nativeProps }: {
13
- colors: any;
14
- style?: object;
15
- }) => JSX.Element;
16
- export declare const Spyglass: ({ fill, style, ...nativeProps }: {
8
+ }>;
9
+ export declare const Spyglass: React.StatelessComponent<{
17
10
  fill?: string;
18
11
  style?: object;
19
- }) => JSX.Element;
20
- export declare const X: ({ fill, style, ...nativeProps }: {
12
+ }>;
13
+ export declare const X: React.StatelessComponent<{
21
14
  fill?: string;
22
15
  style?: object;
23
- }) => JSX.Element;
16
+ }>;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").Context<{
3
+ notificationsDisabled: boolean;
4
+ }>;
5
+ export default _default;