@ichicraft/widgets-widget-base 1.8.5 → 1.8.7

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
@@ -9,6 +9,17 @@ All notable changes to this project will be documented here.
9
9
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10
10
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
+ ## 1.8.7 - 2022-12-13
13
+
14
+ - Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
15
+ - Added new exported `UserRole` type.
16
+
17
+ ## 1.8.6 - 2022-12-08
18
+
19
+ - Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
20
+ - Added `allowedBoardTypes` property to the `definition` object of the `WidgetContext` interface, to inform widget variants of the types of boards it is allowed to be added to.
21
+ - Added new exported `BoardType` type.
22
+
12
23
  ## 1.8.5 - 2022-09-30
13
24
 
14
25
  - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
@@ -19,6 +19,10 @@ export interface WidgetContext {
19
19
  * Optional configuration data that contains user settings of a specific widget instance
20
20
  */
21
21
  data?: string;
22
+ /**
23
+ * The type of board this widget instance is added to.
24
+ */
25
+ boardType?: BoardType;
22
26
  /**
23
27
  * Call this function from within a widget instance to publish a notification to the
24
28
  * notitication box on top of the widget board. It should provide information for this specific
@@ -97,6 +101,10 @@ export interface WidgetContext {
97
101
  * Optional configuration data that contains board-wide settings of a specific widget instance
98
102
  */
99
103
  data?: string;
104
+ /**
105
+ * A list of board types applicable for this widget variant.
106
+ */
107
+ allowedBoardTypes?: BoardType[];
100
108
  };
101
109
  /**
102
110
  * Metadata and functions in the context of a widget's manifest. A widget manifest contains
@@ -183,6 +191,10 @@ export interface WidgetContext {
183
191
  * Provides the date that the user's account was created
184
192
  */
185
193
  userAccountCreated: Date;
194
+ /**
195
+ * Roles of the current user. This may very depending on the active board
196
+ */
197
+ userRoles: UserRole[];
186
198
  /**
187
199
  * Language code of currently used UI rendering language in SharePoint
188
200
  */
@@ -557,3 +569,5 @@ export interface IFrameDialogOptions {
557
569
  */
558
570
  onDismissed?: () => void;
559
571
  }
572
+ export declare type BoardType = 'shared' | 'personal';
573
+ export declare type UserRole = 'administrator' | 'board-owner';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
4
4
  "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",