@openfin/workspace-platform 19.3.2 → 19.3.4

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 (46) hide show
  1. package/browser/src/components/ControlBar/LeftControlsContainer/EnterpriseNavigationContainer/AddressBar/AddressBarInput.d.ts +7 -7
  2. package/browser/src/components/ControlBar/SearchMenu/BookmarkButton.d.ts +10 -0
  3. package/browser/src/components/ControlBar/SearchMenu/useBookmarkButtonHover.d.ts +2 -0
  4. package/browser/src/components/ControlBar/SearchMenu/useEnterpriseBookmarkDialogWindow.d.ts +2 -0
  5. package/browser/src/components/ControlBar/SearchMenu/useIsBookmarked.d.ts +1 -0
  6. package/browser/src/components/ControlBar/SearchMenu/useIsSelectedViewNavigated.d.ts +5 -0
  7. package/browser/src/components/ControlBar/SearchMenu/useSelectedAndOpenViewsBroadcastChannel.d.ts +8 -0
  8. package/browser/src/components/ControlBar/SearchMenu/utils.d.ts +9 -0
  9. package/browser/src/components/PanelContainer/BookmarksPanel/BookmarkItem.d.ts +17 -0
  10. package/browser/src/components/PanelContainer/BookmarksPanel/BookmarksFolderHeader.d.ts +8 -0
  11. package/browser/src/components/PanelContainer/BookmarksPanel/BookmarksPanel.d.ts +9 -0
  12. package/browser/src/components/PanelContainer/BookmarksPanel/BookmarksPanelHeader.d.ts +3 -0
  13. package/browser/src/components/PanelContainer/BookmarksPanel/BookmarksResults.d.ts +15 -0
  14. package/browser/src/components/PanelContainer/BookmarksPanel/BookmarksSearchInput.d.ts +7 -0
  15. package/browser/src/components/PanelContainer/BookmarksPanel/useBookmarkNavigation.d.ts +8 -0
  16. package/browser/src/components/PanelContainer/BookmarksPanel/useBookmarksSearch.d.ts +16 -0
  17. package/browser/src/components/PanelContainer/BookmarksPanel/useUpdateBookmarkResultsActions.d.ts +15 -0
  18. package/browser/src/components/PanelContainer/BookmarksPanel/utils.d.ts +7 -0
  19. package/browser/src/hooks/EnterpriseSearchMenu/usePostMessageToSearchMenuView.d.ts +4 -2
  20. package/browser/src/hooks/usePanelBounds.d.ts +2 -1
  21. package/browser/src/hooks/useSingleViewPage.d.ts +2 -0
  22. package/browser/src/hooks/useWindowFocusState.d.ts +17 -0
  23. package/client-api-platform/src/api/app-directory.d.ts +1 -1
  24. package/client-api-platform/src/api/browser/bookmarks.d.ts +6 -0
  25. package/client-api-platform/src/api/context-menu/index.d.ts +3 -1
  26. package/client-api-platform/src/shapes.d.ts +5 -2
  27. package/common/src/api/pages/shapes.d.ts +91 -0
  28. package/common/src/api/protocol/browser.d.ts +3 -1
  29. package/common/src/api/protocol/workspace-platform.d.ts +1 -0
  30. package/common/src/components/BaseButton/BaseButton.d.ts +55 -0
  31. package/common/src/hooks/context.d.ts +9 -1
  32. package/common/src/hooks/useAddEditBookmarkDialog.d.ts +7 -0
  33. package/common/src/hooks/usePreloadedWindow.d.ts +13 -0
  34. package/common/src/utils/bookmark-item-context-menu.d.ts +3 -0
  35. package/common/src/utils/bookmarks.d.ts +12 -0
  36. package/common/src/utils/enterprise-channels.d.ts +13 -0
  37. package/common/src/utils/get-browser-window.d.ts +3 -0
  38. package/common/src/utils/menu-config.d.ts +1 -0
  39. package/common/src/utils/modal-bounds.d.ts +0 -8
  40. package/common/src/utils/popup-window.d.ts +12 -1
  41. package/common/src/utils/route.d.ts +3 -1
  42. package/common/src/utils/window.d.ts +12 -1
  43. package/index.js +15 -15
  44. package/index.js.map +1 -1
  45. package/package.json +1 -1
  46. package/common/src/utils/enterprise-context-menu-cahnnels.d.ts +0 -4
@@ -3,16 +3,16 @@ import { OpenFin } from '@openfin/core';
3
3
  import { BrowserSearchMenuKeyboardEvent } from '../../../../../../../common/src/utils/popup-window';
4
4
  import { SearchViewExpansionState, SecureIconState } from './AddressBar';
