Skip to content

Commit

Permalink
Snap and dock updates (#671)
Browse files Browse the repository at this point in the history
The snap examples have been updated to include the snap asset url to make it easier for developers to test and discover the capabilities of snap.

The dock example was updated to increase the width of the window as the new buttons resulted in scroll bars and the new buttons were enabled even if no dock was registered.
  • Loading branch information
johnman authored Jan 22, 2024
1 parent a540c3e commit b186bc6
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion how-to/integrate-with-snap-basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This example demonstrates connecting to and using layouts with Snap.

The package utilized by this example is [@openfin/snap-sdk](https://www.npmjs.com/package/@openfin/snap-sdk).

> The **@openfin/snap-sdk** is currently in beta, this sample requires the Snap Asset Url for the Snap Server. Please ask OpenFin for the url and then replace the `SNAP_ASSET_URL` in `manifest.fin.json` with it.
> The **@openfin/snap-sdk** is currently in beta. The version of the Snap SDK is referenced in package.json and the app asset defined in `manifest.fin.json`.
## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion how-to/integrate-with-snap-basic/public/manifest.fin.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"appAssets": [
{
"src": "SNAP_ASSET_URL",
"src": "https://cdn.openfin.co/release/snap/0.2.0/snap.zip",
"alias": "openfin-snap",
"version": "0.2.0",
"target": "OpenFinSnap.exe",
Expand Down
2 changes: 1 addition & 1 deletion how-to/integrate-with-snap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This example demonstrates saving and restoring native applications as part of a

The package utilized by this example is [@openfin/snap-sdk](https://www.npmjs.com/package/@openfin/snap-sdk).

> The **@openfin/snap-sdk** is currently in beta, this sample requires the Snap Asset Url for the Snap Server. Please ask OpenFin for the url and then replace the `SNAP_ASSET_URL` in `manifest.fin.json` with it.
> The **@openfin/snap-sdk** is currently in beta. The version of the Snap SDK is referenced in package.json and the app asset defined in `manifest.fin.json`.
## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion how-to/integrate-with-snap/public/manifest.fin.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
"appAssets": [
{
"src": "SNAP_ASSET_URL",
"src": "https://cdn.openfin.co/release/snap/0.2.0/snap.zip",
"alias": "openfin-snap",
"version": "0.2.0",
"target": "OpenFinSnap.exe",
Expand Down
1 change: 0 additions & 1 deletion how-to/register-with-dock-basic/client/src/dock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
type CustomActionsMap
} from "@openfin/workspace-platform";


let platformTitle: string | undefined;
let platformIcon: string | undefined;
let customIconUrl: string | undefined;
Expand Down
4 changes: 4 additions & 0 deletions how-to/register-with-dock-basic/client/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ function setStates(isRegistered: boolean | null): void {
deregisterButton &&
showButton &&
minimizeButton &&
enableButton &&
disableButton &&
showHomeButton &&
showNotificationButton &&
showStorefrontButton &&
Expand All @@ -202,6 +204,8 @@ function setStates(isRegistered: boolean | null): void {
deregisterButton.disabled = isRegistered === null || !isRegistered;
showButton.disabled = isRegistered === null || !isRegistered;
minimizeButton.disabled = isRegistered === null || !isRegistered;
enableButton.disabled = isRegistered === null || !isRegistered;
disableButton.disabled = isRegistered === null || !isRegistered;
showHomeButton.disabled = isRegistered === null || isRegistered;
showNotificationButton.disabled = isRegistered === null || isRegistered;
showStorefrontButton.disabled = isRegistered === null || isRegistered;
Expand Down
4 changes: 3 additions & 1 deletion how-to/register-with-dock-basic/public/manifest.fin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"icon": "http://localhost:8080/favicon.ico",
"autoShow": true,
"providerUrl": "http://localhost:8080/platform/provider.html",
"preventQuitOnLastWindowClosed": true
"preventQuitOnLastWindowClosed": true,
"minWidth": 750,
"defaultWidth": 750
},
"shortcut": {
"company": "OpenFin",
Expand Down
2 changes: 1 addition & 1 deletion how-to/workspace-platform-starter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- Docs - Added a document showing [How To Add A Service](./docs/how-to-add-a-service.md)
- Improved launchPreference so that now args for a native app (app asset or external) can be specified via launchPreference. Launch preference can also be configured to allow args to be specified dynamically when the launch request is made. Please see [how to define app launch preference](./docs/how-to-define-app-launch-preference.md).
- Improved launchPreference so additional options such as url, interop, customData can be specified. Modules can now pass a launchPreference when launching an app by appId. They can see if the app supports being updated by getting the app by id and checking for the updatable setting under launchPreference.options. Only inline-view/view and inline-window/window support updatable launch preferences. Please see [how to define app launch preference](./docs/how-to-define-app-launch-preference.md).
- Added support for Snap, enable by setting `customSettings.snapProvider.enabled` to true. Configure the `customSettings.snapProvider.serverAssetInfo` to point to the `SNAP_ASSET_URL`. Enable the Snap debugging window by setting `customSettings.snapProvider.showDebugWindow` to true.
- Added support for Snap, enable by setting `customSettings.snapProvider.enabled` to true. Enable the Snap debugging window by setting `customSettings.snapProvider.showDebugWindow` to true.
- Added new module type `content-creation`, these modules can be used to define content creation rules and handle the associated events. Modules are added in `customSettings.contentCreationProvider` section in manifest.
- Added example content creation module which interrogates the `features` property from `window.open` to determine where to place a view in relation to where it was launched from. An example app `Content Creation Example` demonstrates this in use.
- Added CustomActionCallerType enum to actions-shapes, use these in preference to the workspace-platform CustomActionCallerType type to avoid importing the whole npm package into your modules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
The OpenFin Snap SDK provides the ability to snap windows together, include native applications.
For more detailed information see [OpenFin Snap SDK](https://developers.openfin.co/of-docs/docs/snap)

To enable snap support in your platform you can add the following in your manifest.fin.json. As the Snap SDK is currently in beta you must contact OpenFin to get the real url for the `SNAP_ASSET_URL`
To enable snap support in your platform you can add the following in your manifest.fin.json.

```json
{
Expand All @@ -17,7 +17,7 @@ To enable snap support in your platform you can add the following in your manife
"enabled": true,
"id": "workspace-platform-starter",
"serverAssetInfo": {
"src": "SNAP_ASSET_URL",
"src": "https://cdn.openfin.co/release/snap/0.2.0/snap.zip",
"alias": "openfin-snap",
"version": "0.2.0",
"target": "OpenFinSnap.exe"
Expand Down
2 changes: 1 addition & 1 deletion how-to/workspace-platform-starter/public/manifest.fin.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@
"enabled": false,
"id": "workspace-platform-starter",
"serverAssetInfo": {
"src": "SNAP_ASSET_URL",
"src": "https://cdn.openfin.co/release/snap/0.2.0/snap.zip",
"alias": "openfin-snap",
"version": "0.2.0",
"target": "OpenFinSnap.exe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@
"enabled": false,
"id": "workspace-platform-starter",
"serverAssetInfo": {
"src": "SNAP_ASSET_URL",
"src": "https://cdn.openfin.co/release/snap/0.2.0/snap.zip",
"alias": "openfin-snap",
"version": "0.2.0",
"target": "OpenFinSnap.exe"
Expand Down

0 comments on commit b186bc6

Please sign in to comment.