@openfin/workspace-platform 4.23.0 → 4.27.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 CHANGED
@@ -1,4 +1,4 @@
1
- # Workspace Client API
1
+ # Workspace Platform API
2
2
 
3
3
  The Workspace Platform Client APIs allow integrators to create their own Workspace platforms.
4
4
 
@@ -10,13 +10,40 @@ Run `npm i -E @openfin/workspace-platform`.
10
10
 
11
11
  ## Workspace Platform API documentation
12
12
 
13
- - [Overview](https://developers.openfin.co/of-docs/doc/)
14
- - [API Reference](https://cdn.openfin.co/workspace/api/platform/docs/)
13
+ - [Overview](https://developers.openfin.co/of-docs/docs/workspace-sdk)
14
+ - [API Reference](https://cdn.openfin.co/workspace/api/platform/docs/latest/index.html)
15
+ - [Example projects using Workspace Platform](https://github.com/built-on-openfin/workspace-starter)
15
16
 
16
17
  ## Code examples
17
18
 
19
+ ### Initilaize a Workspace Platform
20
+
18
21
  ```typescript
19
22
  import * as WorkspacePlatform from '@openfin/workspace-platform';
20
23
 
21
- WorkspacePlatform.init();
24
+ const customThemes: WorkspacePlatform.CustomThemes = [
25
+ {
26
+ label: "OpenFin's Custom Theme",
27
+ palette: {
28
+ brandPrimary: ‘#F51F63, // required
29
+ brandSecondary: ‘#1FF58A’, // required
30
+ backgroundPrimary: ‘#F8E71C’, // required - hex, rgb/rgba, hsl/hsla only - no string colors: ‘red’
31
+ background2: ‘#7D808A’ // any of the optional colors
32
+ }
33
+ }
34
+ ];
35
+
36
+ const overrideCallback: WorkspacePlatform.BrowserOverrideCallback = async (WorkspacePlatformProvider) => {
37
+ class Override extends WorkspacePlatformProvider {
38
+ async quit(payload, callerIdentity) {
39
+ return super.quit(payload, callerIdentity);
40
+ }
41
+ }
42
+ return new Override();
43
+ };
44
+
45
+ await WorkspacePlatform.init({
46
+ browser: { overrideCallback },
47
+ theme: customThemes
48
+ });
22
49
  ```
@@ -581,15 +581,50 @@ export interface WorkspacePlatformInitConfig {
581
581
  theme?: CustomThemes;
582
582
  }
583
583
  /**
584
- * Callback for overriding a Workspace Platform Provider.
584
+ * Extend or replace default functionality in order to customize behavior of a Workspace Platform Provider.
585
+ *
586
+ * To implement your own handlers for Workspace Platform behavior, extend the provided class and override any methods you'd like to alter.
587
+ *
588
+ * ```ts
589
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
590
+ * import { UpdateSavedPageRequest } from '../../client-api-platform/src/shapes';
591
+ *
592
+ * const overrideCallback: WorkspacePlatform.BrowserOverrideCallback = async (
593
+ * WorkspacePlatformProvider
594
+ * ) => {
595
+ * class Override extends WorkspacePlatformProvider {
596
+ * updateSavedPage = async (req: UpdateSavedPageRequest): Promise<void> => {
597
+ * console.log(`saving page ${req.page.pageId}`);
598
+ * // calling custom function to the save page here
599
+ * };
600
+ * }
601
+ * return new Override();
602
+ * };
603
+ *
604
+ * await WorkspacePlatform.init({
605
+ * browser: { overrideCallback },
606
+ * });
585
607
  */
586
608
  export declare type BrowserOverrideCallback = OpenFin.OverrideCallback<WorkspacePlatformProvider>;
587
609
  /**
588
610
  * Configuration for initializing a Browser.
589
611
  */
590
612
  export interface BrowserInitConfig {
613
+ /**
614
+ * Default options for creating a new browser window. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createWindow(options) call will default to the value provided in this field.
615
+ */
591
616
  defaultWindowOptions?: BrowserCreateWindowRequest;
617
+ /**
618
+ * The default options when creating a new browser window. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createView(options) call will default to the value provided in this field.
619
+ */
592
620
  defaultViewOptions?: OpenFin.ViewOptions;
621
+ /**
622
+ * Override workspace platform behavior
623
+ */
593
624
  overrideCallback?: BrowserOverrideCallback;
625
+ /**
626
+ * Override workspace platform interop behavior
627
+ * https://cdn.openfin.co/docs/javascript/stable/InteropBroker.html
628
+ */
594
629
  interopOverride?: OpenFin.OverrideCallback<InteropBroker, InteropBroker>;
595
630
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@openfin/workspace-platform","description":"An API for creating your own Workspace platform.","contributors":[],"version":"4.23.0","main":"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/platform/docs/","deploy:next":"npm run deploy:next:npm && npm run deploy:next:docs","deploy:next:npm":"cd out && npm publish --tag next","deploy:next:docs":"aws s3 cp --recursive ./docs/ s3://cdn.openfin.co/workspace/api/platform/docs/next/","cp:readme":"copyfiles README.md out","cp:package":"node ../common/scripts/cp-package.js","cp:next:package":"node ../common/scripts/cp-package-next.js","create:rootIndex":"node ../common/scripts/cp-root-index.js","package":"npm run cp:readme && npm run cp:package && npm run create:rootIndex","package:next":"npm run cp:readme && npm run cp:next:package && npm run create:rootIndex","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/index.ts","test":"jest --watch --colors","test:ci":"jest"},"keywords":["client","api","workspace","platform"],"license":"MIT"}
1
+ {"name":"@openfin/workspace-platform","description":"An API for creating your own Workspace platform.","contributors":[],"version":"4.27.0","main":"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/platform/docs/","deploy:next":"npm run deploy:next:npm && npm run deploy:next:docs","deploy:next:npm":"cd out && npm publish --tag next","deploy:next:docs":"aws s3 cp --recursive ./docs/ s3://cdn.openfin.co/workspace/api/platform/docs/next/","cp:readme":"copyfiles README.md out","cp:package":"node ../common/scripts/cp-package.js","cp:next:package":"node ../common/scripts/cp-package-next.js","create:rootIndex":"node ../common/scripts/cp-root-index.js","package":"npm run cp:readme && npm run cp:package && npm run create:rootIndex","package:next":"npm run cp:readme && npm run cp:next:package && npm run create:rootIndex","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/index.ts","test":"jest --watch --colors","test:ci":"jest"},"keywords":["client","api","workspace","platform"],"license":"MIT"}