5
5
  type AddressBarInputProps = {
6
- addressSearchResultsView?: OpenFin.View;
7
- addressBarInputRef?: MutableRefObject<HTMLInputElement>;
8
- inputContainerRef?: MutableRefObject<HTMLDivElement>;
9
- addressBarWidth?: number;
6
+ addressSearchResultsView: OpenFin.View;
7
+ addressBarInputRef: MutableRefObject<HTMLInputElement>;
8
+ inputContainerRef: MutableRefObject<HTMLDivElement>;
9
+ addressBarWidth: number;
10
10
  isSecure: SecureIconState;
11
- setShouldExpandMenu?: Dispatch<SetStateAction<SearchViewExpansionState>>;
12
- shouldExpandMenu?: SearchViewExpansionState;
11
+ setShouldExpandMenu: Dispatch<SetStateAction<SearchViewExpansionState>>;
12
+ shouldExpandMenu: SearchViewExpansionState;
13
13
  setSearchText: Dispatch<SetStateAction<string>>;
14
14
  searchText: string;
15
- setKeyboardEvent: Dispatch<BrowserSearchMenuKeyboardEvent>;
15
+ sendKeyboardEventToSearchMenuView: (keyboardEvent: BrowserSearchMenuKeyboardEvent) => void;
16
16
  };
17
17
  export declare const AddressBarInput: React.FC<AddressBarInputProps>;
