@interopio/home-ui-react 1.4.3 → 2.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.
- package/LICENSE +21 -0
- package/{README.md → dist/README.md} +56 -56
- package/dist/common/sequelizer.d.ts +7 -0
- package/dist/common/types.d.ts +27 -0
- package/dist/common/utils.d.ts +2 -0
- package/dist/constants/alerts.d.ts +8 -0
- package/{constants → dist/constants}/defaults.d.ts +0 -1
- package/dist/constants/dialogs.d.ts +5 -0
- package/{constants → dist/constants}/itemTypes.d.ts +1 -0
- package/dist/constants/platformPrefs.d.ts +15 -0
- package/dist/constants/regex.d.ts +1 -0
- package/dist/constants/sections.d.ts +5 -0
- package/{constants → dist/constants}/storageKeys.d.ts +1 -2
- package/{decoders → dist/decoders}/base.d.ts +2 -1
- package/dist/decoders/config.d.ts +3 -0
- package/dist/decoders/layouts.d.ts +3 -0
- package/{decoders → dist/decoders}/platform.d.ts +3 -3
- package/dist/decoders/user.d.ts +3 -0
- package/dist/decoders/validation.d.ts +3 -0
- package/{executors → dist/executors}/applicationActions.d.ts +1 -1
- package/{executors → dist/executors}/layoutActions.d.ts +1 -1
- package/dist/executors/setupStepsActions.d.ts +3 -0
- package/dist/executors/types.d.ts +33 -0
- package/{executors → dist/executors}/workspaceActions.d.ts +1 -1
- package/{helpers → dist/helpers}/a11y.d.ts +0 -16
- package/dist/helpers/alerts.d.ts +9 -0
- package/{helpers → dist/helpers}/sort.d.ts +4 -4
- package/dist/hooks/index.d.ts +28 -0
- package/dist/hooks/useApplications.d.ts +2 -0
- package/{hooks → dist/hooks}/useExecuteApplicationAction.d.ts +1 -1
- package/dist/hooks/useExecuteLayoutAction.d.ts +5 -0
- package/{hooks → dist/hooks}/useExecuteWorkspaceAction.d.ts +1 -1
- package/dist/hooks/useFavorites.d.ts +8 -0
- package/dist/hooks/useFrameId.d.ts +1 -0
- package/{hooks → dist/hooks}/useInvokeInteropMethod.d.ts +1 -1
- package/dist/hooks/useIsLaunchpadPinned.d.ts +8 -0
- package/dist/hooks/useLayouts.d.ts +5 -0
- package/{hooks → dist/hooks}/useNotifications.d.ts +1 -1
- package/dist/hooks/useNotificationsConfiguration.d.ts +3 -0
- package/dist/hooks/useOnIframeFocus.d.ts +6 -0
- package/dist/hooks/useOnOutsideClick.d.ts +9 -0
- package/{hooks → dist/hooks}/usePlatformWindow.d.ts +1 -1
- package/{hooks → dist/hooks}/useRestoreLayout.d.ts +1 -1
- package/{hooks → dist/hooks}/useRestoreWorkspace.d.ts +1 -2
- package/{hooks → dist/hooks}/useSearch.d.ts +1 -1
- package/dist/hooks/useStartApplication.d.ts +7 -0
- package/{hooks → dist/hooks}/useStorage.d.ts +2 -2
- package/dist/hooks/useWorkspaces.d.ts +2 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +14513 -0
- package/dist/index.mjs.map +1 -0
- package/{lib → dist/lib}/applications-section/applications-section.d.ts +1 -1
- package/dist/lib/applications-section/helpers.d.ts +5 -0
- package/dist/lib/applications-section/types.d.ts +9 -0
- package/{lib → dist/lib}/base-section/base-section-header.d.ts +2 -4
- package/dist/lib/base-section/base-section-item.d.ts +14 -0
- package/{lib → dist/lib}/base-section/base-section.d.ts +3 -3
- package/{lib → dist/lib}/base-section/helpers.d.ts +1 -1
- package/dist/lib/base-section/types.d.ts +20 -0
- package/dist/lib/base-section/useCollapsedSections.d.ts +4 -0
- package/dist/lib/context-menu/constants.d.ts +11 -0
- package/dist/lib/context-menu/context-menu.d.ts +11 -0
- package/dist/lib/context-menu/dropdown-button/dropdown-button.d.ts +20 -0
- package/{lib → dist/lib}/context-menu/types.d.ts +5 -1
- package/dist/lib/default-header-system-buttons/constants.d.ts +2 -0
- package/dist/lib/default-header-system-buttons/default-header-system-buttons.d.ts +2 -0
- package/dist/lib/default-header-system-buttons/default-header-system-menu.d.ts +2 -0
- package/{lib → dist/lib}/favorites-section/favorites-section.d.ts +1 -1
- package/dist/lib/favorites-section/helpers.d.ts +3 -0
- package/dist/lib/home-app-workspace/after-tabs.d.ts +3 -0
- package/dist/lib/home-app-workspace/constants.d.ts +2 -0
- package/{lib → dist/lib}/home-app-workspace/group-header-buttons.d.ts +1 -1
- package/dist/lib/home-app-workspace/home-app-workspace.d.ts +13 -0
- package/dist/lib/home-app-workspace/index.d.ts +1 -0
- package/dist/lib/home-app-workspace/launchpad-access.d.ts +7 -0
- package/{lib → dist/lib}/home-app-workspace/workspace-components-context.d.ts +3 -4
- package/dist/lib/icon-components/index.d.ts +4 -0
- package/dist/lib/icon-components/platform-setup/index.d.ts +4 -0
- package/{lib → dist/lib}/io-connect-home/auth0-login-home.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home/home-app.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home/io-connect-home.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home/no-login-home.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home/simple-login-home.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home/types.d.ts +54 -18
- package/{lib → dist/lib}/io-connect-home/useUser.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home-provider/helpers.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home-provider/io-connect-home-provider.d.ts +1 -1
- package/{lib → dist/lib}/io-connect-home-provider/types.d.ts +2 -2
- package/{lib/io-connect-browser-start-failed/io-connect-browser-start-failed.d.ts → dist/lib/io-init-error-screen/io-init-error-screen.d.ts} +1 -1
- package/dist/lib/launchpad/constants.d.ts +2 -0
- package/dist/lib/launchpad/helpers.d.ts +4 -0
- package/dist/lib/launchpad/launchpad-header.d.ts +7 -0
- package/dist/lib/launchpad/launchpad-pin-button.d.ts +5 -0
- package/dist/lib/launchpad/launchpad.context.d.ts +19 -0
- package/dist/lib/launchpad/launchpad.d.ts +11 -0
- package/dist/lib/launchpad/useIsLaunchpadCollapsed.d.ts +9 -0
- package/dist/lib/layouts-panel/active-layout.d.ts +2 -0
- package/dist/lib/layouts-panel/all-layouts.d.ts +2 -0
- package/dist/lib/layouts-panel/constants.d.ts +8 -0
- package/dist/lib/layouts-panel/create-layout-button.d.ts +2 -0
- package/dist/lib/layouts-panel/helpers.d.ts +3 -0
- package/dist/lib/layouts-panel/layouts-dropdown.d.ts +6 -0
- package/dist/lib/layouts-panel/layouts-list.d.ts +6 -0
- package/dist/lib/layouts-panel/save-layout-button.d.ts +5 -0
- package/dist/lib/layouts-panel/types.d.ts +8 -0
- package/dist/lib/layouts-panel/useIsLayoutsPanelOpen.d.ts +9 -0
- package/{lib → dist/lib}/login/auth0/auth0-login-page.d.ts +1 -2
- package/dist/lib/login/index.d.ts +3 -0
- package/dist/lib/login/login-heading.d.ts +1 -0
- package/{lib → dist/lib}/login/simple/reducers.d.ts +1 -1
- package/{lib → dist/lib}/login/simple/simple-login-form.d.ts +2 -2
- package/{lib → dist/lib}/login/simple/simple-login-page.d.ts +1 -1
- package/{lib → dist/lib}/login/types.d.ts +1 -5
- package/dist/lib/notifications-icon/notifications-badge.d.ts +2 -0
- package/{lib/notifications-panel → dist/lib/notifications-icon}/notifications-icon.d.ts +1 -1
- package/dist/lib/notifications-panels/notification-settings-panel.d.ts +9 -0
- package/dist/lib/notifications-panels/notifications-panel.d.ts +10 -0
- package/dist/lib/panels/launchpad/launchpad-button.d.ts +6 -0
- package/dist/lib/panels/launchpad/launchpad-panel.d.ts +2 -0
- package/dist/lib/panels/panel-with-toggle-button.d.ts +12 -0
- package/dist/lib/panels/panel-wrapper.d.ts +11 -0
- package/dist/lib/panels/types.d.ts +9 -0
- package/{lib → dist/lib}/platform-setup/constants.d.ts +1 -1
- package/{lib → dist/lib}/platform-setup/reducers.d.ts +2 -2
- package/{lib → dist/lib}/platform-setup/setup-steps-list.d.ts +1 -1
- package/{lib → dist/lib}/platform-setup/types.d.ts +4 -4
- package/dist/lib/profile-panel/profile-panel.d.ts +9 -0
- package/{lib → dist/lib}/search/search-bar/search-bar.d.ts +1 -0
- package/dist/lib/search/search-results-section/search-results-section.d.ts +5 -0
- package/{lib → dist/lib}/search/search-results-section/types.d.ts +3 -3
- package/dist/lib/search/search-results-section/useExecuteLayoutSearchResultAction.d.ts +2 -0
- package/dist/lib/search/search-results-section/useGenerateLayoutFromId.d.ts +2 -0
- package/dist/lib/search/search-results-section/useGetActionExecutor.d.ts +1 -0
- package/dist/lib/search/search-results-section/useSearchResultsSectionConfigs.d.ts +3 -0
- package/{lib → dist/lib}/section/helpers.d.ts +2 -2
- package/{lib → dist/lib}/section/section.d.ts +1 -1
- package/{lib → dist/lib}/section/types.d.ts +1 -1
- package/dist/lib/spinner/index.d.ts +1 -0
- package/dist/lib/system-menu/helpers.d.ts +3 -0
- package/dist/lib/system-menu/system-menu.d.ts +6 -0
- package/dist/lib/system-menu/types.d.ts +9 -0
- package/dist/lib/workspaces-section/constants.d.ts +3 -0
- package/{lib → dist/lib}/workspaces-section/helpers.d.ts +3 -3
- package/{lib → dist/lib}/workspaces-section/workspaces-section.d.ts +1 -1
- package/package.json +59 -41
- package/assets/fonts/nunito-regular-webfont.woff +0 -0
- package/assets/fonts/nunito-regular-webfont.woff2 +0 -0
- package/assets/fonts/nunito-semibold-webfont.woff +0 -0
- package/assets/fonts/nunito-semibold-webfont.woff2 +0 -0
- package/assets/io-connect-browser-logo.json +0 -5
- package/common/types.d.ts +0 -10
- package/decoders/config.d.ts +0 -3
- package/decoders/context-menu.d.ts +0 -3
- package/decoders/favorites.d.ts +0 -3
- package/decoders/layouts.d.ts +0 -3
- package/decoders/user.d.ts +0 -3
- package/decoders/validation.d.ts +0 -3
- package/executors/notificationsSort.d.ts +0 -7
- package/executors/setupStepsActions.d.ts +0 -3
- package/executors/types.d.ts +0 -26
- package/helpers/date.d.ts +0 -1
- package/helpers/string.d.ts +0 -1
- package/hooks/index.d.ts +0 -25
- package/hooks/useApplications.d.ts +0 -2
- package/hooks/useExecuteLayoutAction.d.ts +0 -2
- package/hooks/useFavoriteEntities.d.ts +0 -7
- package/hooks/useFrame.d.ts +0 -2
- package/hooks/useIsBrowserSupported.d.ts +0 -1
- package/hooks/useLayouts.d.ts +0 -2
- package/hooks/useNotificationsSort.d.ts +0 -5
- package/hooks/useStartApplication.d.ts +0 -4
- package/hooks/useWorkspaces.d.ts +0 -2
- package/index.css +0 -1
- package/index.d.ts +0 -37
- package/index.js +0 -54
- package/index.js.map +0 -1
- package/index.mjs +0 -8651
- package/index.mjs.map +0 -1
- package/lib/applications-section/helpers.d.ts +0 -6
- package/lib/applications-section/types.d.ts +0 -4
- package/lib/base-section/base-section-item.d.ts +0 -13
- package/lib/base-section/types.d.ts +0 -29
- package/lib/browser-not-supported/additional-information.d.ts +0 -5
- package/lib/browser-not-supported/browser-not-supported.d.ts +0 -11
- package/lib/browser-not-supported/constants.d.ts +0 -6
- package/lib/button/button.d.ts +0 -7
- package/lib/button-group/button-group.d.ts +0 -8
- package/lib/context-menu/constants.d.ts +0 -3
- package/lib/context-menu/context-menu.d.ts +0 -10
- package/lib/context-menu/dropdown-button/dropdown-button.d.ts +0 -11
- package/lib/dialog/dialog.d.ts +0 -8
- package/lib/favorites-section/helpers.d.ts +0 -3
- package/lib/home-app-workspace/after-tabs.d.ts +0 -3
- package/lib/home-app-workspace/home-app-workspace.d.ts +0 -14
- package/lib/home-app-workspace/index.d.ts +0 -2
- package/lib/home-app-workspace/launchpad-access.d.ts +0 -6
- package/lib/home-app-workspace/workspace-logo.d.ts +0 -10
- package/lib/icon/icon.d.ts +0 -9
- package/lib/icon-components/google-chrome-icon.d.ts +0 -2
- package/lib/icon-components/index.d.ts +0 -7
- package/lib/icon-components/microsoft-edge-icon.d.ts +0 -2
- package/lib/icon-components/opera-icon.d.ts +0 -2
- package/lib/icon-components/platform-setup/index.d.ts +0 -4
- package/lib/img-icon/img-icon.d.ts +0 -8
- package/lib/launchpad/default-sections.d.ts +0 -2
- package/lib/launchpad/helpers.d.ts +0 -3
- package/lib/launchpad/launchpad.context.d.ts +0 -19
- package/lib/launchpad/launchpad.d.ts +0 -12
- package/lib/launchpad/types.d.ts +0 -16
- package/lib/layouts-panel/available-layouts.d.ts +0 -6
- package/lib/layouts-panel/constants.d.ts +0 -6
- package/lib/layouts-panel/helpers.d.ts +0 -4
- package/lib/layouts-panel/layout-actions.d.ts +0 -9
- package/lib/layouts-panel/layouts-notification.d.ts +0 -6
- package/lib/layouts-panel/types.d.ts +0 -20
- package/lib/login/index.d.ts +0 -4
- package/lib/login/login-heading.d.ts +0 -5
- package/lib/login/login-loader.d.ts +0 -5
- package/lib/logo/logo.d.ts +0 -2
- package/lib/notifications-panel/constants.d.ts +0 -9
- package/lib/notifications-panel/index.d.ts +0 -4
- package/lib/notifications-panel/notification.d.ts +0 -6
- package/lib/notifications-panel/notifications-badge.d.ts +0 -5
- package/lib/notifications-panel/notifications-panel.d.ts +0 -2
- package/lib/notifications-panel/types.d.ts +0 -7
- package/lib/panels/launchpad-slide-panel.d.ts +0 -10
- package/lib/panels/slide-panel.d.ts +0 -9
- package/lib/search/search-results-section/helpers.d.ts +0 -3
- package/lib/search/search-results-section/search-results-section.d.ts +0 -5
- package/lib/spinner/index.d.ts +0 -1
- package/lib/user-panel/settings-card.d.ts +0 -2
- package/lib/user-panel/support-card.d.ts +0 -11
- package/lib/user-panel/user-details-card.d.ts +0 -6
- package/lib/user-panel/user-panel-icon.d.ts +0 -6
- package/lib/user-panel/user-panel.d.ts +0 -7
- /package/{constants → dist/constants}/auth0LoginTypes.d.ts +0 -0
- /package/{constants → dist/constants}/modifierKeys.d.ts +0 -0
- /package/{constants → dist/constants}/sortOrder.d.ts +0 -0
- /package/{hooks → dist/hooks}/useApplicationsInstances.d.ts +0 -0
- /package/{hooks → dist/hooks}/useBeforeunload.d.ts +0 -0
- /package/{hooks → dist/hooks}/useExecuteLayoutOperationIfNotBlocked.d.ts +0 -0
- /package/{hooks → dist/hooks}/useIsHomeLoaded.d.ts +0 -0
- /package/{hooks → dist/hooks}/useIsRunningInDesktopContainer.d.ts +0 -0
- /package/{hooks → dist/hooks}/usePressedKeys.d.ts +0 -0
- /package/{hooks → dist/hooks}/useUA.d.ts +0 -0
- /package/{hooks → dist/hooks}/useWorkspacesInstances.d.ts +0 -0
- /package/{lib → dist/lib}/home-app-workspace/no-logo.d.ts +0 -0
- /package/{lib → dist/lib}/home-app-workspace/types.d.ts +0 -0
- /package/{lib → dist/lib}/home-app-workspace/useAddWindowButtonVisible.d.ts +0 -0
- /package/{lib → dist/lib}/icon-components/platform-setup/browser-notifications-icon.d.ts +0 -0
- /package/{lib → dist/lib}/icon-components/platform-setup/popups-icon.d.ts +0 -0
- /package/{lib → dist/lib}/icon-components/platform-setup/pwa-install-icon.d.ts +0 -0
- /package/{lib → dist/lib}/icon-components/platform-setup/window-management-icon.d.ts +0 -0
- /package/{lib → dist/lib}/icon-components/reopen-prompt-icon.d.ts +0 -0
- /package/{lib → dist/lib}/icon-components/start-failed-icon.d.ts +0 -0
- /package/{lib → dist/lib}/icon-components/warning-icon.d.ts +0 -0
- /package/{lib → dist/lib}/info-card/info-card.d.ts +0 -0
- /package/{lib → dist/lib}/info-page-container/info-page-container.d.ts +0 -0
- /package/{lib → dist/lib}/io-connect-home-provider/constants.d.ts +0 -0
- /package/{lib → dist/lib}/layouts-panel/layouts-panel.d.ts +0 -0
- /package/{lib → dist/lib}/login/constants.d.ts +0 -0
- /package/{lib → dist/lib}/login/login-logo.d.ts +0 -0
- /package/{lib → dist/lib}/login/login-page-container.d.ts +0 -0
- /package/{lib → dist/lib}/platform-setup/platform-setup.d.ts +0 -0
- /package/{lib → dist/lib}/platform-setup/setup-steps.d.ts +0 -0
- /package/{lib → dist/lib}/platform-setup/use-edge-notifications-permission.d.ts +0 -0
- /package/{lib → dist/lib}/section/section.context.d.ts +0 -0
- /package/{lib → dist/lib}/spinner/spinner.d.ts +0 -0
- /package/{lib → dist/lib}/system-loader/system-loader.d.ts +0 -0
- /package/{lib → dist/lib}/workspaces-section/types.d.ts +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Tick42
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
# @interopio/home-ui-react
|
|
2
|
-
|
|
3
|
-
The `@interopio/home-ui-react` library offers React components and hooks for building a [Home App](https://docs.interop.io/browser/capabilities/home-app/overview/index.html) for **io.Connect Browser** projects.
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
To install the `@interopio/home-ui-react` library in your project, execute the following command:
|
|
10
|
-
|
|
11
|
-
```cmd
|
|
12
|
-
npm install @interopio/home-ui-react
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
The following example demonstrates initializing the `@interopio/home-ui-react` library with basic configuration:
|
|
18
|
-
|
|
19
|
-
```javascript
|
|
20
|
-
import { IOConnectHome } from "@interopio/home-ui-react";
|
|
21
|
-
import "@interopio/workspaces-ui-react/dist/styles/workspaces.css";
|
|
22
|
-
import "@interopio/home-ui-react/src/index.css";
|
|
23
|
-
|
|
24
|
-
const getConfig = () => {
|
|
25
|
-
// Platform configuration.
|
|
26
|
-
const platformConfig = {
|
|
27
|
-
browserPlatform: {
|
|
28
|
-
factory: IOBrowserPlatform,
|
|
29
|
-
config: {
|
|
30
|
-
// Required license key.
|
|
31
|
-
licenseKey: "my-license-key",
|
|
32
|
-
// Workspaces App configuration.
|
|
33
|
-
workspaces: {
|
|
34
|
-
src: "/",
|
|
35
|
-
isFrame: true
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return platformConfig;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// Configuration for the `<IOConnectHome />` component.
|
|
45
|
-
const config = {
|
|
46
|
-
// Retrieve the platform configuration.
|
|
47
|
-
getIOConnectConfig: getConfig
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export function App() {
|
|
51
|
-
return <IOConnectHome config={config} />
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default App;
|
|
55
|
-
```
|
|
56
|
-
|
|
1
|
+
# @interopio/home-ui-react
|
|
2
|
+
|
|
3
|
+
The `@interopio/home-ui-react` library offers React components and hooks for building a [Home App](https://docs.interop.io/browser/capabilities/home-app/overview/index.html) for **io.Connect Browser** projects.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
To install the `@interopio/home-ui-react` library in your project, execute the following command:
|
|
10
|
+
|
|
11
|
+
```cmd
|
|
12
|
+
npm install @interopio/home-ui-react
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
The following example demonstrates initializing the `@interopio/home-ui-react` library with basic configuration:
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
import { IOConnectHome } from "@interopio/home-ui-react";
|
|
21
|
+
import "@interopio/workspaces-ui-react/dist/styles/workspaces.css";
|
|
22
|
+
import "@interopio/home-ui-react/src/index.css";
|
|
23
|
+
|
|
24
|
+
const getConfig = () => {
|
|
25
|
+
// Platform configuration.
|
|
26
|
+
const platformConfig = {
|
|
27
|
+
browserPlatform: {
|
|
28
|
+
factory: IOBrowserPlatform,
|
|
29
|
+
config: {
|
|
30
|
+
// Required license key.
|
|
31
|
+
licenseKey: "my-license-key",
|
|
32
|
+
// Workspaces App configuration.
|
|
33
|
+
workspaces: {
|
|
34
|
+
src: "/",
|
|
35
|
+
isFrame: true
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return platformConfig;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Configuration for the `<IOConnectHome />` component.
|
|
45
|
+
const config = {
|
|
46
|
+
// Retrieve the platform configuration.
|
|
47
|
+
getIOConnectConfig: getConfig
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export function App() {
|
|
51
|
+
return <IOConnectHome config={config} />
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default App;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
57
|
For more details on using the library, see the [official documentation](https://docs.interop.io/browser/capabilities/home-app/library-features/index.html) of **io.Connect Browser**.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HOME_ALERT_VARIANTS } from "../constants/alerts";
|
|
2
|
+
import { PLATFORM_PREFS_KEYS } from "../constants/platformPrefs";
|
|
3
|
+
import { SORT_ORDER } from "../constants/sortOrder";
|
|
4
|
+
import { LayoutSummary } from "../lib/layouts-panel/types";
|
|
5
|
+
import { SectionItemType } from "../lib/section/types";
|
|
6
|
+
export type Favorite = Omit<SectionItemType, "openInstances">;
|
|
7
|
+
export type SortOrder = (typeof SORT_ORDER)[keyof typeof SORT_ORDER];
|
|
8
|
+
export type SortCompareFunction<Type> = (a: Type, b: Type) => number;
|
|
9
|
+
export type DefaultSectionProps = {
|
|
10
|
+
isSectionCollapsible?: boolean;
|
|
11
|
+
sortOrder?: SortOrder;
|
|
12
|
+
};
|
|
13
|
+
export type PlatformPrefs = {
|
|
14
|
+
[PLATFORM_PREFS_KEYS.COLLAPSED_SECTIONS]?: string[];
|
|
15
|
+
[PLATFORM_PREFS_KEYS.CUSTOM_PREFS]?: any;
|
|
16
|
+
[PLATFORM_PREFS_KEYS.IS_LAUNCHPAD_COLLAPSED]?: boolean;
|
|
17
|
+
[PLATFORM_PREFS_KEYS.IS_LAUNCHPAD_PINNED]?: boolean;
|
|
18
|
+
[PLATFORM_PREFS_KEYS.IS_LAYOUTS_PANEL_OPEN]?: boolean;
|
|
19
|
+
[PLATFORM_PREFS_KEYS.FAVORITES]?: Favorite[];
|
|
20
|
+
[PLATFORM_PREFS_KEYS.LAYOUTS_SHOW_DELETE_PROMPT]?: boolean;
|
|
21
|
+
[PLATFORM_PREFS_KEYS.LAYOUTS_SHOW_UNSAVED_CHANGES_PROMPT]?: boolean;
|
|
22
|
+
[PLATFORM_PREFS_KEYS.WIDGET_ENABLE_FOR_EXTERNAL_APPS]?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type SetDefaultLayout = (layout: LayoutSummary) => Promise<void>;
|
|
25
|
+
export type SetActiveLayout = (layout: LayoutSummary | null) => void;
|
|
26
|
+
export type CloseLaunchpad = () => void;
|
|
27
|
+
export type HomeAlertVariant = (typeof HOME_ALERT_VARIANTS)[keyof typeof HOME_ALERT_VARIANTS];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PlatformPrefs } from "../common/types";
|
|
2
|
+
export declare const PLATFORM_PREFS_APP_NAME = "io-connect-platform";
|
|
3
|
+
export declare const PLATFORM_PREFS_CONTEXT_KEY = "___platform_prefs___";
|
|
4
|
+
export declare const PLATFORM_PREFS_KEYS: {
|
|
5
|
+
readonly CUSTOM_PREFS: "customPrefs";
|
|
6
|
+
readonly COLLAPSED_SECTIONS: "_launchpad_collapsedSections";
|
|
7
|
+
readonly FAVORITES: "_launchpad_favorites";
|
|
8
|
+
readonly IS_LAYOUTS_PANEL_OPEN: "_launchpad_isLayoutsPanelOpen";
|
|
9
|
+
readonly IS_LAUNCHPAD_COLLAPSED: "_launchpad_isCollapsed";
|
|
10
|
+
readonly IS_LAUNCHPAD_PINNED: "_launchpad_isPinned";
|
|
11
|
+
readonly LAYOUTS_SHOW_UNSAVED_CHANGES_PROMPT: "_layouts_showUnsavedChangesPrompt";
|
|
12
|
+
readonly LAYOUTS_SHOW_DELETE_PROMPT: "_layouts_showDeletePrompt";
|
|
13
|
+
readonly WIDGET_ENABLE_FOR_EXTERNAL_APPS: "_widget_enableForExternalApps";
|
|
14
|
+
};
|
|
15
|
+
export declare const DEFAULT_PLATFORM_PREFS: PlatformPrefs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NON_EMPTY_STRING_REGEX_PATTERN = "(.|\\s)*\\S(.|\\s)*";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export declare const SELECTED_LAYOUT_SESSION_STORAGE_KEY = "interopio_home_ui_selected_layout";
|
|
2
1
|
export declare const AUTH0_VALIDATION_ERROR_SESSION_STORAGE_KEY = "interopio_home_ui_auth0_validation_error";
|
|
3
|
-
export declare const FAVORITE_ENTITIES_LOCAL_STORAGE_KEY = "interopio_home_ui_favorite_entities";
|
|
4
2
|
export declare const USER_LOCAL_STORAGE_KEY = "interopio_home_ui_user";
|
|
5
3
|
export declare const PLATFORM_WINDOW_SESSION_STORAGE_KEY = "interopio_home_ui_platform_window";
|
|
6
4
|
export declare const PLATFORM_SETUP_LOCAL_STORAGE_KEY = "interopio_home_ui_platform_setup";
|
|
5
|
+
export declare const ACTIVE_LAYOUT_SESSION_STORAGE_KEY = "interopio_home_ui_active_layout";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Decoder } from
|
|
1
|
+
import { Decoder } from "decoder-validate";
|
|
2
2
|
export declare const nonEmptyStringDecoder: Decoder<string>;
|
|
3
3
|
export declare const nonNegativeNumberDecoder: Decoder<number>;
|
|
4
|
+
export declare const booleanDecoder: Decoder<boolean>;
|
|
4
5
|
export declare const functionCheck: (input: any, propDescription: string) => Decoder<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Decoder } from
|
|
2
|
-
import { PlatformWindow } from
|
|
3
|
-
import { PlatformSetupStatus } from
|
|
1
|
+
import { Decoder } from "decoder-validate";
|
|
2
|
+
import { PlatformWindow } from "../lib/home-app-workspace/types";
|
|
3
|
+
import { PlatformSetupStatus } from "../lib/platform-setup/types";
|
|
4
4
|
export declare const platformWindowStorageValueDecoder: Decoder<PlatformWindow | null>;
|
|
5
5
|
export declare const platformSetupStorageValueDecoder: Decoder<PlatformSetupStatus | null>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SetStateAction } from "react";
|
|
2
|
+
import { IOConnectBrowser } from "@interopio/browser";
|
|
3
|
+
import { IOConnectDesktop } from "@interopio/desktop";
|
|
4
|
+
import { Layout } from "../lib/layouts-panel/types";
|
|
5
|
+
import { SectionItemType } from "../lib/section/types";
|
|
6
|
+
import { SetupStepReducerAction } from "../lib/platform-setup/types";
|
|
7
|
+
import { SetDefaultLayout, SetActiveLayout, CloseLaunchpad } from "../common/types";
|
|
8
|
+
type UpdateShowDeletePromptPref = (value: SetStateAction<boolean | undefined>) => Promise<void>;
|
|
9
|
+
export type LayoutActionExecutor = (config: {
|
|
10
|
+
io: IOConnectBrowser.API | IOConnectDesktop.API;
|
|
11
|
+
layout: Layout;
|
|
12
|
+
setActiveLayout: SetActiveLayout;
|
|
13
|
+
setDefaultLayout: SetDefaultLayout;
|
|
14
|
+
closeLaunchpad: CloseLaunchpad;
|
|
15
|
+
showDeletePromptPref: boolean | undefined;
|
|
16
|
+
updateShowDeletePromptPref: UpdateShowDeletePromptPref;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
export type ApplicationActionExecutor = (config: {
|
|
19
|
+
io: IOConnectBrowser.API | IOConnectDesktop.API;
|
|
20
|
+
item: SectionItemType;
|
|
21
|
+
frameId?: string;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
export type WorkspaceActionExecutor = (config: {
|
|
24
|
+
io: IOConnectBrowser.API | IOConnectDesktop.API;
|
|
25
|
+
item: SectionItemType;
|
|
26
|
+
removeFavorite: (item: SectionItemType) => Promise<void>;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
export type SetupStepActionExecutor = (config: {
|
|
29
|
+
handleDeferredStep: () => void;
|
|
30
|
+
handleOperationComplete: () => void;
|
|
31
|
+
dispatchAction: (action: SetupStepReducerAction) => void;
|
|
32
|
+
}) => void;
|
|
33
|
+
export {};
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
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
3
|
export declare const isClickKeypress: (event: React.KeyboardEvent<HTMLElement>) => boolean;
|
|
7
4
|
type handler = (event: 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
5
|
export declare const onClickA11y: (clickHandler?: handler, keydownHandler?: handler) => {
|
|
22
6
|
tabIndex?: undefined;
|
|
23
7
|
onClick?: undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IOConnectBrowser } from "@interopio/browser";
|
|
2
|
+
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
|
+
import { HomeAlertVariant } from "../common/types";
|
|
4
|
+
export declare const requestAlert: (config: {
|
|
5
|
+
io: IOConnectBrowser.API | IOConnectDesktop.API;
|
|
6
|
+
variant: HomeAlertVariant;
|
|
7
|
+
text: string;
|
|
8
|
+
error?: any;
|
|
9
|
+
}) => Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Workspace } from
|
|
1
|
+
import { Favorite, SortCompareFunction, SortOrder } from "../common/types";
|
|
2
|
+
import { Workspace } from "../lib/workspaces-section/types";
|
|
3
3
|
export declare const collator: Intl.Collator;
|
|
4
|
-
export declare const ascendingTitleCompare: SortCompareFunction<
|
|
5
|
-
export declare const descendingTitleCompare: SortCompareFunction<
|
|
4
|
+
export declare const ascendingTitleCompare: SortCompareFunction<Favorite | Workspace>;
|
|
5
|
+
export declare const descendingTitleCompare: SortCompareFunction<Favorite | Workspace>;
|
|
6
6
|
export declare const sortItems: <Type>(config: {
|
|
7
7
|
items: Type[];
|
|
8
8
|
sortOrder: SortOrder;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from "./useApplications";
|
|
2
|
+
export * from "./useApplicationsInstances";
|
|
3
|
+
export * from "./useBeforeunload";
|
|
4
|
+
export * from "./useExecuteApplicationAction";
|
|
5
|
+
export * from "./useExecuteLayoutAction";
|
|
6
|
+
export * from "./useExecuteLayoutOperationIfNotBlocked";
|
|
7
|
+
export * from "./useExecuteWorkspaceAction";
|
|
8
|
+
export * from "./useFavorites";
|
|
9
|
+
export * from "./useFrameId";
|
|
10
|
+
export * from "./useInvokeInteropMethod";
|
|
11
|
+
export * from "./useIsHomeLoaded";
|
|
12
|
+
export * from "./useIsLaunchpadPinned";
|
|
13
|
+
export * from "./useIsRunningInDesktopContainer";
|
|
14
|
+
export * from "./useLayouts";
|
|
15
|
+
export * from "./useNotifications";
|
|
16
|
+
export * from "./useNotificationsConfiguration";
|
|
17
|
+
export * from "./useOnIframeFocus";
|
|
18
|
+
export * from "./useOnOutsideClick";
|
|
19
|
+
export * from "./usePlatformWindow";
|
|
20
|
+
export * from "./usePressedKeys";
|
|
21
|
+
export * from "./useRestoreLayout";
|
|
22
|
+
export * from "./useRestoreWorkspace";
|
|
23
|
+
export * from "./useSearch";
|
|
24
|
+
export * from "./useStartApplication";
|
|
25
|
+
export * from "./useStorage";
|
|
26
|
+
export * from "./useUA";
|
|
27
|
+
export * from "./useWorkspaces";
|
|
28
|
+
export * from "./useWorkspacesInstances";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SectionItemType } from
|
|
1
|
+
import { SectionItemType } from "../lib/section/types";
|
|
2
2
|
export declare const useExecuteApplicationAction: () => (item: SectionItemType, actionName: string) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SectionItemType } from
|
|
1
|
+
import { SectionItemType } from "../lib/section/types";
|
|
2
2
|
export declare const useExecuteWorkspaceAction: () => (item: SectionItemType, actionName: string) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Favorite } from "../common/types";
|
|
2
|
+
import { SectionItemType } from "../lib/section/types";
|
|
3
|
+
export declare const useFavorites: () => {
|
|
4
|
+
favorites: Favorite[];
|
|
5
|
+
toggleFavorite: (item: SectionItemType) => Promise<void>;
|
|
6
|
+
removeFavorite: (item: SectionItemType) => Promise<void>;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useFrameId: () => string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IOConnectSearch } from
|
|
1
|
+
import { IOConnectSearch } from "@interopio/search-api";
|
|
2
2
|
export declare const useInvokeInteropMethod: () => (action: IOConnectSearch.MainAction) => Promise<any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IOConnectBrowser } from
|
|
1
|
+
import { IOConnectBrowser } from "@interopio/browser";
|
|
2
2
|
export declare const useNotifications: () => IOConnectBrowser.Notifications.NotificationData[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
interface Config {
|
|
3
|
+
eventType: "click" | "mousedown" | "mouseup" | "touchstart" | "touchend";
|
|
4
|
+
handler: (event: MouseEvent | TouchEvent) => void;
|
|
5
|
+
ref: RefObject<HTMLElement> | RefObject<HTMLElement>[];
|
|
6
|
+
skip?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const useOnOutsideClick: (config: Config) => void;
|
|
9
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlatformWindow } from
|
|
1
|
+
import { PlatformWindow } from "../lib/home-app-workspace/types";
|
|
2
2
|
export declare const usePlatformWindow: () => {
|
|
3
3
|
isPlatformWindow: boolean;
|
|
4
4
|
setPlatformWindow: (value: PlatformWindow | null) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LayoutSummary } from
|
|
1
|
+
import { LayoutSummary } from "../lib/layouts-panel/types";
|
|
2
2
|
export declare const useRestoreLayout: () => (name: string, onSuccessfulLayoutRestore?: ((layout: LayoutSummary) => void) | undefined) => Promise<void>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IOConnectWorkspaces } from '@interopio/workspaces-api';
|
|
2
1
|
export declare const useRestoreWorkspace: () => ({ id, modifier, reuseWorkspaceId }: {
|
|
3
2
|
id: string;
|
|
4
3
|
modifier?: string | null | undefined;
|
|
5
4
|
reuseWorkspaceId?: string | undefined;
|
|
6
|
-
}) => Promise<
|
|
5
|
+
}) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Decoder } from
|
|
2
|
-
type StorageType =
|
|
1
|
+
import { Decoder } from "decoder-validate";
|
|
2
|
+
type StorageType = "localStorage" | "sessionStorage";
|
|
3
3
|
export declare const useStorage: <T>(type: StorageType, key: string, decoder: Decoder<T | null>) => readonly [T | null, (value: T | null) => void];
|
|
4
4
|
export {};
|