@openfin/workspace 1.7.0 → 3.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/README.md +72 -2
- package/index.d.ts +3 -3
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/shapes.d.ts +61 -60
- package/storefront.d.ts +14 -0
- package/content-store.d.ts +0 -14
package/README.md
CHANGED
|
@@ -1,7 +1,77 @@
|
|
|
1
1
|
# Client API
|
|
2
2
|
|
|
3
|
-
The Client API is a framework allowing custom integrations on top of workspace.
|
|
3
|
+
The Client API is a framework allowing custom integrations on top of workspace. Could be used in **any** and **only** OpenFin app.
|
|
4
4
|
|
|
5
5
|
## Getting started
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Run `npm i -E @openfin/workspace`. See the APIs and examples below.
|
|
8
|
+
|
|
9
|
+
## Store API
|
|
10
|
+
|
|
11
|
+
API Reference: https://cdn.openfin.co/workspace/api/docs/interfaces/StorefrontAPI.html
|
|
12
|
+
|
|
13
|
+
### `register(provider: StorefrontProvider): Promise<void>`
|
|
14
|
+
|
|
15
|
+
Registers a Storefront provider. Upon registering a provider, the title of your provider will appear in the drop down of the Storefront UI. When a user selects your Storefront, the methods on the provider object will be called to populate the UI. Throws an error if provider with `provider.id` already exists. See [reference](https://cdn.openfin.co/workspace/api/docs/interfaces/StorefrontProvider.html) for definition of `StorefrontProvider` interface.
|
|
16
|
+
|
|
17
|
+
### `show(): Promise<void>`
|
|
18
|
+
|
|
19
|
+
Shows store window. Awaits for latest `Storefront.register()` internally so you don't have to. If store provider doesn't exist (`register` was not called before) then an error is thrown.
|
|
20
|
+
|
|
21
|
+
### `hide(): Promise<void>`
|
|
22
|
+
|
|
23
|
+
Hides store window. Awaits for latest `Storefront.register()` internally so you don't have to. If store provider doesn't exist (`register` was not called before) then an error is thrown.
|
|
24
|
+
|
|
25
|
+
### Vanilla JS Example
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { Storefront, launchApp } from '@openfin/workspace';
|
|
29
|
+
import { fetchMyApps, fetchMyLandingPage, fetchMyNavigation, fetchMyFooter } from './my-storefront-provider';
|
|
30
|
+
|
|
31
|
+
Storefront.register({
|
|
32
|
+
id: 'my-storefront',
|
|
33
|
+
title: 'My Storefront',
|
|
34
|
+
getApps: fetchMyApps,
|
|
35
|
+
getLandingPage: fetchMyLandingPage,
|
|
36
|
+
getNavigation: fetchMyNavigation,
|
|
37
|
+
getFooter: fetchMyFooter,
|
|
38
|
+
launchApp: launchApp // OpenFins default implementation of launchApp, you can also define your own
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
document.getElementById('show-btn').addEventListener('click', () => {
|
|
42
|
+
Storefront.show();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
document.getElementById('hide-btn').addEventListener('click', () => {
|
|
46
|
+
Storefront.hide();
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### React Example
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { Storefront, launchApp } from '@openfin/workspace';
|
|
54
|
+
import { fetchMyApps, fetchMyLandingPage, fetchMyNavigation, fetchMyFooter } from './my-storefront-provider';
|
|
55
|
+
import React, { useEffect } from 'react';
|
|
56
|
+
|
|
57
|
+
const App = () => {
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
Storefront.register({
|
|
60
|
+
id: 'my-storefront',
|
|
61
|
+
title: 'My Storefront',
|
|
62
|
+
getApps: fetchMyApps,
|
|
63
|
+
getLandingPage: fetchMyLandingPage,
|
|
64
|
+
getNavigation: fetchMyNavigation,
|
|
65
|
+
getFooter: fetchMyFooter,
|
|
66
|
+
launchApp: launchApp // OpenFins default implementation of launchApp, you can also define your own
|
|
67
|
+
});
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<>
|
|
72
|
+
<button onClick={Storefront.show}>Show Store</button>
|
|
73
|
+
<button onClick={Storefront.hide}>Hide Store</button>
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
```
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as StorefrontAPI from './storefront';
|
|
2
2
|
export * from './common';
|
|
3
3
|
/**
|
|
4
|
-
* Namespace for
|
|
4
|
+
* Namespace for Storefront integrations.
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Storefront: typeof StorefrontAPI;
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(
|
|
1
|
+
(()=>{"use strict";var e={d:(o,r)=>{for(var t in r)e.o(r,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:r[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{Storefront:()=>$,launchApp:()=>T});var r,t,n={};e.r(n),e.d(n,{hide:()=>C,register:()=>b,show:()=>F}),function(e){e.Local="local",e.Dev="dev",e.Staging="staging",e.Prod="prod"}(t||(t={}));const a="undefined"!=typeof window&&"undefined"!=typeof fin,i=("undefined"==typeof process||null===(r=process.env)||void 0===r||r.JEST_WORKER_ID,"undefined"!=typeof window),d=(i?window.origin:t.Local,a&&fin.me.uuid,a&&fin.me.name,"undefined"!=typeof ENV?ENV:t.Local,t.Local,t.Dev,t.Staging,t.Prod,!0),s=("undefined"!=typeof WORKSPACE_API_URL&&WORKSPACE_API_URL,"undefined"!=typeof WORKSPACE_APPS_URL&&WORKSPACE_APPS_URL,"undefined"!=typeof WORKSPACE_STOREFRONT_FOOTER_URL&&WORKSPACE_STOREFRONT_FOOTER_URL,"undefined"!=typeof WORKSPACE_STOREFRONT_LANDING_PAGE_URL&&WORKSPACE_STOREFRONT_LANDING_PAGE_URL,"undefined"!=typeof WORKSPACE_STOREFRONT_NAVIGATION_URL&&WORKSPACE_STOREFRONT_NAVIGATION_URL,"#7795f7"),c={trace:!0,debug:"undefined"!=typeof LOG_DEBUG&&LOG_DEBUG,info:!1,warn:!0,error:!0,fatal:!0};const p=function(e,o){const r=`${e} : `,t=`color:${s}`;return{trace:c.trace?(e,...o)=>{console.trace(`%c${r}${e}`,t,...o)}:(e,...o)=>{},debug:c.debug?(e,...o)=>{console.info(`%c${r}${e}`,"color:#86db94",...o)}:(e,...o)=>{},info:c.info?(e,...o)=>{console.debug(`%c${r}${e}`,"color:#ffffff",...o)}:(e,...o)=>{},warn:c.warn?(e,...o)=>{console.warn(`%c${r}${e}`,"color:#edad68",...o)}:(e,...o)=>{},error:c.error?(e,o,...t)=>{console.error(`%c${r}${e}`,"color:#f55d67",...t,o)}:(e,o,...r)=>{},fatal:c.fatal?(e,o,...t)=>{console.error(`%c${r}${e}`,"color:#f70723",...t,o)}:(e,o,...r)=>{}}}("utils.channels"),g=i&&"complete"!==document.readyState&&new Promise((e=>document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&e()}))));var f,w,u,l,h;!function(e){e.Workspace="openfin-browser"}(f||(f={})),function(e){e.ViewPageTitleUpdated="view-page-title-updated",e.ViewDestroyed="view-destroyed",e.RunRequested="run-requested",e.WindowOptionsChanged="window-options-changed",e.WindowClosed="window-closed",e.WindowCreated="window-created"}(w||(w={})),function(e){e.FinProtocol="fin-protocol"}(u||(u={})),f.Workspace,f.Workspace,function(e){e.Home="openfin-home",e.Dock="openfin-dock",e.Storefront="openfin-storefront",e.HomeInternal="openfin-home-internal",e.BrowserMenu="openfin-browser-menu",e.BrowserIndicator="openfin-browser-indicator",e.BrowserWindow="internal-generated-window"}(l||(l={})),function(e){e.Shown="shown",e.BoundsChanged="bounds-changed",e.LayoutReady="layout-ready",e.EndUserBoundsChanging="end-user-bounds-changing",e.Blurred="blurred",e.CloseRequested="close-requested",e.Focused="focused",e.ShowRequested="show-requested",e.ViewCrashed="view-crashed",e.ViewAttached="view-attached",e.ViewDetached="view-detached"}(h||(h={})),l.Home,f.Workspace,l.Dock,f.Workspace,l.Storefront,f.Workspace;const v={name:f.Workspace,uuid:f.Workspace},S=e=>function(e){if(!a)throw new Error("getOFWindow can only be used in an OpenFin env. Avoid calling this method during pre-rendering.");return fin.Window.wrapSync(e)}(e).getOptions().then((()=>!0)).catch((()=>!1));var P,R;(R=P||(P={})).LaunchApp="launch-app",R.CreateWorkspace="create-workspace",R.UpdateWorkspace="update-workspace",R.DeleteWorkspace="delete-workspace",R.LaunchWorkspace="launch-workspace",R.ShareWorkspace="share-workspace",R.GetWorkspace="get-workspace",R.GetWorkspaceList="get-workspace-list",R.GetActiveWorkspace="get-active-workspace",R.GetPage="get-page",R.CreatePage="create-page",R.UpdatePage="update-page",R.RenamePage="rename-page",R.DeletePage="delete-page",R.SharePage="share-page",R.LaunchPage="launch-page",R.AttachPagesToWindow="attach-pages-to-window",R.DetachPagesFromWindow="detach-pages-from-window",R.ReorderPagesForWindow="reorder-pages-for-window",R.SetActivePageForWindow="set-active-page-for-window",R.GetSavedPageList="get-saved-page-list",R.GetAttachedPageList="get-running-page-list",R.GetAllPageList="get-all-page-list",R.GetActivePageIdForWindow="get-active-page-id-for-window",R.GetPagesForWindow="get-pages-for-window",R.GetSavedPageMetadata="get-saved-page-metadata",R.RegisterStorefrontProvider="register-storefront-provider",R.GetStorefrontProviders="get-storefront-providers",R.HideStorefront="hide-storefront",R.GetStorefrontProviderApps="get-storefront-provider-apps",R.GetStorefrontProviderLandingPage="get-storefront-provider-landing-page",R.GetStorefrontProviderFooter="get-storefront-provider-footer",R.GetStorefrontProviderNavigation="get-storefront-provider-navigation",R.LaunchStorefrontProviderApp="launch-storefront-provider-app",R.ShowStorefront="show-storefront",R.CreateStorefrontWindow="create-storefront-window",R.CreateBrowserWindow="create-browser-window";const y=function(e){let o;return()=>{if(!a)throw new Error("getChannelClient cannot be used outside an OpenFin env. Avoid using this method during pre-rendering.");return o||(p.debug(`connecting to channel provider ${e}`),o=(async()=>{await g;const r=await fin.InterApplicationBus.Channel.connect(e);return r.onDisconnection((async()=>{p.warn(`disconnected from channel provider ${e}`),o=void 0})),r})().then((o=>(p.debug(`connected to channel provider ${e}`),o))).catch((o=>{p.error(`failed to connect to channel provider ${e}`,o)}))),o}}("__of_workspace_protocol__"),A=async()=>{if(!await S(v))return fin.System.openUrlWithBrowser((()=>{const e=new URL("fins://system-apps/workspace");return e.searchParams.append("isLaunchedViaLib",d.toString()),e.toString()})())},W=async()=>(await A(),y());var O,_,L;let m;!function(e){e.Snapshot="snapshot",e.Manifest="manifest",e.View="view",e.External="external"}(O||(O={})),(L=_||(_={})).LandingPage="landingPage",L.AppGrid="appGrid";const E=new Map;let G=!1;const k=e=>{if(!E.has(e))throw new Error(`Storefront Provider with id ${e} is not registered`);return E.get(e)},b=e=>(m=(async e=>{const o=await W();if(E.has(e.id))throw new Error(`Storefront provider with id ${e.id} already registered`);return E.set(e.id,e),(e=>{G||(G=!0,e.register(P.GetStorefrontProviderApps,(e=>k(e).getApps())),e.register(P.GetStorefrontProviderFooter,(e=>k(e).getFooter())),e.register(P.GetStorefrontProviderLandingPage,(e=>k(e).getLandingPage())),e.register(P.GetStorefrontProviderNavigation,(e=>k(e).getNavigation())),e.register(P.LaunchStorefrontProviderApp,(({id:e,app:o})=>k(e).launchApp(o))))})(o),o.dispatch(P.RegisterStorefrontProvider,e)})(e),m),C=async()=>{await m,await A(),await(async()=>(await y()).dispatch(P.HideStorefront,void 0))()},F=async()=>{await m,await A(),await(async()=>(await y()).dispatch(P.ShowStorefront,null))()},T=async e=>(await W()).dispatch(P.LaunchApp,e),$=n;module.exports=o})();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1B,EAAwB,CAACC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,GAAIQ,kBACxGnC,EAAQ6B,SAAS,+BAA2C,EAAGF,GAAAA,EAAIS,IAAAA,KAAUV,EAA4BC,GAAIU,UAAUD,OAUvHE,CAA6BtC,GACtBA,EAAQuC,SAAS,6BAA0CT,IAMrCU,CAAiBV,GACvCR,GAMEmB,EAAO1C,gBACVuB,QACAZ,SCuDoBX,iBAEJ,KACPwC,SAAS,sBAA8BlC,GDzDhDqC,IAKGC,EAAO5C,gBACVuB,QACAZ,SCxCoBX,iBACJ,KACPwC,SAAS,iBAA8B,MDuChDK,IE/DGP,EAAYtC,MAAOqC,UACNjB,KACPoB,SAAS,YAAyBH,GCFxCnD,EAAa,E","sources":["webpack://@openfin/workspace/webpack/bootstrap","webpack://@openfin/workspace/webpack/runtime/define property getters","webpack://@openfin/workspace/webpack/runtime/hasOwnProperty shorthand","webpack://@openfin/workspace/webpack/runtime/make namespace object","webpack://@openfin/workspace/../common/src/utils/env.ts","webpack://@openfin/workspace/../common/src/utils/logger/shapes.ts","webpack://@openfin/workspace/../common/src/utils/logger/index.ts","webpack://@openfin/workspace/../common/src/utils/channels.ts","webpack://@openfin/workspace/../common/src/utils/application.ts","webpack://@openfin/workspace/../common/src/utils/window.ts","webpack://@openfin/workspace/../common/src/api/protocol.ts","webpack://@openfin/workspace/./src/shapes.ts","webpack://@openfin/workspace/./src/storefront.ts","webpack://@openfin/workspace/../common/src/api/storefront.ts","webpack://@openfin/workspace/./src/common.ts","webpack://@openfin/workspace/./src/index.ts"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_a","Env","window","fin","isWindowDefined","process","env","JEST_WORKER_ID","isLibrary","origin","Local","me","uuid","name","ENV","Dev","Staging","Prod","LogColors","WORKSPACE_API_URL","WORKSPACE_APPS_URL","WORKSPACE_STOREFRONT_FOOTER_URL","WORKSPACE_STOREFRONT_LANDING_PAGE_URL","WORKSPACE_STOREFRONT_NAVIGATION_URL","logLocalDefaults","trace","debug","LOG_DEBUG","info","warn","error","fatal","log","logLocal","localPrefix","traceColor","message","args","console","logger","docLoadPromise","document","readyState","Promise","res","addEventListener","ApplicationUUID","ApplicationEventType","LaunchModeType","WindowName","WindowEvent","Workspace","Home","Dock","Storefront","providerOFIdentity","isWindowRunning","identity","Error","Window","wrapSync","getOFWindow","getOptions","then","catch","ChannelAction","channelName","channelPromise","async","channel","InterApplicationBus","Channel","connect","onDisconnection","undefined","connectToChannel","r","err","makeGetChannelClient","launchProvider","System","openUrlWithBrowser","finsURL","URL","searchParams","append","toString","getProviderFinsLink","getChannelClientAndLaunchProvider","AppManifestType","StorefrontTemplate","currentRegistrationPromise","registeredProviders","Map","isRegistered","getStorefrontProviderOrFail","id","has","register","provider","set","getApps","getFooter","getLandingPage","getNavigation","app","launchApp","registerChannelClientActions","dispatch","registerInternal","hide","hideStorefront","show","showStorefront"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@openfin/workspace","description":"An API for integrating with OpenFin Workspace.","author":"Brandon Waring <brandon.waring@openfin.co>","contributors":[],"version":"
|
|
1
|
+
{"name":"@openfin/workspace","description":"An API for integrating with OpenFin Workspace.","author":"Brandon Waring <brandon.waring@openfin.co>","contributors":[],"version":"3.0.0","main":"src/index.ts","scripts":{"deploy":"npm run deploy:npm && npm run deploy:docs","deploy:npm":"cd out && npm publish","deploy:docs":"aws s3 cp --recursive ./docs/ s3://cdn.openfin.co/workspace/api/docs/","clean:dts":"rimraf ./out/client-api && rimraf ./out/common && rimraf ./out/search-api","cp:dts":"copyfiles -u 3 out/client-api/src/*.d.ts out","cp:manifest":"copyfiles package.json out","cp:readme":"copyfiles README.md out","cp:package":"node ./scripts/cp-package.js","package":"npm run cp:dts && npm run clean:dts && npm run cp:readme && npm run cp:package","clean":"rimraf ./out && rimraf ./docs","build:common":"cross-env ENV=prod webpack --mode=production --config ./webpack.common.config.js","build":"npm run clean && npm run build:common && npm run build:docs","build:docs":"typedoc --tsconfig ./tsconfig.json --readme none --disableSources ./src/shapes.ts","test":"jest --watch --colors","test:ci":"jest"},"keywords":["client api"],"license":"MIT","bugs":{"url":"https://github.com/openfin/workspace/issues"},"homepage":"https://github.com/openfin/workspace/search-api#readme"}
|
package/shapes.d.ts
CHANGED
|
@@ -77,14 +77,14 @@ export interface App {
|
|
|
77
77
|
contactEmail?: string;
|
|
78
78
|
supportEmail?: string;
|
|
79
79
|
}
|
|
80
|
-
export declare enum
|
|
80
|
+
export declare enum StorefrontTemplate {
|
|
81
81
|
LandingPage = "landingPage",
|
|
82
82
|
AppGrid = "appGrid"
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Represents a link to be rendered inside
|
|
85
|
+
* Represents a link to be rendered inside Storefront.
|
|
86
86
|
*/
|
|
87
|
-
export interface
|
|
87
|
+
export interface StorefrontLink {
|
|
88
88
|
/**
|
|
89
89
|
* A UI friendly title to render the link as.
|
|
90
90
|
*/
|
|
@@ -94,21 +94,21 @@ export interface ContentStoreLink {
|
|
|
94
94
|
*/
|
|
95
95
|
url: string;
|
|
96
96
|
}
|
|
97
|
-
export interface
|
|
97
|
+
export interface StorefrontFooter {
|
|
98
98
|
/**
|
|
99
|
-
* A logo to be displayed on the
|
|
99
|
+
* A logo to be displayed on the Storefront's footer.
|
|
100
100
|
*/
|
|
101
101
|
logo: Image;
|
|
102
102
|
/**
|
|
103
|
-
* A set of links to display on
|
|
103
|
+
* A set of links to display on Storefront's footer.
|
|
104
104
|
*/
|
|
105
|
-
links: [
|
|
105
|
+
links: [StorefrontLink?, StorefrontLink?, StorefrontLink?];
|
|
106
106
|
text: string;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* Render a navigation section on the left panel of
|
|
109
|
+
* Render a navigation section on the left panel of Storefront.
|
|
110
110
|
*/
|
|
111
|
-
export interface
|
|
111
|
+
export interface StorefrontNavigationSection {
|
|
112
112
|
/**
|
|
113
113
|
* Unique identifier for the navigation section.
|
|
114
114
|
*/
|
|
@@ -122,27 +122,27 @@ export interface ContentStoreNavigationSection {
|
|
|
122
122
|
* 1-5 Navigation Items are supported.
|
|
123
123
|
*/
|
|
124
124
|
items: [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
StorefrontNavigationItem,
|
|
126
|
+
StorefrontNavigationItem?,
|
|
127
|
+
StorefrontNavigationItem?,
|
|
128
|
+
StorefrontNavigationItem?,
|
|
129
|
+
StorefrontNavigationItem?
|
|
130
130
|
];
|
|
131
131
|
}
|
|
132
|
-
export interface
|
|
132
|
+
export interface StorefrontLandingPage {
|
|
133
133
|
hero?: {
|
|
134
134
|
title: string;
|
|
135
135
|
description: string;
|
|
136
|
-
cta:
|
|
136
|
+
cta: StorefrontNavigationItem;
|
|
137
137
|
image: Image;
|
|
138
138
|
};
|
|
139
139
|
topRow: {
|
|
140
140
|
title: string;
|
|
141
141
|
items: [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
StorefrontDetailedNavigationItem?,
|
|
143
|
+
StorefrontDetailedNavigationItem?,
|
|
144
|
+
StorefrontDetailedNavigationItem?,
|
|
145
|
+
StorefrontDetailedNavigationItem?
|
|
146
146
|
];
|
|
147
147
|
};
|
|
148
148
|
middleRow: {
|
|
@@ -152,22 +152,22 @@ export interface ContentStoreLandingPage {
|
|
|
152
152
|
bottomRow: {
|
|
153
153
|
title: string;
|
|
154
154
|
items: [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
StorefrontDetailedNavigationItem?,
|
|
156
|
+
StorefrontDetailedNavigationItem?,
|
|
157
|
+
StorefrontDetailedNavigationItem?
|
|
158
158
|
];
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
|
-
* Render a grid of applications in
|
|
162
|
+
* Render a grid of applications in Storefront.
|
|
163
163
|
*/
|
|
164
|
-
export interface
|
|
164
|
+
export interface StorefrontAppGrid {
|
|
165
165
|
/**
|
|
166
166
|
* The apps to render in the grid.
|
|
167
167
|
*/
|
|
168
168
|
apps: App[];
|
|
169
169
|
}
|
|
170
|
-
export interface
|
|
170
|
+
export interface StorefrontNavigationItemBase {
|
|
171
171
|
/**
|
|
172
172
|
* An ID for referencing the navigation item. Must be unique.
|
|
173
173
|
*/
|
|
@@ -177,94 +177,95 @@ export interface ContentStoreNavigationItemBase {
|
|
|
177
177
|
*/
|
|
178
178
|
title: string;
|
|
179
179
|
}
|
|
180
|
-
export interface
|
|
180
|
+
export interface StorefrontNavigationItemDetails {
|
|
181
181
|
description: string;
|
|
182
182
|
image: Image;
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
185
|
* Template for rendering a navigation item that renders a app grid when clicked.
|
|
186
186
|
*/
|
|
187
|
-
export interface
|
|
188
|
-
templateId:
|
|
187
|
+
export interface StorefrontNavigationItemAppGrid extends StorefrontNavigationItemBase {
|
|
188
|
+
templateId: StorefrontTemplate.AppGrid;
|
|
189
189
|
/**
|
|
190
190
|
* Render an app grid when navigation item is pressed.
|
|
191
191
|
*/
|
|
192
|
-
templateData:
|
|
192
|
+
templateData: StorefrontAppGrid;
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
195
|
* Template for rendering a navigation item that renders another landing page when clicked.
|
|
196
196
|
*/
|
|
197
|
-
export interface
|
|
198
|
-
templateId:
|
|
197
|
+
export interface StorefrontNavigationItemLandingPage extends StorefrontNavigationItemBase {
|
|
198
|
+
templateId: StorefrontTemplate.LandingPage;
|
|
199
199
|
/**
|
|
200
200
|
* Render a landing page when navigation item is pressed.
|
|
201
201
|
*/
|
|
202
|
-
templateData:
|
|
202
|
+
templateData: StorefrontLandingPage;
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
|
-
* Render an item in the navigation bar of
|
|
205
|
+
* Render an item in the navigation bar of Storefront.
|
|
206
206
|
*/
|
|
207
|
-
export declare type
|
|
207
|
+
export declare type StorefrontNavigationItem = StorefrontNavigationItemAppGrid | StorefrontNavigationItemLandingPage;
|
|
208
208
|
/**
|
|
209
|
-
* Render an item in the navigation bar of
|
|
209
|
+
* Render an item in the navigation bar of Storefront with a description and image.
|
|
210
210
|
*/
|
|
211
|
-
export declare type
|
|
212
|
-
export interface
|
|
211
|
+
export declare type StorefrontDetailedNavigationItem = StorefrontNavigationItem & StorefrontNavigationItemDetails;
|
|
212
|
+
export interface StorefrontProviderInfo {
|
|
213
213
|
/**
|
|
214
|
-
* Unique identifier for the
|
|
214
|
+
* Unique identifier for the Storefront provider.
|
|
215
215
|
*/
|
|
216
216
|
id: string;
|
|
217
217
|
/**
|
|
218
|
-
* A UI friendly title for the platform
|
|
219
|
-
* This will be used in the
|
|
218
|
+
* A UI friendly title for the platform Storefront.
|
|
219
|
+
* This will be used in the Storefront selection dropdown.
|
|
220
220
|
*/
|
|
221
221
|
title: string;
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
|
-
* Describes a
|
|
225
|
-
* A platform must provide an object that satisfies this interface in order to register with the
|
|
224
|
+
* Describes a Storefront provided by a platform.
|
|
225
|
+
* A platform must provide an object that satisfies this interface in order to register with the Storefront.
|
|
226
226
|
*/
|
|
227
|
-
export interface
|
|
227
|
+
export interface StorefrontProvider extends StorefrontProviderInfo {
|
|
228
228
|
/**
|
|
229
|
-
* Get a list of apps to populate the platform's
|
|
229
|
+
* Get a list of apps to populate the platform's Storefront with.
|
|
230
230
|
*/
|
|
231
231
|
getApps(): Promise<App[]>;
|
|
232
232
|
/**
|
|
233
|
-
* Get the main landing page for the platform's
|
|
233
|
+
* Get the main landing page for the platform's Storefront.
|
|
234
234
|
*/
|
|
235
|
-
getLandingPage(): Promise<
|
|
235
|
+
getLandingPage(): Promise<StorefrontLandingPage>;
|
|
236
236
|
/**
|
|
237
|
-
* Get the
|
|
237
|
+
* Get the Storefront navigation sections for the left nav bar.
|
|
238
238
|
*/
|
|
239
|
-
getNavigation(): Promise<[
|
|
239
|
+
getNavigation(): Promise<[StorefrontNavigationSection?, StorefrontNavigationSection?]>;
|
|
240
240
|
/**
|
|
241
|
-
* Get the footer for the platform's
|
|
241
|
+
* Get the footer for the platform's Storefront.
|
|
242
242
|
*/
|
|
243
|
-
getFooter(): Promise<
|
|
243
|
+
getFooter(): Promise<StorefrontFooter>;
|
|
244
244
|
/**
|
|
245
|
-
* Launch an app provided by the platform's
|
|
245
|
+
* Launch an app provided by the platform's Storefront.
|
|
246
246
|
*/
|
|
247
247
|
launchApp(app: App): Promise<void>;
|
|
248
248
|
}
|
|
249
249
|
/**
|
|
250
|
-
* Interface that contains functions for integrating with
|
|
250
|
+
* Interface that contains functions for integrating with Storefront.
|
|
251
251
|
*/
|
|
252
|
-
export interface
|
|
252
|
+
export interface StorefrontAPI {
|
|
253
253
|
/**
|
|
254
|
-
* Register a
|
|
255
|
-
* @param provider the implementation of a
|
|
254
|
+
* Register a Storefront provider.
|
|
255
|
+
* @param provider the implementation of a Storefront provider.
|
|
256
|
+
|
|
256
257
|
*/
|
|
257
|
-
register(provider:
|
|
258
|
+
register(provider: StorefrontProvider): Promise<void>;
|
|
258
259
|
/**
|
|
259
|
-
* Show the
|
|
260
|
+
* Show the Storefront UI.
|
|
260
261
|
*/
|
|
261
262
|
show(): Promise<void>;
|
|
262
263
|
/**
|
|
263
|
-
* Hide the
|
|
264
|
+
* Hide the Storefront UI.
|
|
264
265
|
*/
|
|
265
266
|
hide(): Promise<void>;
|
|
266
267
|
}
|
|
267
|
-
export declare const
|
|
268
|
+
export declare const Storefront: StorefrontAPI;
|
|
268
269
|
/**
|
|
269
270
|
* Default Workspace implementation for launching an application.
|
|
270
271
|
* @param app the application to launch.
|
package/storefront.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StorefrontProvider } from './shapes';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a Storefront provider
|
|
4
|
+
*/
|
|
5
|
+
export declare const register: (provider: StorefrontProvider) => Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* API function to hide Storefront
|
|
8
|
+
* @returns promise - invokes hide-storefront action
|
|
9
|
+
*/
|
|
10
|
+
export declare const hide: () => Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Shows Storefront window if enabled & registered
|
|
13
|
+
*/
|
|
14
|
+
export declare const show: () => Promise<void>;
|
package/content-store.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ContentStoreProvider } from './shapes';
|
|
2
|
-
/**
|
|
3
|
-
* Registers a content store provider
|
|
4
|
-
*/
|
|
5
|
-
export declare const register: (provider: ContentStoreProvider) => Promise<void>;
|
|
6
|
-
/**
|
|
7
|
-
* API function to hide content store
|
|
8
|
-
* @returns promise - invokes hide-content-store action
|
|
9
|
-
*/
|
|
10
|
-
export declare const hide: () => Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Shows content store window if enabled & registered
|
|
13
|
-
*/
|
|
14
|
-
export declare const show: () => Promise<void>;
|