18
18
  export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ type BookmarkIconProps = {
3
+ inputContainerRef: React.MutableRefObject<HTMLDivElement>;
4
+ iconGradientClick?: () => void;
5
+ url?: string;
6
+ isMenuExpanded?: boolean;
7
+ disableMonitorBookmarkPanelActions?: boolean;
8
+ };
9
+ export declare const BookmarkButton: ({ inputContainerRef, url, iconGradientClick, isMenuExpanded, disableMonitorBookmarkPanelActions }: BookmarkIconProps) => JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { MutableRefObject } from 'react';
2
+ export declare const useBookmarkButtonHover: (inputContainerRef: MutableRefObject<HTMLElement | null>) => boolean;
@@ -0,0 +1,2 @@
1
+ import OpenFin from '@openfin/core';
2
+ export declare const useEnterpriseBookmarkDialogWindow: () => OpenFin.Window | null;
@@ -0,0 +1 @@
1
+ export declare const useIsBookmarked: (url?: string, ...beacons: (any | undefined)[]) => boolean;
@@ -0,0 +1,5 @@
1
+ import OpenFin from '@openfin/core';
2
+ export declare const useIsSelectedViewNavigated: (url: string) => {
3
+ isViewNavigatedToUrl: boolean;
4
+ selectedView: OpenFin.View;
5
+ };
@@ -0,0 +1,8 @@
1
+ import { MutableRefObject } from 'react';
2
+ import type OpenFin from '@openfin/core';
3
+ import { SearchMenuChannelRequest } from '../../../../../common/src/utils/popup-window';
4
+ export declare const useSelectedAndOpenViewsBroadcastChannel: (additionalCallBack?: (ev: MessageEvent<SearchMenuChannelRequest>) => void) => {
5
+ selectedViews: OpenFin.Identity[];
6
+ openViews: OpenFin.Identity[];
7
+ searchMenuChannel: MutableRefObject<BroadcastChannel>;
8
+ };
@@ -0,0 +1,9 @@
1
+ import OpenFin from '@openfin/core';
2
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
3
+ import { AttachedPage, Site } from '../../../../../client-api-platform/src/index';
4
+ export declare const handleAlreadyOpenPage: (attachedPages: AttachedPage[], site?: Site) => boolean;
5
+ export declare const convertSiteData: (result: any) => Site;
6
+ export declare const getRecentlyVisitedSites: () => Promise<Site[]>;
7
+ export declare const getSiteSubTitle: (site: Site) => string;
8
+ export declare const checkViewUrl: (view: OpenFin.View | null, url: string, setViewNavigatedToUrl: (value: boolean) => void) => Promise<void>;
9
+ export declare const searchBookmark: (url: string, browserIdentity?: OpenFin.Identity) => Promise<BookmarkNode | undefined>;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
3
+ import { Props as BaseButtonProps } from '../../../../../common/src/components/BaseButton/BaseButton';
4
+ interface BookmarkItemProps {
5
+ bookmark: BookmarkNode;
6
+ isRenaming: boolean;
7
+ handleNavigateToFolder: (folderId: string) => void;
8
+ setRenamingNode: (id?: string) => void;
9
+ }
10
+ declare const _default: import("react").NamedExoticComponent<BookmarkItemProps>;
11
+ export default _default;
12
+ export declare const BookmarkItemButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<BaseButtonProps & import("react").HTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>, import("styled-components").DefaultTheme, BaseButtonProps & {
13
+ isRenaming?: boolean;
14
+ }, never>;
15
+ export declare const BookmarkItemButtonContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
16
+ export declare const BookmarkFolderIcon: React.FC;
17
+ export declare const BookmarkFavoritesIcon: React.FC;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
3
+ interface BookmarksPanelHeaderProps {
4
+ folder: BookmarkNode;
5
+ handleNavigateToFolder: (folderId: string) => void;
6
+ }
7
+ declare const BookmarksFolderHeader: React.FC<BookmarksPanelHeaderProps>;
8
+ export default BookmarksFolderHeader;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare const BookmarksPanel: () => JSX.Element;
3
+ export default BookmarksPanel;
4
+ export declare const TextHelp: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("react").HTMLAttributes<HTMLElement> & {
5
+ color?: "background6" | "textDefault";
6
+ children: import("react").ReactNode;
7
+ size?: "small" | "base" | "large" | "xsmall" | "xlarge" | "xxlarge" | "xxxlarge" | "xxxxlarge";
8
+ weight?: "normal" | "bold";
9
+ }, never>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const BookmarksPanelHeader: () => JSX.Element;
3
+ export default BookmarksPanelHeader;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
3
+ import { CategorizedBookmarkSearchResults } from './utils';
4
+ interface BookmarksResultsProps {
5
+ currentFolder: BookmarkNode;
6
+ bookmarksList: BookmarkNode[];
7
+ categorizedSearchResults: CategorizedBookmarkSearchResults;
8
+ isSearchQueryResults: boolean;
9
+ renamingNodeId: string | undefined;
10
+ handleNavigateToFolder: (folderId: string) => void;
11
+ setRenamingNode: (id?: string) => void;
12
+ }
13
+ declare const BookmarksResults: React.FC<BookmarksResultsProps>;
14
+ export default BookmarksResults;
15
+ export declare const TextHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,7 @@
1
+ import { ChangeEvent } from 'react';
2
+ interface BookmarksSearchInputProps {
3
+ handleSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
4
+ clearSearchInput: () => void;
5
+ }
6
+ declare const BookmarksSearchInput: React.FC<BookmarksSearchInputProps>;
7
+ export default BookmarksSearchInput;
@@ -0,0 +1,8 @@
1
+ import { MouseEvent } from 'react';
2
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
3
+ /**
4
+ * Custom hook that returns function to handle navigation for a click on a bookmark item.
5
+ *
6
+ * @returns {Function} Function to handle bookmark navigation click.
7
+ */
8
+ export declare const useBookmarkNavigation: () => (bookmark: BookmarkNode, event: MouseEvent<HTMLButtonElement>) => Promise<void>;
@@ -0,0 +1,16 @@
1
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
2
+ import { CategorizedBookmarkSearchResults } from './utils';
3
+ /**
4
+ * Custom hook that manages and sorts bookmark search results and returns an object of categorized bookmarks
5
+ * and actions to update the search query.
6
+ *
7
+ * @returns {Object} An object containing the following:
8
+ * - `categorizedSearchResults` : An object containing two arrays, `bookmarksInFolder` and `bookmarksOutsideFolder`.
9
+ * - `handleSearchInputChange` : A function to update the search query phrase to retrieve new search results.
10
+ * - `clearSearchInput` : A function to clear the search query and reset the panel to its previous state.
11
+ */
12
+ export declare const useBookmarksSearch: (currentFolder: BookmarkNode, setSearchQuery: (query: string) => void, updateBookmarksResults: (folderId?: string, navigateToFolder?: boolean) => void) => {
13
+ categorizedSearchResults: CategorizedBookmarkSearchResults;
14
+ handleSearchInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
15
+ clearSearchInput: () => void;
16
+ };
@@ -0,0 +1,15 @@
1
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
2
+ /**
3
+ * Custom hook that retrieves the root node corresponding to All Bookmarks on initial render and
4
+ * provides actions to update bookmark results.
5
+ *
6
+ * @returns {Object} An object containing the following:
7
+ * - `bookmarksList` : `BookmarkNode[]` - A sorted list of the current folder's child bookmarks and folders.
8
+ * - `currentFolder` : `BookmarkNode` - The currently active folder.
9
+ * - `deleteBookmark` : A function to update currentFolder and bookmarksList given a specific folderId.
10
+ */
11
+ export declare const useUpdateBookmarkResultsActions: () => {
12
+ bookmarksList: BookmarkNode[];
13
+ currentFolder: BookmarkNode;
14
+ updateBookmarksResults: (folderId?: string) => Promise<void>;
15
+ };
@@ -0,0 +1,7 @@
1
+ import { BookmarkNode } from '../../../../../common/src/api/pages/shapes';
2
+ export type CategorizedBookmarkSearchResults = {
3
+ bookmarksInFolder: BookmarkNode[];
4
+ bookmarksOutsideFolder: BookmarkNode[];
5
+ };
6
+ export declare const renderBookmarkNodeTitle: (title: string) => string;
7
+ export declare const categorizeSearchResults: (bookmarks: BookmarkNode[], folderId: string) => CategorizedBookmarkSearchResults;
@@ -11,6 +11,8 @@ import { SearchViewExpansionState } from '../../components/ControlBar/LeftContro
11
11
  * @param {AttachedPageInternal} activePage - Object representing the currently active page in the browser window.
