From 6df006bd1791d456168911da6ed77c77f8f3a0ce Mon Sep 17 00:00:00 2001 From: pgm-vole <> Date: Mon, 8 Feb 2021 17:04:09 +0000 Subject: [PATCH 1/7] add app metadata icon spec --- docs/api/ref/AppMetadata.md | 5 ++- docs/api/ref/Icon.md | 55 +++++++++++++++++++++++ src/app-directory/specification/appd.yaml | 8 +++- 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 docs/api/ref/Icon.md diff --git a/docs/api/ref/AppMetadata.md b/docs/api/ref/AppMetadata.md index 2b5eae082..e429e61e3 100644 --- a/docs/api/ref/AppMetadata.md +++ b/docs/api/ref/AppMetadata.md @@ -14,7 +14,7 @@ interface AppMetadata { title?: string; tooltip?: string; description?: string; - icons?: Array; + icons?: Array; images?: Array; } ``` @@ -29,4 +29,5 @@ This includes a title, description, tooltip and icon and image URLs. In situations where a desktop agent connects to multiple app directories or multiple versions of the same app exists in a single app directory, it may be neccessary to specify appId and version to target applications that share the same name. #### See also -* [`AppIntent.apps`](AppIntent) \ No newline at end of file +* [`AppIntent.apps`](AppIntent) +* [`Icon`](Icon) \ No newline at end of file diff --git a/docs/api/ref/Icon.md b/docs/api/ref/Icon.md new file mode 100644 index 000000000..8f5097cb6 --- /dev/null +++ b/docs/api/ref/Icon.md @@ -0,0 +1,55 @@ +--- +id: Icon +sidebar_label: Icon +title: Icon +hide_title: true +--- +# `Icon` + +```typescript +interface Icon { + src: string; + size: string; + type: string; +} +``` + +App medata icon's description. + +Various properties may be used by the Desktop Agent to decide which icon is the most suitable to be used considering the device DPI, bandwith and format support. + +#### Example + +```js +"icons": [ + { + "src": "icon/lowres.webp", + "size": "48x48", + "type": "image/webp" + }, + { + "src": "icon/hd_hi.svg", + "size": "72x72" + } +] +``` + +## Properties + +### `src` + +The url to the icon. + +### `size` + +The dimension of the icon using formatted as "x" + +### `type` + +The media type of the icon. If not provided the Desktop agent may refer to the src file extension. + + + +#### See also +* [`AppMetadata`](AppMetadata) + diff --git a/src/app-directory/specification/appd.yaml b/src/app-directory/specification/appd.yaml index 1bb65de61..77789d9e2 100644 --- a/src/app-directory/specification/appd.yaml +++ b/src/app-directory/specification/appd.yaml @@ -347,9 +347,15 @@ components: Icon: description: Icon holder properties: - icon: + src: type: string description: Icon URL + size: + type: string + description: Icon dimensions formated as "x" + type: + type: string + description: Image media type. If not present the Desktop agent may use the src file extension AppImage: description: App Image holder properties: From 6f2761b0407e88e6689358f163eb1d9508709160 Mon Sep 17 00:00:00 2001 From: pgm-vole <> Date: Mon, 8 Feb 2021 17:17:03 +0000 Subject: [PATCH 2/7] add Icon TS files --- docs/api/ref/Icon.md | 2 +- src/api/AppMetadata.ts | 4 +++- src/api/Icon.ts | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/api/Icon.ts diff --git a/docs/api/ref/Icon.md b/docs/api/ref/Icon.md index 8f5097cb6..94c4fe569 100644 --- a/docs/api/ref/Icon.md +++ b/docs/api/ref/Icon.md @@ -14,7 +14,7 @@ interface Icon { } ``` -App medata icon's description. +App Metadata icon's description. Various properties may be used by the Desktop Agent to decide which icon is the most suitable to be used considering the device DPI, bandwith and format support. diff --git a/src/api/AppMetadata.ts b/src/api/AppMetadata.ts index cc53c8101..952d9d30e 100644 --- a/src/api/AppMetadata.ts +++ b/src/api/AppMetadata.ts @@ -3,6 +3,8 @@ * Copyright 2019 FINOS FDC3 contributors - see NOTICE file */ +import { Icon } from './Icon'; + /** * App definition as provided by the application directory */ @@ -26,7 +28,7 @@ export interface AppMetadata { readonly description?: string; /** A list of icon URLs for the application that can be used to render UI elements */ - readonly icons?: Array; + readonly icons?: Array; /** A list of image URLs for the application that can be used to render UI elements */ readonly images?: Array; diff --git a/src/api/Icon.ts b/src/api/Icon.ts new file mode 100644 index 000000000..2d28fdf73 --- /dev/null +++ b/src/api/Icon.ts @@ -0,0 +1,15 @@ +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright 2019 FINOS FDC3 contributors - see NOTICE file + */ + +export interface Icon { + /** The icon url */ + readonly src: string; + + /** The icon dimension */ + readonly size?: string; + + /** The icon media type */ + readonly type?: string; +} From 2db68461bc938253e65ef82be6da53b434bb8a02 Mon Sep 17 00:00:00 2001 From: pgm-vole <> Date: Mon, 8 Feb 2021 17:25:46 +0000 Subject: [PATCH 3/7] add mention of fq url --- docs/api/ref/AppMetadata.md | 2 +- docs/api/ref/Icon.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/ref/AppMetadata.md b/docs/api/ref/AppMetadata.md index e429e61e3..d9ddbdc22 100644 --- a/docs/api/ref/AppMetadata.md +++ b/docs/api/ref/AppMetadata.md @@ -24,7 +24,7 @@ App metadata is provided by the FDC3 App Directory that the desktop agent connec It always includes at least a `name` property, which can be used with [`open`](DesktopAgent#open) and [`raiseIntent`](DesktopAgent#raiseIntent). Optionally, extra information from the app directory can be returned, to aid in rendering UI elements, e.g. a context menu. -This includes a title, description, tooltip and icon and image URLs. +This includes a title, description, tooltip, icons and image URLs. In situations where a desktop agent connects to multiple app directories or multiple versions of the same app exists in a single app directory, it may be neccessary to specify appId and version to target applications that share the same name. diff --git a/docs/api/ref/Icon.md b/docs/api/ref/Icon.md index 94c4fe569..481326a88 100644 --- a/docs/api/ref/Icon.md +++ b/docs/api/ref/Icon.md @@ -23,12 +23,12 @@ Various properties may be used by the Desktop Agent to decide which icon is the ```js "icons": [ { - "src": "icon/lowres.webp", + "src": "https://app.foo.icon/app_icons/lowres.webp", "size": "48x48", "type": "image/webp" }, { - "src": "icon/hd_hi.svg", + "src": "https://app.foo.icon/app_icons/hd_hi.svg", "size": "72x72" } ] @@ -38,7 +38,7 @@ Various properties may be used by the Desktop Agent to decide which icon is the ### `src` -The url to the icon. +The fully qualified url to the icon. ### `size` From c915be12ecd3c7c05d7cece93d3768d2ae39bca4 Mon Sep 17 00:00:00 2001 From: pgm-vole <> Date: Mon, 8 Feb 2021 17:31:16 +0000 Subject: [PATCH 4/7] improve explanation --- docs/api/ref/Icon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/ref/Icon.md b/docs/api/ref/Icon.md index 481326a88..6166b4220 100644 --- a/docs/api/ref/Icon.md +++ b/docs/api/ref/Icon.md @@ -16,7 +16,7 @@ interface Icon { App Metadata icon's description. -Various properties may be used by the Desktop Agent to decide which icon is the most suitable to be used considering the device DPI, bandwith and format support. +Various properties may be used by the Desktop Agent to decide which icon is the most suitable to be used considering the application chooser UI, device DPI and formats supported by the system. #### Example From be082ad381846f76aff174f9d945007b475e3bfd Mon Sep 17 00:00:00 2001 From: pgm-vole <> Date: Mon, 8 Feb 2021 17:32:23 +0000 Subject: [PATCH 5/7] fixes typo --- src/app-directory/specification/appd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app-directory/specification/appd.yaml b/src/app-directory/specification/appd.yaml index 77789d9e2..c0c68356d 100644 --- a/src/app-directory/specification/appd.yaml +++ b/src/app-directory/specification/appd.yaml @@ -352,10 +352,10 @@ components: description: Icon URL size: type: string - description: Icon dimensions formated as "x" + description: Icon dimension formatted as "x" type: type: string - description: Image media type. If not present the Desktop agent may use the src file extension + description: Image media type. If not present the Desktop Agent may use the src file extension AppImage: description: App Image holder properties: From c8812294a5edb45e305d3ab0cae371c6b177063b Mon Sep 17 00:00:00 2001 From: pgm-vole <> Date: Thu, 22 Apr 2021 20:45:42 +0100 Subject: [PATCH 6/7] update medatada.md --- docs/api/ref/Metadata.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/api/ref/Metadata.md b/docs/api/ref/Metadata.md index d193215b5..10f310ad9 100644 --- a/docs/api/ref/Metadata.md +++ b/docs/api/ref/Metadata.md @@ -31,7 +31,7 @@ interface AppMetadata { title?: string; tooltip?: string; description?: string; - icons?: Array; + icons?: Array; images?: Array; } ``` @@ -47,6 +47,7 @@ In situations where a desktop agent connects to multiple app directories or mult #### See also * [`AppIntent.apps`](AppIntent) +* [`Icon`](Icon) ## `DisplayMetadata` From e73c755ae9d465abef6a9dead84b93f43bfb4f7b Mon Sep 17 00:00:00 2001 From: pgm-vole <> Date: Thu, 22 Apr 2021 20:48:43 +0100 Subject: [PATCH 7/7] fix link --- docs/api/ref/Icon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/ref/Icon.md b/docs/api/ref/Icon.md index 6166b4220..6621aafc1 100644 --- a/docs/api/ref/Icon.md +++ b/docs/api/ref/Icon.md @@ -51,5 +51,5 @@ The media type of the icon. If not provided the Desktop agent may refer to the s #### See also -* [`AppMetadata`](AppMetadata) +* [`AppMetadata`](Metadata#appmetadata)