/** * @Copyright (c) Microsoft Corporation. All rights reserved. * * @file Client side Web Part manifest definition. */ import { IClientSideComponentManifest, ILocalizedString } from './IClientSideComponentManifest'; /** * The client side SharePoint framework identifies a Web Part by its manifest. All Web Parts are expected to have a * manifest. The manifest is a schematized JSON blob that is used in multiple parts of the SharePoint infrastructure * to identify, load and process a Web Part. The schema for this manifest is completely owned and versioned by * Microsoft. There are some required properties in the manifest and some optional properties. Optional properties * need to be provided only if the Web Part needs the specific functionality. An invalid manifest could lead to issues * with Web Part loading and functionality problems. * * @public */ export interface IClientSideWebPartManifest extends IClientSideComponentManifest { /** * Definition: If true, this web part is disabled on Classic Sharepoint pages ? * Usage: Certain web parts may not be required on or apply to Classic Sharepoint pages. This flag helps control * that. If this flag is true, the web part will not appear in the classic page web part gallery. * Required: no * Type: boolean * Example: false */ disabledOnClassicSharepoint?: boolean; /** * Definition: If true, this web part should not be displayed in the modern SharePoint toolbox. * Usage: Use this flag if it is not appropriate to display a web part in the modern toolbox. This property is not * used in Classic SharePoint. By default, all web parts are enabled to be displayed in the toolbox. Such web parts * can be provisioned on pages though API or be added to the page in a pre configured way. * Required: no * Type: boolean * Example: true */ hiddenFromToolbox?: boolean; /** * Definition: If true, this web part supports and has been tested for full bleed experience. * Usage: Use this flag if a web part supports full bleed experience and has been tested as such. In this context, * full bleed is a term used to denote that the web part takes the whole width of the containing page. Full bleed * experiences require special treatment and testing. By default no web parts support full bleed experiences. * Required: no * Type: boolean * Example: true */ supportsFullBleed?: boolean; /** * Definition: A Web Part can have pre-configured properties like the title, description, toolbox group name and Web * Part specific custom properties. And there can be multiple instances of these pre-configured properties. This * helps support scenarios where an organization may want to present multiple pre-configured entries for a Web Part * in the Toolbox. Each entry is expected to configure the Web Part with a different set of pre-configured * properties. A developer may decide to seed some initial values for these properties but an organization admin can * go ahead and customize these properties per the needs of his/her organization. The properties can also be modified * by the author of the page. * Usage: help display a Web Part in the Tooblox, PropertyPane and the initial rendering of the Web Part. * Required: yes * Type: JSON object * Localized: Depends on the property. * Supported values: Array of IClientSideWebPartManifestEntry objects. * Example: * "[{ * title:"Image Web Part", * description: "This Web Part displays an image", * group: "Media", * iconFontName: "image", * properties: { * imageSource: "https://contoso.akamaihd.net/files/mountRainier.jpg", * captionText: "Mount Rainier" * } * }]" */ preconfiguredEntries: IClientSideWebPartManifestEntry[]; } /** * Manifest that is relevant to a Web Part instance. * * @public */ export interface IClientSideWebPartManifestInstance extends IClientSideComponentManifest { } /** * This interface specifies the set of properties that can be pre-configured by a Web Part developer. Each * pre-configured instance of the Web Part will need a copy of these properties. Organization admins and * content authors can modify these properties on a need basis. * * @public */ export interface IClientSideWebPartManifestEntry { /** * Definition: Title of the web part represented as a single a dictionary of locale keys to title values. This * value will be displayed to the user in the toolbox. This title should be used in the Toolbox and other display * areas. The Web Part developer may give an initial title to the web part. The organization admin and page author * will have the ability to change this title as per need. * Usage: display the name of the web part in the toolbox, web part gallery and the page. * Required: yes * Type: Object * Localized: yes * Supported values: a dictionary of locale keys to strings. Should always have a 'default' key. * Example: "My Webpart" * { * "default": "My WebPart" * "en-us": "My WebPart", * "fr-fr": "Ma WebPart", * "zh": "我的 web 部件" * } */ title: ILocalizedString; /** * Definition: Description of the web part represented as a dictionary of locale keys to description values. This * value will be displayed to the user in the toolbox. This description should be used in the Toolbox tooltip and * other display areas. The Web Part developer may give an initial description to the web part. The organization * admin and page author will have the ability to change this description as per need. * Usage: display the description of the web part in the toolbox tooltip, web part gallery and the page. * Required: yes * Type: Object * Localized: yes * Supported values: a dictionary of locale keys to strings. Should always have a 'default' key. * Example: "A tool for displaying neat information." * { * "default": "A tool for displaying neat information.", * "en-us": "A tool for displaying neat information.", * "fr-fr": "Un outil d’affichage des informations soignées.", * "zh": "用於顯示整潔資訊的工具。" * } */ description: ILocalizedString; /** * Definition: The icon for the Web Part, to be displayed in the toolbox, represented as a character name in the * Office 365 icon font file. The icon font is specified here: http://o365icons.cloudapp.net/. If this field has * a value, the '{@link IClientSideWebPartManifestEntry.iconImageUrl}' field will be ignored. * Required: no * Type: string * Localized: no * Supported values: Any character name in the Office 365 Icon Font. * Example: "graph" */ officeFabricIconFontName?: string; /** * Definition: The icon for the web part, to be displayed in the toolbox, represented an image URL. The image at the * URL must be exactly 38x38 px (SPPPLAT VSO#218660 to fix the size of the icon image). * If the '{@link IClientSideWebPartManifestEntry.officeFabricIconFontName}' field does not have a value, * this field must have a value. * Required: no * Type: string * Localized: no * Supported values: Any absolute URL. * Example: "https://contoso.akamaihd.net/files/myWebpartIcon.png" */ iconImageUrl?: string; groupId: string; /** * Definition: This field is used to help decide the Toolbox group for the Web Part in the authoring * experience. In the server rendered page, the Web Part gallery is equivalent of the Toolbox. If no value is * provided, the Web Part will be displayed in the "Custom" group. * Usage: display of the Web Part icon in a specific group in the authoring toolbox. * Required: no * Localized: yes * Supported values: string * Example: { "default": "Media Web Parts" } * * @beta */ group?: ILocalizedString; /** * Definition: Use this field to specify the data version of the pre-configured data provided to the web part. * Note that data version is different from the version field in the manifest. The manifest version * is used to control the versioning of the web part code, while data version is used to control the versioning of * the serialized data of the web part. Refer to dataVersion field of your web part for more information. * Usage: versioning and evolving the serialized data of the web part * Required: no * Type: string representing a semantic version (http://semver.org) * Supported values: MAJOR.MINOR * Example: "1.0" */ dataVersion?: string; /** * Definition: every Web Part is expected to have some custom properties. e.g. an image Web Part may have the image * url and caption text as custom properties, a list Web Part may have the list id and list title as custom * properties, and so on. The Web Part framework is transparent to these properties. It just acts as a conduit to * pass these properties in and out to the Web Parts. The Web Part developer fully controls the schema of these * properties. The Web Part developer should follow versioning rules (@todo: pointer to Web Part versioning document) * to evolve these properties. * * Usage: rendering of the Web Part. * Required: yes * Localized: no * Supported values: any * Example: {"imageSource": "https://contoso.akamaihd.net/files/contosoLogo.jpg", "captionText": "Contoso logo"}" */ properties: TProperties; }