12
12
  * @param {SearchViewExpansionState} shouldExpandMenu - Object with boolean indicating if the search results view should expand and the method of expansion.
13
13
  * @param {string} searchText - String representing the current text in the address input.
14
- * @param {BrowserSearchMenuKeyboardEvent} keyboardEvent - Object representing keyboard event to send to search results view to shift focus or interact with results.
14
+ * @returns {{ sendKeyboardEventToSearchMenuView: (keyboardEvent: BrowserSearchMenuKeyboardEvent) => void }} - Object containing a function to send keyboard events to the search menu view.
15
15
  */
16
- export declare const usePostMessageToSearchMenuView: (selectedViews: OpenFin.Identity[], searchMenuChannel: BroadcastChannel, activePage: AttachedPageInternal, shouldExpandMenu: SearchViewExpansionState, searchText: string, keyboardEvent: BrowserSearchMenuKeyboardEvent) => void;
16
+ export declare const usePostMessageToSearchMenuView: (selectedViews: OpenFin.Identity[], searchMenuChannel: BroadcastChannel, activePage: AttachedPageInternal, shouldExpandMenu: SearchViewExpansionState, searchText: string) => {
17
+ sendKeyboardEventToSearchMenuView: (keyboardEvent: BrowserSearchMenuKeyboardEvent) => Promise<void>;
18
+ };
@@ -1,3 +1,4 @@
1
- import { PanelPosition } from '../../../common/src/api/pages/shapes';
1
+ import { PanelConfigVertical, PanelPosition } from '../../../common/src/api/pages/shapes';
2
2
  export type CSSBounds = Partial<Record<'top' | 'right' | 'bottom' | 'left' | 'height' | 'width', string>>;
3
+ export declare const BookmarksPanelConfig: PanelConfigVertical;
3
4
  export declare const usePanelBounds: (panelPosition: PanelPosition | 'Center') => Partial<Record<"top" | "left" | "height" | "width" | "bottom" | "right", string>>;
@@ -0,0 +1,2 @@
1
+ export declare const useIsPageSingleView: (pageId: string) => boolean;
2
+ export declare const useIsActivePageSingleView: () => boolean;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ type WindowState = 'focused' | 'view-focused' | 'blurred';
3
+ /**
4
+ * Creates a context which exposes information about the specified window's state
5
+ */
6
+ export declare const WindowStateProvider: (props: {
7
+ children: React.ReactNode;
8
+ }) => JSX.Element;
9
+ /**
10
+ * Tracks the window's current state.
11
+ */
12
+ export declare const useWindowState: () => WindowState;
13
+ /**
14
+ * Tracks whether the window or any view within it is focused.
15
+ */
16
+ declare const useWindowFocusState: () => boolean;
17
+ export default useWindowFocusState;
@@ -6,7 +6,7 @@ import type { LaunchAppRequest, SearchSitesRequest, SearchSitesResponse, Site }
6
6
  * @param app the app directory entry.
7
7
  * @param opts launch options.
8
8
  */
9
- export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Application | OpenFin.Identity | OpenFin.Platform | OpenFin.View>;
9
+ export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Application | OpenFin.Identity | OpenFin.View | OpenFin.Platform>;
10
10
  export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
