@interopio/home-ui-react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +312 -0
  2. package/assets/fonts/nunito-regular-webfont.woff +0 -0
  3. package/assets/fonts/nunito-regular-webfont.woff2 +0 -0
  4. package/assets/fonts/nunito-semibold-webfont.woff +0 -0
  5. package/assets/fonts/nunito-semibold-webfont.woff2 +0 -0
  6. package/assets/glue-logo.json +5 -0
  7. package/common/types.d.ts +2 -0
  8. package/constants/contextMenuActions.d.ts +15 -0
  9. package/constants/defaults.d.ts +2 -0
  10. package/constants/itemTypes.d.ts +5 -0
  11. package/constants/modifierKeys.d.ts +4 -0
  12. package/constants/storageKeys.d.ts +3 -0
  13. package/decoders/base.d.ts +2 -0
  14. package/decoders/context-menu.d.ts +3 -0
  15. package/decoders/favorites.d.ts +3 -0
  16. package/decoders/layouts.d.ts +3 -0
  17. package/executors/applicationActions.d.ts +6 -0
  18. package/executors/workspaceActions.d.ts +5 -0
  19. package/helpers/a11y.d.ts +39 -0
  20. package/helpers/date.d.ts +1 -0
  21. package/helpers/string.d.ts +1 -0
  22. package/hooks/index.d.ts +15 -0
  23. package/hooks/useApplications.d.ts +2 -0
  24. package/hooks/useApplicationsInstances.d.ts +3 -0
  25. package/hooks/useExecuteApplicationAction.d.ts +2 -0
  26. package/hooks/useExecuteWorkspaceAction.d.ts +2 -0
  27. package/hooks/useFavoriteEntities.d.ts +6 -0
  28. package/hooks/useFrame.d.ts +2 -0
  29. package/hooks/useInvokeInteropMethod.d.ts +2 -0
  30. package/hooks/usePressedKeys.d.ts +1 -0
  31. package/hooks/useRestoreWorkspace.d.ts +2 -0
  32. package/hooks/useSearch.d.ts +5 -0
  33. package/hooks/useStartApplication.d.ts +1 -0
  34. package/hooks/useStorage.d.ts +4 -0
  35. package/hooks/useUA.d.ts +2 -0
  36. package/hooks/useWorkspaces.d.ts +2 -0
  37. package/hooks/useWorkspacesInstances.d.ts +3 -0
  38. package/images/initial-setup.gif +0 -0
  39. package/images/manual-permissions.gif +0 -0
  40. package/images/using-home.gif +0 -0
  41. package/index.css +1 -0
  42. package/index.d.ts +33 -0
  43. package/index.js +43 -0
  44. package/index.js.map +1 -0
  45. package/index.mjs +7092 -0
  46. package/index.mjs.map +1 -0
  47. package/lib/applications-section/applications-section.d.ts +3 -0
  48. package/lib/applications-section/applications-section.helpers.d.ts +5 -0
  49. package/lib/base-section/base-section-header.d.ts +8 -0
  50. package/lib/base-section/base-section-item.d.ts +13 -0
  51. package/lib/base-section/base-section.d.ts +15 -0
  52. package/lib/base-section/base-section.helpers.d.ts +2 -0
  53. package/lib/base-section/base-section.types.d.ts +19 -0
  54. package/lib/button/button.d.ts +7 -0
  55. package/lib/button-group/button-group.d.ts +8 -0
  56. package/lib/context-menu/context-menu-types.d.ts +9 -0
  57. package/lib/context-menu/context-menu.d.ts +10 -0
  58. package/lib/context-menu/dropdown-button/dropdown-button.d.ts +12 -0
  59. package/lib/favorites-section/favorites-section.d.ts +3 -0
  60. package/lib/favorites-section/favorites-section.helpers.d.ts +3 -0
  61. package/lib/glue42-home-provider/constants.d.ts +1 -0
  62. package/lib/glue42-home-provider/glue42-home-provider.d.ts +15 -0
  63. package/lib/glue42-home-provider/helpers.d.ts +2 -0
  64. package/lib/glue42-home-provider/types.d.ts +4 -0
  65. package/lib/icon/icon.d.ts +9 -0
  66. package/lib/icon-components/browser-notifications-icon.d.ts +3 -0
  67. package/lib/icon-components/index.d.ts +4 -0
  68. package/lib/icon-components/reopen-prompt-icon.d.ts +3 -0
  69. package/lib/icon-components/warning-icon.d.ts +3 -0
  70. package/lib/icon-components/window-placement-icon.d.ts +3 -0
  71. package/lib/img-icon/img-icon.d.ts +8 -0
  72. package/lib/launchpad/features/profile-settings/profile-settings.d.ts +9 -0
  73. package/lib/launchpad/features/profile-settings/user-profile-modal.d.ts +10 -0
  74. package/lib/launchpad/launchpad.context.d.ts +12 -0
  75. package/lib/launchpad/launchpad.d.ts +14 -0
  76. package/lib/layout-settings/constants.d.ts +2 -0
  77. package/lib/layout-settings/index.d.ts +2 -0
  78. package/lib/layout-settings/layout-actions.d.ts +8 -0
  79. package/lib/layout-settings/layout-item.d.ts +9 -0
  80. package/lib/layout-settings/layout-notification.d.ts +7 -0
  81. package/lib/layout-settings/layout-settings-container.d.ts +3 -0
  82. package/lib/layout-settings/layout-settings.d.ts +12 -0
  83. package/lib/layout-settings/layout-startup.d.ts +2 -0
  84. package/lib/layout-settings/layout-types.d.ts +30 -0
  85. package/lib/login/constants.d.ts +1 -0
  86. package/lib/login/index.d.ts +3 -0
  87. package/lib/login/login-auth0.d.ts +6 -0
  88. package/lib/login/login-form.d.ts +11 -0
  89. package/lib/login/login-heading.d.ts +6 -0
  90. package/lib/login/login-loader.d.ts +3 -0
  91. package/lib/login/login-logo.d.ts +7 -0
  92. package/lib/login/login.d.ts +8 -0
  93. package/lib/login/reducers.d.ts +3 -0
  94. package/lib/login/types.d.ts +16 -0
  95. package/lib/modal/modal.d.ts +9 -0
  96. package/lib/notifications-panel/index.d.ts +1 -0
  97. package/lib/notifications-panel/notification-toast.d.ts +17 -0
  98. package/lib/notifications-panel/notifications-modal.d.ts +4 -0
  99. package/lib/notifications-panel/notifications-panel.d.ts +3 -0
  100. package/lib/notifications-panel/useNotificationsSort.d.ts +13 -0
  101. package/lib/panels/launchpad-slide-panel.d.ts +12 -0
  102. package/lib/panels/slide-panel.d.ts +9 -0
  103. package/lib/permissions-setup/constants.d.ts +5 -0
  104. package/lib/permissions-setup/permissions-card.d.ts +10 -0
  105. package/lib/permissions-setup/permissions-list.d.ts +8 -0
  106. package/lib/permissions-setup/permissions-setup-flow.d.ts +8 -0
  107. package/lib/permissions-setup/permissions-setup.d.ts +13 -0
  108. package/lib/permissions-setup/permissions-steps.d.ts +8 -0
  109. package/lib/permissions-setup/something-went-wrong.d.ts +6 -0
  110. package/lib/permissions-setup/types.d.ts +14 -0
  111. package/lib/permissions-setup/unsuccessful-setup.d.ts +7 -0
  112. package/lib/permissions-setup/use-edge-notifications-permission.d.ts +6 -0
  113. package/lib/profile-details-card/profile-details-card.d.ts +8 -0
  114. package/lib/search/search-bar/search-bar.d.ts +8 -0
  115. package/lib/search/search-results-section/search-results-section.d.ts +6 -0
  116. package/lib/search/search-results-section/search-results-section.helpers.d.ts +3 -0
  117. package/lib/search/search-results-section/search-results-section.types.d.ts +8 -0
  118. package/lib/section/section.context.d.ts +11 -0
  119. package/lib/section/section.d.ts +12 -0
  120. package/lib/section/section.helpers.d.ts +3 -0
  121. package/lib/section/section.types.d.ts +8 -0
  122. package/lib/settings-card/settings-card.d.ts +3 -0
  123. package/lib/support-card/support-card.d.ts +9 -0
  124. package/lib/workspaces-section/workspaces-section.d.ts +3 -0
  125. package/lib/workspaces-section/workspaces-section.helpers.d.ts +5 -0
  126. package/lib/workspaces-section/workspaces-section.types.d.ts +4 -0
  127. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,312 @@
1
+ ## Overview
2
+
3
+ The [`@interopio/home-ui-react`](https://www.npmjs.com/package/@interopio/home-ui-react) library provides React components and hooks that enable you to create and customize a Home App for your [**io.Connect Browser**](https://interop.io/products/io-connect/) projects.
4
+
5
+ The Home App is meant to enhance the user and developer experience when creating an **io.Connect Browser** project. It provides flows for authentication and authorization using Auth0 integration, and for initial setup in order to acquire all necessary browser permissions from the user. The Home App also includes a Launchpad app which is the central hub for io.Connect apps, Workspaces, Global Layouts, notifications, search and user profile settings. For **io.Connect Browser** projects, the Home App can be built as a Main app, or as a Main app that's also a Workspaces App.
6
+
7
+ ## Using the Home App
8
+
9
+ The following examples show a Home App that's also a Workspaces App and demonstrate its basic end-user functionalities - from initial user setup to a more advanced usage of its UI elements.
10
+
11
+ The Home App is the entry point of an **io.Connect Browser** project. When you first load the Home App in the browser, you will be presented with a login form. After a successful login, the app will initiate a first-time user setup flow which includes granting all required browser permissions to ensure that the **io.Connect Browser** project will function properly:
12
+
13
+ ![Initial Setup](./images/initial-setup.gif)
14
+
15
+ If you don't grant all required permissions, the **io.Connect Browser** platform won't be able to operate and a page for unsuccessful user setup will appear. You will then have to grant the necessary browser permissions manually:
16
+
17
+ ![Manual Permissions](./images/manual-permissions.gif)
18
+
19
+ If the setup flow completes successfully, you will be able to start exploring and using the Home App. The main operational hub of the Home App is the Launchpad, accessible from the logo button of the Home App. The Launchpad is the place from which you can manage Workspaces and Global Layouts, start apps, select favorites for easy access, use the search bar to find anything within the platform, see notifications and user profile settings:
20
+
21
+ ![Using Home](./images/using-home.gif)
22
+
23
+ ## Install
24
+
25
+ To use the [`@interopio/home-ui-react`](https://www.npmjs.com/package/@interopio/home-ui-react) library in your project, execute the following command:
26
+
27
+ ```cmd
28
+ npm install @interopio/home-ui-react
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ The [`@interopio/home-ui-react`](https://www.npmjs.com/package/@interopio/home-ui-react) library offers React hooks and components that your can use to customize the look and functionalities of the Home App.
34
+
35
+ The [`@interopio/home-ui-react`](https://www.npmjs.com/package/@interopio/home-ui-react) library is meant to be used within a Main app of an **io.Connect Browser** project or a Main app that's also a Workspaces App.
36
+
37
+ ### Hooks
38
+
39
+ The `useGlue42Home()` hook provides information about the current state of the required browser permissions:
40
+
41
+ ```javascript
42
+ const { permissions } = useGlue42Home();
43
+ ```
44
+
45
+ The returned object has the following properties:
46
+
47
+ | Property | Type | Description |
48
+ |----------|------|-------------|
49
+ | `isDenied` | `boolean` | If `true`, the current browser permission has been denied by the user. |
50
+ | `isLoading` | `boolean` | If `true`, the current browser permission is being set. |
51
+ | `isSetupCompleted` | `boolean` | If `true`, the first-time user setup flow has been completed. |
52
+ | `statuses` | `object[]` | Array of objects each describing the state of the required browser permissions. |
53
+
54
+ Each permission status object has the following properties:
55
+
56
+ | Property | Type | Description |
57
+ |----------|------|-------------|
58
+ | `name` | `"notifications"` \| `"window-management"` | The name of the browser permission. |
59
+ | `state` | `"denied"` \| `"granted"` \| `"prompt"` | The state of the browser permission. |
60
+
61
+ ### Components
62
+
63
+ The following lists the more important default components exported by the library:
64
+
65
+ | Component | Description |
66
+ |-----------|-------------|
67
+ | `<Glue42HomeProvider />` | Context provider component containing information about the current state of the required browser permissions. |
68
+ | `<Launchpad />` | The main component containing the Launchpad. |
69
+ | `<LaunchpadSlidePanel />` | Wrapper component around the `<Launchpad />` component allowing it to open as a sliding panel. |
70
+ | `<PermissionsSetup />` | Component providing a setup flow for obtaining the required browser permissions from the user. |
71
+ | `<LoginAuth0 />` | Component for handling the integrated Auth0 authentication and authorization process. |
72
+
73
+ The following lists the main components comprising the `<Launchpad />` component and exported by the library:
74
+
75
+ | Component | Description |
76
+ |-----------|-------------|
77
+ | `<ApplicationsSection />` | Component containing a section in the Launchpad with the available io.Connect apps. |
78
+ | `<FavoritesSection />` | Component containing a section in the Launchpad with favorite items. |
79
+ | `<LayoutSettingsContainer />` | Component containing a section in the Launchpad with Global Layout settings. |
80
+ | `<NotificationsPanel />` | Component containing the notifications panel shown when the user clicks on the notifications icon in the Launchpad. |
81
+ | `<ProfileSettings />` | Component containing a profile and settings section shown when the user clicks on the profile icon in the Launchpad. |
82
+ | `<SearchBar />` | Component containing the search bar providing the Global Search functionality. |
83
+ | `<SearchResultsSection />` | Component containing the search results and shown when the user starts typing in the search bar. |
84
+ | `<WorkspacesSection />` | Component containing a section in the Launchpad with Workspace Layouts. |
85
+
86
+ #### Launchpad Slide Panel Component
87
+
88
+ The following demonstrates the default structure of the `<LaunchpadSlidePanel />` component:
89
+
90
+ ```javascript
91
+ <LaunchpadSlidePanel>
92
+ <SlidePanel>
93
+ <Launchpad />
94
+ </SlidePanel>
95
+ </LaunchpadSlidePanel>
96
+ ```
97
+
98
+ #### Launchpad Component
99
+
100
+ The following demonstrates the default structure of the `<Launchpad />` component:
101
+
102
+ ```javascript
103
+ <Launchpad>
104
+ <LaunchpadAPIProvider>
105
+ <div>
106
+ <header>
107
+ <SearchBar />
108
+ <div>
109
+ <Icon />
110
+ <span>
111
+ {/* User initials. */}
112
+ </span>
113
+ </div>
114
+ <Icon />
115
+ </header>
116
+ <main>
117
+ {searchTerm.trim().length < 3 ?
118
+ <SectionProvider>
119
+ <ul>
120
+ <>
121
+ <FavoritesSection />
122
+ <WorkspacesSection />
123
+ <ApplicationsSection />
124
+ </>
125
+ </ul>
126
+ </SectionProvider> :
127
+ <SearchResultsSection searchTerm={searchTerm} />
128
+ }
129
+ </main>
130
+ <LayoutSettingsContainer />
131
+ </div>
132
+ <Dialog>
133
+ <NotificationsPanel />
134
+ </Dialog>
135
+ <Dialog>
136
+ <ProfileSettings />
137
+ </Dialog>
138
+ </LaunchpadAPIProvider>
139
+ </Launchpad>
140
+ ```
141
+
142
+ The `<Launchpad />` component has the following properties:
143
+
144
+ ```javascript
145
+ <Launchpad
146
+ components={{
147
+ sections: <></>
148
+ }}
149
+
150
+ onLogout={() => {}}
151
+
152
+ open={false}
153
+
154
+ setOpen={() => {}}
155
+
156
+ user={{
157
+ name: "N A"
158
+ }}
159
+ />
160
+ ```
161
+
162
+ ### Authentication & Authorization
163
+
164
+ The Home App provides a process for authentication and authorization using Auth0 integration. If your organization uses other authentication and authorization mechanisms, you can substitute the default implementation with your custom one when building your Home App.
165
+
166
+ ### Examples
167
+
168
+ The following examples demonstrate a basic implementations of a Home App with authentication and browser permission flows, using the default library hooks and components.
169
+
170
+ Wrapping the `<App />` component in the `<Glue42HomeProvider />` and the `<Auth0Provider />` context provider components in order to obtain the necessary data related to authentication and browser permissions:
171
+
172
+ ```javascript
173
+ import { StrictMode } from "react";
174
+ import * as ReactDOM from "react-dom/client";
175
+ import { Auth0Provider } from "@auth0/auth0-react";
176
+ import { Glue42HomeProvider } from "@glue42/home-ui-react";
177
+ import App from "./app/App";
178
+
179
+ const root = ReactDOM.createRoot(
180
+ document.getElementById("root") as HTMLElement
181
+ );
182
+
183
+ root.render(
184
+ <StrictMode>
185
+ <Auth0Provider
186
+ domain={"platform-auth-domain"}
187
+ clientId={"client-id"}
188
+ authorizationParams={{
189
+ redirect_uri: window.location.origin,
190
+ }}
191
+ >
192
+ <Glue42HomeProvider>
193
+ <App />
194
+ </Glue42HomeProvider>
195
+ </Auth0Provider>
196
+ </StrictMode>
197
+ );
198
+ ```
199
+
200
+ Creating a Workspaces App that will act as a Main App for the **io.Connect Browser** project:
201
+
202
+ ```javascript
203
+ import { useAuth0 } from "@auth0/auth0-react";
204
+ import Glue42CorePlus from "@glue42/core-plus";
205
+ import { GlueProvider } from "@glue42/react-hooks";
206
+ import GlueWorkspaces from "@glue42/workspaces-api";
207
+ import Workspaces from "@glue42/workspaces-ui-react";
208
+ import { PermissionsSetup, useGlue42Home } from "@glue42/home-ui-react";
209
+ import LoginPage from "../login/LoginPage";
210
+ import LaunchpadButton from "../LaunchpadButton";
211
+ import "@glue42/workspaces-ui-react/dist/styles/workspaces.css";
212
+
213
+ const App = () => {
214
+ const { isAuthenticated } = useAuth0();
215
+ const { permission } = useGlue42Home();
216
+
217
+ // Settings for initializing the io.Connect Browser platform.
218
+ const platformSettings = {
219
+ webPlatform: {
220
+ factory: Glue42CorePlus,
221
+ config: {
222
+ workspaces: {
223
+ src: "/",
224
+ isFrame: true
225
+ },
226
+ layouts: {
227
+ mode: "idb"
228
+ },
229
+ glue: {
230
+ libraries: [GlueWorkspaces]
231
+ },
232
+ licenseKey: "my-license-key"
233
+ }
234
+ }
235
+ };
236
+
237
+ // Initiate the authentication flow.
238
+ if (!isAuthenticated) {
239
+ return <LoginPage />;
240
+ };
241
+
242
+ // Initiate the flow for acquiring browser permissions.
243
+ if (!permission.isSetupCompleted) {
244
+ return <PermissionsSetup />;
245
+ };
246
+
247
+ return (
248
+ <GlueProvider settings={platformSettings}>
249
+ <Workspaces
250
+ components={{
251
+ // Replace the default Workspaces App logo
252
+ // with a button that will open the Launchpad.
253
+ header: { LogoComponent: LaunchpadButton }
254
+ }}
255
+ />
256
+ </GlueProvider>
257
+ );
258
+ };
259
+
260
+ export default App;
261
+ ```
262
+
263
+ Implementing a login page:
264
+
265
+ ```javascript
266
+ import { useAuth0 } from "@auth0/auth0-react";
267
+ import { LoginLoader, LoginAuth0 } from "@glue42/home-ui-react";
268
+ import { LoginLoaderHeading } from "./LoginLoaderHeading";
269
+
270
+ const LoginPage = () => {
271
+ const { loginWithPopup, isLoading } = useAuth0();
272
+
273
+ return (
274
+ <div>
275
+ {isLoading ?
276
+ <LoginLoader components={{ Heading: LoginLoaderHeading }} /> :
277
+ <LoginAuth0 onLogin={loginWithPopup} />
278
+ }
279
+ </div>
280
+ );
281
+ };
282
+
283
+ export default LoginPage;
284
+ ```
285
+
286
+ Implementing the button that will open the Launchpad:
287
+
288
+ ```javascript
289
+ import { useContext } from "react";
290
+ import { useAuth0 } from "@auth0/auth0-react";
291
+ import { GlueContext } from "@glue42/react-hooks";
292
+ import { GlueLogo } from "@glue42/workspaces-ui-react";
293
+ import { LaunchPadSlidePanel } from "@glue42/home-ui-react";
294
+
295
+ const LaunchpadButton = () => {
296
+ const { logout, user } = useAuth0();
297
+ const glue = useContext(GlueContext);
298
+
299
+ // Logout handler.
300
+ const handleLogout = async () => {
301
+ // Shutting down the io.Connect Browser platform.
302
+ await glue.webPlatform?.system.shutdown();
303
+
304
+ logout();
305
+ };
306
+
307
+ // Slide panel that contains the `<Launchpad />` component with its default structure.
308
+ return <LaunchPadSlidePanel user={user} onLogout={handleLogout} icon={<GlueLogo />} />
309
+ };
310
+
311
+ export default LaunchpadButton;
312
+ ```
@@ -0,0 +1,5 @@
1
+ {
2
+ "loginPageLogo": {
3
+ "value": "data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"
4
+ }
5
+ }
@@ -0,0 +1,2 @@
1
+ import { SectionItemType } from '../lib/section/section.types';
2
+ export type FavoriteEntity = Omit<SectionItemType, 'isOpen'>;
@@ -0,0 +1,15 @@
1
+ import { ContextMenuAction } from '../lib/context-menu/context-menu-types';
2
+ export declare const APPLICATION_ACTIONS_NAMES: {
3
+ readonly OPEN_IN_NEW_WINDOW: "openInNewWindow";
4
+ readonly OPEN_IN_NEW_WORKSPACE: "openInNewWorkspace";
5
+ };
6
+ export declare const WORKSPACE_ACTIONS_NAMES: {
7
+ readonly OPEN_IN_NEW_FRAME: "openInNewFrame";
8
+ readonly DELETE: "delete";
9
+ };
10
+ export declare const LAYOUT_ACTIONS_NAMES: {
11
+ readonly SET_AS_DEFAULT: "setAsDefault";
12
+ readonly DELETE: "delete";
13
+ };
14
+ export declare const APPLICATION_ACTIONS: ContextMenuAction[];
15
+ export declare const WORKSPACE_ACTIONS: ContextMenuAction[];
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_GLOBAL_LAYOUT = "Welcome";
2
+ export declare const DEFAULT_DISPLAY_COUNT = 5;
@@ -0,0 +1,5 @@
1
+ export declare const ITEM_TYPES: {
2
+ readonly APPLICATION: "application";
3
+ readonly WORKSPACE: "workspace";
4
+ readonly LAYOUT: "layout";
5
+ };
@@ -0,0 +1,4 @@
1
+ export declare const MODIFIER_KEYS: {
2
+ readonly CONTROL: "Control";
3
+ readonly SHIFT: "Shift";
4
+ };
@@ -0,0 +1,3 @@
1
+ export declare const SELECTED_LAYOUT_SESSION_STORAGE_KEY = "interop_home_ui_selected_layout";
2
+ export declare const DEFAULT_LAYOUT_LOCAL_STORAGE_KEY = "interop_home_ui_default_layout";
3
+ export declare const FAVORITE_ENTITIES_LOCAL_STORAGE_KEY = "interop_home_ui_favorite_entities";
@@ -0,0 +1,2 @@
1
+ import { Decoder } from 'decoder-validate';
2
+ export declare const nonEmptyStringDecoder: Decoder<string>;
@@ -0,0 +1,3 @@
1
+ import { Decoder } from 'decoder-validate';
2
+ import { ContextMenuAction } from '../lib/context-menu/context-menu-types';
3
+ export declare const contextMenuActionDecoder: Decoder<ContextMenuAction>;
@@ -0,0 +1,3 @@
1
+ import { Decoder } from 'decoder-validate';
2
+ import { FavoriteEntity } from '../common/types';
3
+ export declare const favoriteEntitiesStorageValueDecoder: Decoder<FavoriteEntity[]>;
@@ -0,0 +1,3 @@
1
+ import { Decoder } from 'decoder-validate';
2
+ import { LayoutStorageValue } from '../lib/layout-settings/layout-types';
3
+ export declare const layoutStorageValueDecoder: Decoder<LayoutStorageValue | null>;
@@ -0,0 +1,6 @@
1
+ import { Glue42Web } from '@glue42/web';
2
+ import { Glue42Workspaces } from '@glue42/workspaces-api';
3
+ import { SectionItemType } from '../lib/section/section.types';
4
+ export declare const applicationActionExecutors: {
5
+ [key: string]: (glue: Glue42Web.API, item: SectionItemType, frame?: Glue42Workspaces.Frame) => Promise<void>;
6
+ };
@@ -0,0 +1,5 @@
1
+ import { Glue42Web } from '@glue42/web';
2
+ import { SectionItemType } from '../lib/section/section.types';
3
+ export declare const workspaceActionExecutors: {
4
+ [key: string]: (glue: Glue42Web.API, item: SectionItemType) => Promise<void>;
5
+ };
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ export type ActivationEvent<T extends HTMLElement = HTMLElement> = React.KeyboardEvent<T> | React.MouseEvent<T>;
3
+ /**
4
+ * If a keypress is the equivalent of a mouse click event. This would be pressing ENTER or SPACEBAR.
5
+ */
6
+ export declare const isClickKeypress: (e: React.KeyboardEvent<HTMLElement>) => boolean;
7
+ type handler = (e: ActivationEvent) => void;
8
+ /**
9
+ * Utility function to convert an `onClick` prop into a keyboard-accessible equivalent.
10
+ *
11
+ * To use, take an existing component like this:
12
+ * `<div onClick={doSomething}></div>`
13
+ *
14
+ * and convert it to this:
15
+ * `<div {...onClickA11y(doSomething)}></div>`
16
+ *
17
+ * This will add an onClick prop, and onKeyDown prop, and a tabIndex={0} (so that a keyboard-only user can reach the element)
18
+ *
19
+ * Make sure you also add a `role` and `aria-label` attribute for maximum accessibility!
20
+ */
21
+ export declare const onClickA11y: (clickHandler?: handler, keydownHandler?: handler) => {
22
+ tabIndex?: undefined;
23
+ onClick?: undefined;
24
+ onKeyDown?: undefined;
25
+ } | {
26
+ tabIndex: number;
27
+ onClick: handler;
28
+ onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
29
+ };
30
+ type KeyboardNavigationProps = {
31
+ event: React.KeyboardEvent<HTMLElement>;
32
+ currentIndex: number;
33
+ moveFocus: (newNumber: number) => void;
34
+ min: number;
35
+ max: number;
36
+ onClose?: () => void;
37
+ };
38
+ export declare const keyboardNavigation: ({ event, currentIndex, moveFocus, min, max, onClose }: KeyboardNavigationProps) => void;
39
+ export {};
@@ -0,0 +1 @@
1
+ export declare const formatDate: (timestamp: number) => string;
@@ -0,0 +1 @@
1
+ export declare const getInitials: (name: string) => string;
@@ -0,0 +1,15 @@
1
+ export * from './useApplications';
2
+ export * from './useApplicationsInstances';
3
+ export * from './useFavoriteEntities';
4
+ export * from './useFrame';
5
+ export * from './useInvokeInteropMethod';
6
+ export * from './usePressedKeys';
7
+ export * from './useRestoreWorkspace';
8
+ export * from './useSearch';
9
+ export * from './useStartApplication';
10
+ export * from './useStorage';
11
+ export * from './useWorkspaces';
12
+ export * from './useWorkspacesInstances';
13
+ export * from './useExecuteApplicationAction';
14
+ export * from './useExecuteWorkspaceAction';
15
+ export * from './useUA';
@@ -0,0 +1,2 @@
1
+ import { Glue42Web } from '@glue42/web';
2
+ export declare const useApplications: () => Glue42Web.AppManager.Application[];
@@ -0,0 +1,3 @@
1
+ export declare const useApplicationsInstances: () => {
2
+ [appName: string]: string[];
3
+ };
@@ -0,0 +1,2 @@
1
+ import { SectionItemType } from '../lib/section/section.types';
2
+ export declare const useExecuteApplicationAction: () => (item: SectionItemType, actionName: string) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { SectionItemType } from '../lib/section/section.types';
2
+ export declare const useExecuteWorkspaceAction: () => (item: SectionItemType, actionName: string) => Promise<void>;
@@ -0,0 +1,6 @@
1
+ import type { FavoriteEntity } from '../common/types';
2
+ import type { SectionItemType } from '../lib/section/section.types';
3
+ export declare const useFavoriteEntities: () => {
4
+ favoriteEntities: FavoriteEntity[];
5
+ toggleFavorite: ({ isOpen, ...item }: SectionItemType) => void;
6
+ };
@@ -0,0 +1,2 @@
1
+ import { Glue42Workspaces } from '@glue42/workspaces-api';
2
+ export declare const useFrame: () => Glue42Workspaces.Frame | undefined;
@@ -0,0 +1,2 @@
1
+ import { Glue42Search } from '@glue42/search-api';
2
+ export declare const useInvokeInteropMethod: () => (action: Glue42Search.MainAction) => Promise<any>;
@@ -0,0 +1 @@
1
+ export declare const usePressedKeys: () => string | null;
@@ -0,0 +1,2 @@
1
+ import { Glue42Workspaces } from '@glue42/workspaces-api';
2
+ export declare const useRestoreWorkspace: () => (id: string, modifier: string | null) => Promise<Glue42Workspaces.Workspace | undefined>;
@@ -0,0 +1,5 @@
1
+ import { Glue42Search } from '@glue42/search-api';
2
+ export declare const useSearch: (searchTerm: string) => {
3
+ resultsToRender: Glue42Search.QueryResult[];
4
+ isLoading: boolean;
5
+ };
@@ -0,0 +1 @@
1
+ export declare const useStartApplication: () => (id: string, modifier: string | null) => Promise<import("@glue42/web").Glue42Web.AppManager.Instance | import("@glue42/workspaces-api").Glue42Workspaces.WorkspaceWindow>;
@@ -0,0 +1,4 @@
1
+ import { Decoder } from 'decoder-validate';
2
+ type StorageType = 'localStorage' | 'sessionStorage';
3
+ export declare const useStorage: <T>(type: StorageType, key: string, decoder: Decoder<T | null>) => readonly [T | null, (value: T | ((val: T | null) => T) | null) => void];
4
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const useUA: () => Omit<import("ua-parser-js").IResult, "ua">;
2
+ export declare const useBrowser: () => import("ua-parser-js").IBrowser;
@@ -0,0 +1,2 @@
1
+ import type { Workspace } from '../lib/workspaces-section/workspaces-section.types';
2
+ export declare const useWorkspaces: () => Workspace[];
@@ -0,0 +1,3 @@
1
+ export declare const useWorkspacesInstances: () => {
2
+ [wsName: string]: string[];
3
+ };
Binary file
Binary file
Binary file