11
11
  export declare function getResults(payload: {
12
12
  req: SearchSitesRequest;
@@ -0,0 +1,6 @@
1
+ import { BookmarkNode, CreateBookmarkNodeRequest, UpdateBookmarkNodeRequest } from '../../../../common/src/api/pages/shapes';
2
+ export declare const createBookmarkNodeInternal: (req: CreateBookmarkNodeRequest) => Promise<BookmarkNode>;
3
+ export declare const getBookmarkNodeInternal: (id?: string) => Promise<BookmarkNode | undefined>;
4
+ export declare const searchBookmarkNodesInternal: (query: string) => Promise<BookmarkNode[]>;
5
+ export declare const updateBookmarkNodeInternal: (req: UpdateBookmarkNodeRequest) => Promise<BookmarkNode | undefined>;
6
+ export declare const deleteBookmarkNodeInternal: (id: string) => Promise<void>;
@@ -6,7 +6,8 @@ export declare enum AnchorBehavior {
6
6
  BottomRight = 1,
7
7
  Center = 2
8
8
  }
9
- export declare const openCommonContextMenu: (payload: OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload | OpenSaveButtonContextMenuPayload, _callerIdentity: OpenFin.Identity, type?: ContextMenuType, anchorBehavior?: AnchorBehavior) => Promise<void>;
9
+ type ContextMenuPayload = OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload | OpenSaveButtonContextMenuPayload;
10
+ export declare const openCommonContextMenu: (payload: ContextMenuPayload, _callerIdentity: OpenFin.Identity, type?: ContextMenuType, anchorBehavior?: AnchorBehavior) => Promise<void>;
10
11
  export declare function openGlobalContextMenuInternal(this: WorkspacePlatformProvider, payload: InternalOpenGlobalContextMenuRequest & {
11
12
  identity: OpenFin.Identity;
12
13
  }, callerIdentity: OpenFin.Identity): Promise<void>;
@@ -19,3 +20,4 @@ export declare function openPageTabContextMenuInternal(this: WorkspacePlatformPr
19
20
  export declare function openSaveButtonContextMenuInternal(this: WorkspacePlatformProvider, payload: OpenSaveButtonContextMenuRequest & {
20
21
  identity: OpenFin.Identity;
21
22
  }, callerIdentity: OpenFin.Identity): Promise<void>;
23
+ export {};
@@ -2,7 +2,7 @@ import type OpenFin from '@openfin/core';
2
2
  import { IconProps, Languages } from '@openfin/ui-library';
3
3
  import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register';
4
4
  import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
5
- import type { AddDefaultPagePayload, AttachedPage, CopyPagePayload, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
5
+ import { AddDefaultPagePayload, AttachedPage, CopyPagePayload, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
6
6
  import { SetActivePageForWindowPayload } from '../../common/src/api/pages/shapes';
7
7
  import { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications';
8
8
  import type { CustomThemes } from '../../common/src/api/theming';
@@ -959,6 +959,9 @@ export interface BrowserWindowModule {
959
959
  * @property {string} [value] - The value associated with the 'custom' type.
960
960
  */
961
961
  updateBrowserWindowTitle(title: WindowTitle): Promise<void>;
962
+ _bookmarks: BrowserBookmarks;
963
+ }
964
+ export interface BrowserBookmarks {
962
965
  }
963
966
  /**
964
967
  * Factory for wrapping browser windows and global operations.
@@ -1519,6 +1522,7 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
1519
1522
  * Implementation for getting the notifications workspace platform configuration.
1520
1523
  */
1521
1524
  getNotificationsConfig(): Promise<NotificationsCustomManifestOptions | undefined>;
1525
+ _raiseAnalytics(events: AnalyticsEventInternal[]): Promise<void>;
1522
1526
  /**
1523
1527
  * The browser window factory for the Workspace Platform.
1524
1528
  */
@@ -1531,7 +1535,6 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
1531
1535
  * Theme API for the Workspace Platform.
1532
1536
  */
1533
1537
  Theme: ThemeApi;
1534
- _raiseAnalytics(events: AnalyticsEventInternal[]): Promise<void>;
1535
1538
  }
1536
1539
  export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
1537
1540
  /**
@@ -256,4 +256,95 @@ export type AddPagePayload = {
256
256
  /** Index at which the page should be added */
257
257
  insertionIndex?: number;
258
258
  };
259
+ /**
260
+ * A node that represents either a bookmark or folder in the bookmark tree.
261
+ */
262
+ export interface BookmarkNode {
263
+ /**
264
+ * The unique id of the node.
265
+ */
266
+ id: string;
267
+ /**
268
+ * The title of the bookmark or folder.
269
+ */
270
+ title: string;
271
+ /**
272
+ * The unique URL associated with a bookmark. Is undefined for folders.
273
+ */
274
+ url?: string;
275
+ /**
276
+ * When this bookmark or folder was created, in milliseconds since the epoch.
277
+ */
278
+ dateCreated: number;
279
+ /**
280
+ * The favicon to display next to titles for bookmarks. When no icon or a
281
+ * broken icon is provided, the default globe icon will be used instead. Is
282
+ * undefined for folders.
283
+ */
284
+ favIcon?: string;
285
+ /**
286
+ * The id of the parent folder that contains a bookmark. Is undefined for the
287
+ * root node.
288
+ */
289
+ parentId?: string;
290
+ /**
291
+ * The children of this node. Can only contain bookmarks. Is undefined for
292
+ * bookmarks.
293
+ */
294
+ children?: BookmarkNode[];
295
+ }
296
+ /**
297
+ * Request object to create a new bookmark node.
298
+ */
299
+ export interface CreateBookmarkNodeRequest {
300
+ /**
301
+ * The title of the bookmark or folder.
302
+ */
303
+ title: string;
304
+ /**
305
+ * The unique URL associated with the bookmark. Omit for folders.
306
+ */
307
+ url?: string;
308
+ /**
309
+ * The favicon to display next to titles for bookmarks. When no icon or a
310
+ * broken icon is provided, the default globe icon will be used instead. Omit
311
+ * for folders.
312
+ */
313
+ favIcon?: string;
314
+ /**
315
+ * The id of the parent folder for this bookmark. Omit for bookmarks under
316
+ * "All Bookmarks" and folders.
317
+ */
318
+ parentId?: string;
319
+ }
320
+ export type UpdatedBookmarkNodeAttrs = {
321
+ /**
322
+ * The new title to apply to the bookmark/folder.
323
+ */
324
+ title?: string;
325
+ /**
326
+ * The id of the parent folder to move this bookmark to. Leave undefined to
327
+ * move bookmark under "All Bookmarks". Omit for folders.
328
+ */
329
+ parentId?: string;
330
+ /**
331
+ * The favicon to display next to titles for bookmarks. When no icon or a
332
+ * broken icon is provided, the default globe icon will be used instead. Omit
333
+ * for folders.
334
+ */
335
+ favIcon?: string;
336
+ };
337
+ /**
338
+ * Request object to update a bookmark node.
339
+ */
340
+ export interface UpdateBookmarkNodeRequest {
341
+ /**
342
+ * The unique id of the bookmark.
343
+ */
344
+ id: string;
345
+ /**
346
+ * The object describing which attributes of the bookmark to update.
347
+ */
348
+ changes: UpdatedBookmarkNodeAttrs;
349
+ }
259
350
  export {};
@@ -32,7 +32,8 @@ declare enum GeneralBrowserChannelActions {
32
32
  DuplicatePage = "duplicate-page",
33
33
  SetSelectedScheme = "set-selected-scheme",
34
34
  ShowBrowserIndicator = "show-browser-indicator",
35
- SetSelectedLanguage = "set-selected-language"
35
+ SetSelectedLanguage = "set-selected-language",
36
+ RefreshBookmarksInternal = "refresh-bookmarks"
36
37
  }
37
38
  /**
38
39
  * All of the remote procedures that can be called in the
@@ -73,6 +74,7 @@ export declare const BrowserChannelAction: {
73
74
  SetSelectedScheme: GeneralBrowserChannelActions.SetSelectedScheme;
74
75
  ShowBrowserIndicator: GeneralBrowserChannelActions.ShowBrowserIndicator;
75
76
  SetSelectedLanguage: GeneralBrowserChannelActions.SetSelectedLanguage;
77
+ RefreshBookmarksInternal: GeneralBrowserChannelActions.RefreshBookmarksInternal;
76
78
  };
77
79
  export type BrowserChannelAction = typeof BrowserChannelAction;
78
80
  export {};
@@ -72,6 +72,7 @@ export declare enum WorkspacePlatformChannelAction {
72
72
  SearchSitesInternal = "searchSitesInternal",
73
73
  GetCuratedContentInternal = "getCuratedContentInternal",
74
74
  HandleRequestNavigationInternal = "handleRequestNavigationInternal",
75
+ RefreshBookmarksInternal = "refreshBookmarksInternal",
75
76
  GetNotificationsConfig = "getNotificationsConfig"
76
77
  }
77
78
  export type PlatFormSupportedFeatures = boolean | {
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import { SizeType } from '@openfin/ui-library';
3
+ export interface Props {
4
+ /**
5
+ * Icon to be shown for the control.
6
+ *
7
+ * Accepts base64, url, or variables in CSS format.
8
+ */
9
+ icon?: string;
10
+ /**
11
+ * Title to be applied as a `title` attribute on the button.
12
+ */
13
+ title?: string;
14
+ /**
15
+ * whether the button title property should be in title case
16
+ * @default true
17
+ */
18
+ withTitleCase?: boolean;
19
+ /**
20
+ * Additional CSS classes to be applied to the button.
21
+ *
22
+ * This can be useful when a unique style needs to be applied, for example, in a close button.
23
+ */
24
+ className?: string;
25
+ /** When the button is disabled, it cannot be clicked and mouseover does not have an effect */
26
+ disabled?: boolean;
27
+ /** Button selected state. Can be used to implement sticky buttons. */
28
+ selected?: boolean;
29
+ /** Use wide button */
30
+ wide?: boolean;
31
+ /** Disable hover/active background-color change */
32
+ hoverless?: boolean;
33
+ /** If not set, svgs in the button will be forced to 13px */
34
+ customContentSize?: boolean;
35
+ /** Border radius of the button. If not set defaults to 0px */
36
+ borderRadius?: SizeType;
37
+ /**
38
+ * The `onClick` handler for when the button is closed.
39
+ *
40
+ * It is up to the implementor to properly handle the event as they see fit.
41
+ */
42
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
43
+ children: React.ReactNode | React.ReactNode[];
44
+ width?: number;
45
+ height?: number;
46
+ isEnterprise?: boolean;
47
+ }
48
+ /**
49
+ * Provides a basic browser title bar navigation button look and feel.
50
+ * Ensure the title is printed in “Title Case”.
51
+ *
52
+ * Note: This relies on global CSS and is written to run within the context of the Browser window which contains these globals.
53
+ */
54
+ declare const BaseButton: React.ForwardRefExoticComponent<Props & React.HTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
55
+ export default BaseButton;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { Dispatch, SetStateAction } from 'react';
2
2
  import { ProviderInfoInternal, ProviderType } from '../../../common/src/api/provider';
3
3
  export type ProviderContext<T extends ProviderType = any> = {
4
4
  /**
@@ -48,3 +48,11 @@ export declare const BrowserLayoutDragContext: import("react").Context<{
48
48
  export declare const BrowserContext: ({ children }: {
49
49
  children?: React.ReactNode;
50
50
  }) => JSX.Element;
51
+ export declare const BookmarksContext: import("react").Context<{
52
+ mostRecentlyUpdated: number;
53
+ isBookmarksPanelOpen: boolean;
54
+ setIsBookmarksPanelOpen: Dispatch<SetStateAction<boolean>>;
55
+ }>;
56
+ export declare const BookmarksContextProvider: ({ children }: {
57
+ children?: React.ReactNode;
58
+ }) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { MutableRefObject } from 'react';
2
+ import OpenFin from '@openfin/core';
3
+ export declare const useAddEditBookmarkDialog: (bookmarkIconRef: MutableRefObject<HTMLElement | null>, selectedView?: OpenFin.View) => {
4
+ showDialog: () => Promise<void>;
5
+ isDialogShown: boolean;
6
+ isBookmarkUpdatedOrCreated: boolean;
7
+ };
@@ -0,0 +1,13 @@
1
+ import type OpenFin from '@openfin/core';
2
+ interface PreloadedWindowOptions {
3
+ windowName: string;
4
+ route: string;
5
+ width?: number;
6
+ height?: number;
7
+ windowType?: string;
8
+ shouldPreload: boolean;
9
+ }
10
+ export default function usePreloadedWindow({ windowName, route, width, height, windowType, shouldPreload }: PreloadedWindowOptions & {
11
+ shouldPreload?: boolean;
12
+ }): OpenFin.Window;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ import { OpenFin } from '@openfin/core';
2
+ import { BookmarkItemContextMenuItemTemplate } from '../../../client-api-platform/src/shapes';
3
+ export declare const getBookmarkItemContextMenuTemplate: (callerIdentity: OpenFin.Identity, bookmarkId: string) => Promise<BookmarkItemContextMenuItemTemplate[]>;
@@ -0,0 +1,12 @@
1
+ import { BookmarkNode } from '../../../common/src/api/pages/shapes';
2
+ export declare const ALL_BOOKMARKS_FOLDER_TITLE = "_ALL_BOOKMARKS_";
3
+ export declare const FAVORITES_FOLDER_TITLE = "_FAVORITES_";
4
+ export type BookmarkFolder = {
5
+ id: string;
6
+ title: string;
7
+ };
8
+ export declare const sortBookmarks: (a: BookmarkNode, b: BookmarkNode) => number;
9
+ export declare const collectFolders: (nodes: Array<BookmarkNode>) => Array<BookmarkFolder>;
10
+ export declare const collectFoldersExcludingBuiltin: (nodes: Array<BookmarkNode>) => Array<BookmarkFolder>;
11
+ export declare const prioritizeFolders: (folders: Array<BookmarkFolder>) => Array<BookmarkFolder>;
12
+ export declare const getBookmarkFoldersList: (rootNode: BookmarkNode) => BookmarkFolder[];
@@ -0,0 +1,13 @@
1
+ import OpenFin from '@openfin/core';
2
+ export declare const getContextMenuChannelName: () => string;
3
+ export declare const getBookmarkContextMenuChannelName: () => string;
4
+ export declare const getBookmarkPanelActionsMonitorChannelName: () => string;
5
+ export declare const getDropdownMenuChannelName: () => string;
6
+ export declare const createDropdownMenuChannel: () => Promise<OpenFin.ChannelProvider>;
7
+ export declare const connectDropdownMenuChannel: () => Promise<OpenFin.ChannelClient>;
8
+ export declare const createBookmarkDialogChannel: () => Promise<OpenFin.ChannelProvider>;
9
+ export declare const connectToBookmarkDialogChannel: () => Promise<OpenFin.ChannelClient>;
10
+ export declare const createBookmarkPanelActionsMonitorChannel: () => Promise<OpenFin.ChannelProvider>;
11
+ export declare const connectToBookmarkPanelActionsMonitor: () => Promise<OpenFin.ChannelClient>;
12
+ export declare const createContextMenuChannel: () => Promise<OpenFin.ChannelProvider>;
13
+ export declare const connectToContextMenuChannel: () => Promise<OpenFin.ChannelClient>;
@@ -0,0 +1,3 @@
1
+ import OpenFin from '@openfin/core';
2
+ export declare const getBrowserWindow: () => Promise<import("client-api-platform").BrowserWindowModule>;
3
+ export declare const getBrowserWindowWithoutView: (browserIdentity?: OpenFin.Identity) => Promise<import("client-api-platform").BrowserWindowModule>;
@@ -37,4 +37,5 @@ export type ButtonConfig = {
37
37
  label: string;
38
38
  type: 'primary' | 'secondary';
39
39
  id: string;
40
+ variant?: 'critical' | 'outline';
40
41
  };
@@ -10,12 +10,4 @@ import { ResponseModalConfig } from './menu-config';
10
10
  * @returns the bounds for where the modal is to be displayed
11
11
  */
12
12
  export declare const getResponseModalBounds: (modalOptions: ResponseModalConfig['windowOptions'], parentWindowIdentity?: OpenFin.Identity, centerOnMonitor?: boolean) => Promise<OpenFin.Bounds>;
13
- /**
14
- * calculates the percenage of the window that is present within the monitor (float in range 0-1)
15
- *
16
- * @param bounds the bounds of the window
17
- * @param monitor the monitor to check against
18
- */
19
- export declare function getPercentageOfBoundsInMonitor(bounds: OpenFin.Bounds, monitor: OpenFin.MonitorDetails): number;
20
- export declare function getMonitorWindowMaximizedOn(parentWindowBounds: OpenFin.WindowBounds): Promise<OpenFin.MonitorDetails>;
21
13
  export declare function getResponseModalBoundsAndCenterParentIfModalOffScreen(modalOptions: ResponseModalConfig['windowOptions'], parentWindowIdentity?: OpenFin.Identity, centerOnMonitor?: boolean): Promise<OpenFin.Bounds>;
@@ -1,4 +1,5 @@
1
1
  import type OpenFin from '@openfin/core';
2
+ import { BookmarkFolder } from '../../../common/src/utils/bookmarks';
2
3
  import { UserMenuParams } from '../../../common/src/utils/menu';
3
4
  import { OptionalExceptFor } from '../../../common/src/utils/types';
4
5
  import { AnchorBehavior } from '../../../client-api-platform/src/api/context-menu';
@@ -42,16 +43,26 @@ export type SearchMenuChannelRequest = SearchMenuChannelViewResized | SearchMenu
42
43
  export declare enum ContextMenuType {
43
44
  GlobalMenu = "global-menu",
44
45
  ContextMenu = "context-menu",
45
- RenameSupertab = "rename-supertab"
46
+ RenameSupertab = "rename-supertab",
47
+ AddEditBookmark = "add-edit-bookmark",
48
+ DropdownMenu = "dropdown-menu"
46
49
  }
50
+ export type BookmarkButtonPayload = {
51
+ selectedViewIdentity?: OpenFin.Identity;
52
+ };
47
53
  export type ContextMenuChannelMessageData = {
48
54
  parentIdentity: OpenFin.Identity;
55
+ responseIdentity: OpenFin.Identity;
49
56
  anchorBehavior: AnchorBehavior;
50
57
  type: ContextMenuType;
51
58
  x: number;
52
59
  y: number;
53
60
  payload: OpenFin.ShowPopupMenuOptions | {
54
61
  pageId: string;
62
+ } | BookmarkButtonPayload | {
63
+ dropdownOptions: Array<BookmarkFolder>;
64
+ width: number;
65
+ selected: BookmarkFolder;
55
66
  };
56
67
  };
57
68
  export type SearchMenuChannelResponse = {