@ichicraft/widgets-widget-base 1.14.3 → 1.14.5

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.
Files changed (3) hide show
  1. package/README.md +383 -367
  2. package/lib/types/index.d.ts +29 -25
  3. package/package.json +38 -38
package/README.md CHANGED
@@ -1,367 +1,383 @@
1
- This package supports development of widgets built using the Widget Development Kit
2
-
3
- _This package is part of the Widget Development Kit, which is a collection of NPM packages that empower developers to create widgets for Ichicraft Boards._
4
-
5
- # Changelog
6
-
7
- All notable changes to this project will be documented here.
8
-
9
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
-
12
- ## 1.14.3 - 2025-07-04
13
- - Added `justification` string property to widget manifest to describe the reasoning behind the need for certain API permisisons
14
-
15
- ## 1.14.2 - 2025-07-02
16
- - Reverted `@microsoft/sp-http` dependency back to SPFx version `1.18.2` due to postponed upgrade
17
- - Added `isOptional` boolean to widget manifest to allow marking certain API permission requests as optional
18
-
19
- ## 1.14.1 - 2025-06-17
20
- - Reverted module type 'commonjs' for backwards compatibility
21
-
22
- ## 1.14.0 - 2025-05-21
23
- - Version bumped `@microsoft/sp-http` dependency to latest SPFx version `1.21.1`
24
-
25
- ## 1.13.2 - 2025-04-11
26
- - Minor update in documentation of `WebApiPermissionRequest` interface
27
-
28
- ## 1.13.1 - 2025-03-11
29
- - Added new interface `ICSite`, used to represent a SharePoint site object in code
30
-
31
- ## 1.13.0 - 2025-02-17
32
- - Fixed an issue with detecting external users in `UserHelper`
33
- - Changed target JavaScript version to `ES6`
34
-
35
- ## 1.12.0 - 2025-02-11
36
-
37
- - Added `ColorOption` interface.
38
- - Added `WidgetDesignContext` interface.
39
- - Added `design` property of type `WidgetDesignContext` to `WidgetContext` interface, to support UI settings within widgets.
40
- - Deprecated `elementBorderRadius` property which is renamed to `borderRadius` and moved under `design` property in `WidgetContext` interface.
41
-
42
- ## 1.11.6 - 2025-01-30
43
-
44
- - Added `spServiceScope` property to `WidgetContext` interface.
45
- - Added `loadComponentById` function to `WidgetContext` interface.
46
- - Deprecated `definition` property which is replaced by `variant` property in `WidgetContext` interface.
47
- - Deprecated `instance.publishNotification` function in `WidgetContext` interface because feature is no longer available.
48
-
49
- ## 1.11.5 - 2025-01-21
50
-
51
- - Added `defaultColor` property to `WidgetBuddyContext` interface.
52
-
53
- ## 1.11.4 - 2024-11-08
54
-
55
- - Added `driveId` property to `FilePickerFileProps` interface.
56
-
57
- ## 1.11.3 - 2024-11-05
58
-
59
- - Added `fileName` property to `FilePickerFileProps` interface.
60
-
61
- ## 1.11.2 - 2024-10-21
62
-
63
- - Added optional `objectId` property to the `ICPersona` interface.
64
-
65
- ## 1.11.1 - 2024-10-17
66
-
67
- - Made `buddy` property of type `WidgetBuddyContext` optional.
68
-
69
- ## 1.11.0 - 2024-10-17
70
-
71
- - Added `renderBuddy` function to the `BaseWidget` class, to support rendering widgets as a buddy.
72
- - Added `buddy` property of type `WidgetBuddyContext` to the `WidgetContext` interface, to support utility functions specifically for a widget buddy.
73
- - Added `setBadgeProperties` function to the `WidgetBuddyContext` interface, to allow rendering a badge on top of the buddy.
74
-
75
- ## 1.10.8 - 2024-10-15
76
-
77
- - Added `buddybar` to the `BoardType` type, to support widgets that run in the scope of the upcoming buddy bar feature
78
-
79
- ## 1.10.7 - 2024-08-20
80
-
81
- - Replaced `onInit` function with a new asynchronous `init` function in the `BaseWidget` class, to allow waiting until initialization is complete.
82
-
83
- ## 1.10.6 - 2024-08-19
84
-
85
- - Added `userDisplayName` property to the `WidgetContext` interface, to allow using the currently signed-in user's display name in widgets.
86
-
87
- ## 1.10.5 - 2024-08-07
88
-
89
- - Added `onSearch` property to the `CommandBarSearchItem` interface, to allow executing a callback when the user presses enter in the search box.
90
-
91
- ## 1.10.4 - 2024-07-23
92
-
93
- - Added `SearchBar` value to the `CommandBarItemType` enum, to allow rendering a command bar item as a search bar.
94
- - Added `CommandBarSearchItem` interface, to allow passing extra search-related props to a CommandBarItem of type `SearchBar`.
95
- - Added optional `overflowButtonIconName` and `overflowButtonTooltip` properties to the `CommandBarTabOptions` interface, to allow customization of the overflow menu button.
96
- - Added optional `itemCount` property to the `CommandBarTab` interface.
97
- - Added summaries to functions and interfaces related to widget command bar tabs.
98
-
99
- ## 1.10.3 - 2024-07-22
100
-
101
- - Added override in package.json to use version `2.3.7` instead of `2.3.6` of `requirejs` because the latter has vulnerability CVE-2024-38999
102
-
103
- ## 1.10.2 - 2024-07-19
104
-
105
- - Added `registerTabs` function to the `WidgetInstanceContext` interface, to allow rendering of tabs in the widget header.
106
- - Added `setSelectedTab` function to the `WidgetInstanceContext` interface, to allow setting the current selected tab in the widget header.
107
- - Added `CommandBarTab` interface.
108
- - Added `CommandBarTabOptions` interface.
109
-
110
- ## 1.10.1 - 2024-07-08
111
-
112
- - Added `widget-administrator` role to the `UserRole` type.
113
-
114
- ## 1.10.0 - 2024-06-25
115
-
116
- - Added optional `updateDataAccess()` function to the `BaseWidget` class, used to update access to widget-specific data.
117
- - Added `administrators` property to the `WidgetVariantContext` interface.
118
-
119
- ## 1.9.14 - 2024-06-18
120
-
121
- - Change import of `SPFI` type to decrease bundle sizes in widgets.
122
-
123
- ## 1.9.13 - 2024-06-18
124
-
125
- - Added `spHttpClient` property to `WidgetContext` interface, to perform REST calls against SharePoint.
126
- - Added `spHttpClientConfiguration` property to `WidgetContext` interface.
127
-
128
- ## 1.9.12 - 2024-06-17
129
-
130
- - Added `sp` property to `WidgetContext` interface, to allow using a centralized PnPjs version across all widgets.
131
- - Added `siteId` property to `WidgetContext` interface.
132
- - Added `boardsInstanceId` property to `WidgetContext` interface.
133
-
134
- ## 1.9.11 - 2024-06-14
135
-
136
- - Fixed handling of null `ICPersonaType` values in `isCurrentUserInScope` function of `UserHelper` class.
137
-
138
- ## 1.9.10 - 2024-06-04
139
-
140
- - Renamed `CustomCommandBarItemProps` interface to `CommandBarItemProps`.
141
- - Merged `CommandBarIcon`, `CommandBarLink` and `CommandBarItemBase` interfaces into the `CommandBarItemProps` interface, to simplify adding custom command bar items.
142
- - Added `Overflow` type to `CommandBarItemType` enum, to allow rendering an item inside the overflow menu.
143
- - Added `highlighted` property to the `CommandBarItemProps` interface, to allow rendering an item as if it is being hovered.
144
- - Added `cursor` property to the `CommandBarItemProps` interface, to allow a different cursor when hovering over an item.
145
- - Added `disabled` property to the `CommandBarItemProps` interface, to allow rendering an item in a disabled state.
146
-
147
- ## 1.9.9 - 2024-05-14
148
-
149
- - Changed return type of `createDeepLink` function of the WidgetInstanceContext interface from `void` to `string`.
150
-
151
- ## 1.9.8 - 2024-05-13
152
-
153
- - Added `createDeepLink` property to the WidgetInstanceContext interface, to allow creating a deep link URL based on the current board and a widget instance.
154
- - Added `setDeepLinkData` property to the WidgetInstanceContext interface, to allow setting deep link data related to a widget instance in the URL of the current page.
155
- - Added `getDeepLinkData` property to the WidgetInstanceContext interface, to allow getting deep link data related to a widget instance from the URL of the current page.
156
-
157
- ## 1.9.7 - 2024-04-19
158
-
159
- - Added `hideSpHubNav` property to the IFrameDialogOptions interface, to allow hiding the Hub navigation on SharePoint sites.
160
- - Added `hideSpSiteHeader` property to the IFrameDialogOptions interface, to allow hiding the site header on SharePoint sites.
161
- - Added `showHistoryButtons` property to the IFrameDialogOptions interface, to render back and forward buttons, allowing the user to navigate the browser history.
162
- - Added `showOpenInNewWindow` property to the IFrameDialogOptions interface, to render an 'open in new window' button, allowing the user to open the iframe url in a new browser window.
163
-
164
- ## 1.9.6 - 2024-04-19
165
-
166
- - Changed `onRenderHeaderIcon` property of the IFrameDialogOptions interface, to work similarly to the widget render functions.
167
-
168
- ## 1.9.5 - 2024-04-18
169
-
170
- - Added `title` property to the IFrameDialogOptions interface, to allow rendering a title in the dialog header.
171
- - Added `titleUrl` property to the IFrameDialogOptions interface, to allow making the dialog header title clickable.
172
- - Added `onRenderHeaderIcon` property to the IFrameDialogOptions interface, to allow rendering an icon in the dialog header.
173
- - Added `onLoad` property to the IFrameDialogOptions interface, to support executing some code after the iframe finishes loading.
174
-
175
- ## 1.9.4 - 2024-04-11
176
-
177
- - Reintroduced the following types: `AadHttpClient`,`AadHttpClientConfiguration`,`AadHttpClientFactory`,`AadHttpClientResponse`, `AadTokenProvider`, `AadTokenProviderFactory`
178
-
179
- ## 1.9.2 - 2024-03-21
180
-
181
- - Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
182
- - Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
183
- - Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
184
- - Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
185
- - Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
186
-
187
- ## 1.9.1 - 2023-10-20
188
-
189
- - Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
190
- - Added `WidgetVariantContext` interface, to allow typing the `definition` property of the `WidgetContext` interface.
191
- - Added `WidgetManifestContext` interface, to allow typing the `manifest` property of the `WidgetContext` interface.
192
-
193
- ## 1.9.0 - 2023-10-20
194
-
195
- - Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
196
- - Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
197
- - Added new exported `ExportData` type.
198
-
199
- ## 1.8.17 - 2023-10-09
200
-
201
- - Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
202
-
203
- ## 1.8.16 - 2023-09-26
204
-
205
- - Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
206
-
207
- ## 1.8.15 - 2023-09-01
208
-
209
- - Added `thumbnailUrl` property to `WidgetManifestConfig` interface, as a non-translatable substitute of the newly deprecated `preview_small` property from `WidgetImages` interface.
210
- - Removed the deprecated `preview_small` property from `WidgetImages` interface.
211
-
212
- ## 1.8.14 - 2023-09-01
213
-
214
- - Added `iconName` property to `WidgetManifestConfig` interface, to support using an icon to represent a widget, e.g. in the widget library or widget header.
215
- - Removed the deprecated `notificationIcon` property from `WidgetManifestConfig` interface.
216
-
217
- ## 1.8.13 - 2023-06-08
218
-
219
- - Removed the deprecated `resolved` property from `ICPersona` interface
220
-
221
- ## 1.8.12 - 2023-04-04
222
-
223
- - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
224
-
225
- ## 1.8.11 - 2023-04-03
226
-
227
- - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
228
-
229
- ## 1.8.10 - 2023-03-30
230
-
231
- - Changed `openFilePicker` function to accept `options`, to support configuration of picker behavior
232
-
233
- ## 1.8.9 - 2023-03-06
234
-
235
- - Added `registerCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support multiple custom buttons in the widget header.
236
- - Added `unregisterCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support removing all custom buttons in the widget header.
237
- - Added optional `id` property to exported `CustomCommandBarItemProps` type, to support removing a custom command bar item by id.
238
- - Added optional `pinned` property to exported `CustomCommandBarItemProps` type, to support forcing the widget header to always be visible.
239
- - Added optional `showNotificationBadge` property to exported `CustomCommandBarItemProps` type, to support showing a red notification badge over the custom command bar item.
240
- - Added optional `order` property to exported `CustomCommandBarItemProps` type, to support changing the order of custom command bar items.
241
- - Changed `unregisterCustomCommandBarItem` function of the `instance` object of the `WidgetContext` interface, to support removing a custom command bar item by id.
242
-
243
- ## 1.8.8 - 2023-02-16
244
-
245
- - Removed all SharePoint and Teams dependencies.
246
-
247
- ## 1.8.7 - 2022-12-13
248
-
249
- - Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
250
- - Added new exported `UserRole` type.
251
-
252
- ## 1.8.6 - 2022-12-08
253
-
254
- - Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
255
- - 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.
256
- - Added new exported `BoardType` type.
257
-
258
- ## 1.8.5 - 2022-09-30
259
-
260
- - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
261
- - Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
262
- - Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
263
- - Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
264
-
265
- ## 1.8.4 - 2022-09-05
266
-
267
- - Added `openIFrameDialog()` function to the `WidgetContext` interface. This has the same functionality as the `openUrlInDialog()` function of the `instance` object, but adds more control over the dimensions of the dialog. The function `openUrlInDialog()` is now deprecated.
268
-
269
- ## 1.8.3 - 2022-08-16
270
-
271
- - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
272
-
273
- ## 1.8.2 - 2022-07-06
274
-
275
- - Added `subtitle` property to the `WidgetResource` interface.
276
-
277
- ## 1.8.1 - 2022-06-17
278
-
279
- - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
280
- - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
281
-
282
- ## 1.7.11 - 2022-03-23
283
-
284
- - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
285
-
286
- ## 1.7.9 - 2022-01-20
287
-
288
- - Added `userAccountCreated` date/time to the `WidgetContext` interface.
289
-
290
- ## 1.7.8 - 2022-01-18
291
-
292
- ### Changed
293
-
294
- - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
295
-
296
- ## 1.7.7 - 2022-01-14
297
-
298
- ### Changed
299
-
300
- - Added `tenantId` property to the `WidgetContext` interface.
301
-
302
- ## 1.7.6 - 2021-11-04
303
-
304
- ### Changed
305
-
306
- - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
307
-
308
- ## 1.7.5 - 2021-10-26
309
-
310
- ### Changed
311
-
312
- - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
313
-
314
- ## 1.7.4 - 2021-10-20
315
-
316
- ### Changed
317
-
318
- - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
319
-
320
- ## 1.7.3 - 2021-10-04
321
-
322
- ### Changed
323
-
324
- - Added `manifestVersion` property to the `WidgetManifestConfig` interface to support multiple versions of the manifest. Current version is 2 which introduced this and the `externals` property.
325
- - Added `externals` property to the `WidgetManifestConfig` interface to support libraries that can be loaded separately from the widget bundle. This reduces widget bundle size and improves overal performance of Ichicraft Boards.
326
-
327
- ## 1.6.1 - 2021-02-18
328
-
329
- ### Changed
330
-
331
- - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
332
-
333
- ## 1.5.0 - 2021-02-16
334
-
335
- ### Changed
336
-
337
- - Added `teamsSdk` property to the `WidgetContext` interface to allow interaction with Teams in case widget board is running in Teams client. Will be `undefined` if running in SharePoint.
338
-
339
- ## 1.4.0 - 2021-01-25
340
-
341
- ### Changed
342
-
343
- - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
344
-
345
- ## 1.3.0 - 2021-01-15
346
-
347
- ### Changed
348
-
349
- - `registerCustomCommandBarItem()` is added to the `WidgetContext` interface as a function to call from within a widget instance to render an additional command bar item in the widget header.
350
- - `unregisterCustomCommandBarItem()` is added to the `WidgetContext` interface as a function to call from within a widget instance to remove a previously added command bar item from the widget header.
351
-
352
- ## 1.2.0 - 2021-01-15
353
-
354
- ### Changed
355
-
356
- - `loadScript()` is added to the `WidgetContext` interface as a function to call from within a widget in case an external script needs to be loaded. This allows the widget board to load external javascript.
357
-
358
- ## 1.1.0 - 2021-01-11
359
-
360
- ### Changed
361
-
362
- - `handleFatalError()` is added to the `WidgetContext` interface as a function to call from within a widget in case of an unhandled/unresolvable error. This allows the widget board to handle this situation gracefully.
363
- - **deps:** removed dependency ajv
364
-
365
- ## <= 1.0.5 - 2020-12-07
366
-
367
- No changelog was maintained for the earlier versions.
1
+ This package supports development of widgets built using the Widget Development Kit
2
+
3
+ _This package is part of the Widget Development Kit, which is a collection of NPM packages that empower developers to create widgets for Ichicraft Boards._
4
+
5
+ # Changelog
6
+
7
+ All notable changes to this project will be documented here.
8
+
9
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
+
12
+ ## 1.14.5 - 2025-08-07
13
+
14
+ - Added `imageUrl` property to the `CommandBarTab` interface, to support displaying images in widget header tabs.
15
+
16
+ ## 1.14.4 - 2025-08-01
17
+
18
+ - Added `releaseType` property to the `WidgetManifestConfig` interface, to indicate the current stage of the release lifecycle a widget is in.
19
+ - Added `registerOnBuddyClick` property to the `WidgetBuddyContext` interface, to allow overriding default onClick behavior when clicking on a buddy (by default, it opens the widget in a Callout).
20
+
21
+ ## 1.14.3 - 2025-07-04
22
+
23
+ - Added `justification` string property to widget manifest to describe the reasoning behind the need for certain API permisisons
24
+
25
+ ## 1.14.2 - 2025-07-02
26
+
27
+ - Reverted `@microsoft/sp-http` dependency back to SPFx version `1.18.2` due to postponed upgrade
28
+ - Added `isOptional` boolean to widget manifest to allow marking certain API permission requests as optional
29
+
30
+ ## 1.14.1 - 2025-06-17
31
+
32
+ - Reverted module type 'commonjs' for backwards compatibility
33
+
34
+ ## 1.14.0 - 2025-05-21
35
+
36
+ - Version bumped `@microsoft/sp-http` dependency to latest SPFx version `1.21.1`
37
+
38
+ ## 1.13.2 - 2025-04-11
39
+
40
+ - Minor update in documentation of `WebApiPermissionRequest` interface
41
+
42
+ ## 1.13.1 - 2025-03-11
43
+
44
+ - Added new interface `ICSite`, used to represent a SharePoint site object in code
45
+
46
+ ## 1.13.0 - 2025-02-17
47
+
48
+ - Fixed an issue with detecting external users in `UserHelper`
49
+ - Changed target JavaScript version to `ES6`
50
+
51
+ ## 1.12.0 - 2025-02-11
52
+
53
+ - Added `ColorOption` interface.
54
+ - Added `WidgetDesignContext` interface.
55
+ - Added `design` property of type `WidgetDesignContext` to `WidgetContext` interface, to support UI settings within widgets.
56
+ - Deprecated `elementBorderRadius` property which is renamed to `borderRadius` and moved under `design` property in `WidgetContext` interface.
57
+
58
+ ## 1.11.6 - 2025-01-30
59
+
60
+ - Added `spServiceScope` property to `WidgetContext` interface.
61
+ - Added `loadComponentById` function to `WidgetContext` interface.
62
+ - Deprecated `definition` property which is replaced by `variant` property in `WidgetContext` interface.
63
+ - Deprecated `instance.publishNotification` function in `WidgetContext` interface because feature is no longer available.
64
+
65
+ ## 1.11.5 - 2025-01-21
66
+
67
+ - Added `defaultColor` property to `WidgetBuddyContext` interface.
68
+
69
+ ## 1.11.4 - 2024-11-08
70
+
71
+ - Added `driveId` property to `FilePickerFileProps` interface.
72
+
73
+ ## 1.11.3 - 2024-11-05
74
+
75
+ - Added `fileName` property to `FilePickerFileProps` interface.
76
+
77
+ ## 1.11.2 - 2024-10-21
78
+
79
+ - Added optional `objectId` property to the `ICPersona` interface.
80
+
81
+ ## 1.11.1 - 2024-10-17
82
+
83
+ - Made `buddy` property of type `WidgetBuddyContext` optional.
84
+
85
+ ## 1.11.0 - 2024-10-17
86
+
87
+ - Added `renderBuddy` function to the `BaseWidget` class, to support rendering widgets as a buddy.
88
+ - Added `buddy` property of type `WidgetBuddyContext` to the `WidgetContext` interface, to support utility functions specifically for a widget buddy.
89
+ - Added `setBadgeProperties` function to the `WidgetBuddyContext` interface, to allow rendering a badge on top of the buddy.
90
+
91
+ ## 1.10.8 - 2024-10-15
92
+
93
+ - Added `buddybar` to the `BoardType` type, to support widgets that run in the scope of the upcoming buddy bar feature
94
+
95
+ ## 1.10.7 - 2024-08-20
96
+
97
+ - Replaced `onInit` function with a new asynchronous `init` function in the `BaseWidget` class, to allow waiting until initialization is complete.
98
+
99
+ ## 1.10.6 - 2024-08-19
100
+
101
+ - Added `userDisplayName` property to the `WidgetContext` interface, to allow using the currently signed-in user's display name in widgets.
102
+
103
+ ## 1.10.5 - 2024-08-07
104
+
105
+ - Added `onSearch` property to the `CommandBarSearchItem` interface, to allow executing a callback when the user presses enter in the search box.
106
+
107
+ ## 1.10.4 - 2024-07-23
108
+
109
+ - Added `SearchBar` value to the `CommandBarItemType` enum, to allow rendering a command bar item as a search bar.
110
+ - Added `CommandBarSearchItem` interface, to allow passing extra search-related props to a CommandBarItem of type `SearchBar`.
111
+ - Added optional `overflowButtonIconName` and `overflowButtonTooltip` properties to the `CommandBarTabOptions` interface, to allow customization of the overflow menu button.
112
+ - Added optional `itemCount` property to the `CommandBarTab` interface.
113
+ - Added summaries to functions and interfaces related to widget command bar tabs.
114
+
115
+ ## 1.10.3 - 2024-07-22
116
+
117
+ - Added override in package.json to use version `2.3.7` instead of `2.3.6` of `requirejs` because the latter has vulnerability CVE-2024-38999
118
+
119
+ ## 1.10.2 - 2024-07-19
120
+
121
+ - Added `registerTabs` function to the `WidgetInstanceContext` interface, to allow rendering of tabs in the widget header.
122
+ - Added `setSelectedTab` function to the `WidgetInstanceContext` interface, to allow setting the current selected tab in the widget header.
123
+ - Added `CommandBarTab` interface.
124
+ - Added `CommandBarTabOptions` interface.
125
+
126
+ ## 1.10.1 - 2024-07-08
127
+
128
+ - Added `widget-administrator` role to the `UserRole` type.
129
+
130
+ ## 1.10.0 - 2024-06-25
131
+
132
+ - Added optional `updateDataAccess()` function to the `BaseWidget` class, used to update access to widget-specific data.
133
+ - Added `administrators` property to the `WidgetVariantContext` interface.
134
+
135
+ ## 1.9.14 - 2024-06-18
136
+
137
+ - Change import of `SPFI` type to decrease bundle sizes in widgets.
138
+
139
+ ## 1.9.13 - 2024-06-18
140
+
141
+ - Added `spHttpClient` property to `WidgetContext` interface, to perform REST calls against SharePoint.
142
+ - Added `spHttpClientConfiguration` property to `WidgetContext` interface.
143
+
144
+ ## 1.9.12 - 2024-06-17
145
+
146
+ - Added `sp` property to `WidgetContext` interface, to allow using a centralized PnPjs version across all widgets.
147
+ - Added `siteId` property to `WidgetContext` interface.
148
+ - Added `boardsInstanceId` property to `WidgetContext` interface.
149
+
150
+ ## 1.9.11 - 2024-06-14
151
+
152
+ - Fixed handling of null `ICPersonaType` values in `isCurrentUserInScope` function of `UserHelper` class.
153
+
154
+ ## 1.9.10 - 2024-06-04
155
+
156
+ - Renamed `CustomCommandBarItemProps` interface to `CommandBarItemProps`.
157
+ - Merged `CommandBarIcon`, `CommandBarLink` and `CommandBarItemBase` interfaces into the `CommandBarItemProps` interface, to simplify adding custom command bar items.
158
+ - Added `Overflow` type to `CommandBarItemType` enum, to allow rendering an item inside the overflow menu.
159
+ - Added `highlighted` property to the `CommandBarItemProps` interface, to allow rendering an item as if it is being hovered.
160
+ - Added `cursor` property to the `CommandBarItemProps` interface, to allow a different cursor when hovering over an item.
161
+ - Added `disabled` property to the `CommandBarItemProps` interface, to allow rendering an item in a disabled state.
162
+
163
+ ## 1.9.9 - 2024-05-14
164
+
165
+ - Changed return type of `createDeepLink` function of the WidgetInstanceContext interface from `void` to `string`.
166
+
167
+ ## 1.9.8 - 2024-05-13
168
+
169
+ - Added `createDeepLink` property to the WidgetInstanceContext interface, to allow creating a deep link URL based on the current board and a widget instance.
170
+ - Added `setDeepLinkData` property to the WidgetInstanceContext interface, to allow setting deep link data related to a widget instance in the URL of the current page.
171
+ - Added `getDeepLinkData` property to the WidgetInstanceContext interface, to allow getting deep link data related to a widget instance from the URL of the current page.
172
+
173
+ ## 1.9.7 - 2024-04-19
174
+
175
+ - Added `hideSpHubNav` property to the IFrameDialogOptions interface, to allow hiding the Hub navigation on SharePoint sites.
176
+ - Added `hideSpSiteHeader` property to the IFrameDialogOptions interface, to allow hiding the site header on SharePoint sites.
177
+ - Added `showHistoryButtons` property to the IFrameDialogOptions interface, to render back and forward buttons, allowing the user to navigate the browser history.
178
+ - Added `showOpenInNewWindow` property to the IFrameDialogOptions interface, to render an 'open in new window' button, allowing the user to open the iframe url in a new browser window.
179
+
180
+ ## 1.9.6 - 2024-04-19
181
+
182
+ - Changed `onRenderHeaderIcon` property of the IFrameDialogOptions interface, to work similarly to the widget render functions.
183
+
184
+ ## 1.9.5 - 2024-04-18
185
+
186
+ - Added `title` property to the IFrameDialogOptions interface, to allow rendering a title in the dialog header.
187
+ - Added `titleUrl` property to the IFrameDialogOptions interface, to allow making the dialog header title clickable.
188
+ - Added `onRenderHeaderIcon` property to the IFrameDialogOptions interface, to allow rendering an icon in the dialog header.
189
+ - Added `onLoad` property to the IFrameDialogOptions interface, to support executing some code after the iframe finishes loading.
190
+
191
+ ## 1.9.4 - 2024-04-11
192
+
193
+ - Reintroduced the following types: `AadHttpClient`,`AadHttpClientConfiguration`,`AadHttpClientFactory`,`AadHttpClientResponse`, `AadTokenProvider`, `AadTokenProviderFactory`
194
+
195
+ ## 1.9.2 - 2024-03-21
196
+
197
+ - Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
198
+ - Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
199
+ - Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
200
+ - Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
201
+ - Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
202
+
203
+ ## 1.9.1 - 2023-10-20
204
+
205
+ - Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
206
+ - Added `WidgetVariantContext` interface, to allow typing the `definition` property of the `WidgetContext` interface.
207
+ - Added `WidgetManifestContext` interface, to allow typing the `manifest` property of the `WidgetContext` interface.
208
+
209
+ ## 1.9.0 - 2023-10-20
210
+
211
+ - Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
212
+ - Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
213
+ - Added new exported `ExportData` type.
214
+
215
+ ## 1.8.17 - 2023-10-09
216
+
217
+ - Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
218
+
219
+ ## 1.8.16 - 2023-09-26
220
+
221
+ - Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
222
+
223
+ ## 1.8.15 - 2023-09-01
224
+
225
+ - Added `thumbnailUrl` property to `WidgetManifestConfig` interface, as a non-translatable substitute of the newly deprecated `preview_small` property from `WidgetImages` interface.
226
+ - Removed the deprecated `preview_small` property from `WidgetImages` interface.
227
+
228
+ ## 1.8.14 - 2023-09-01
229
+
230
+ - Added `iconName` property to `WidgetManifestConfig` interface, to support using an icon to represent a widget, e.g. in the widget library or widget header.
231
+ - Removed the deprecated `notificationIcon` property from `WidgetManifestConfig` interface.
232
+
233
+ ## 1.8.13 - 2023-06-08
234
+
235
+ - Removed the deprecated `resolved` property from `ICPersona` interface
236
+
237
+ ## 1.8.12 - 2023-04-04
238
+
239
+ - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
240
+
241
+ ## 1.8.11 - 2023-04-03
242
+
243
+ - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
244
+
245
+ ## 1.8.10 - 2023-03-30
246
+
247
+ - Changed `openFilePicker` function to accept `options`, to support configuration of picker behavior
248
+
249
+ ## 1.8.9 - 2023-03-06
250
+
251
+ - Added `registerCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support multiple custom buttons in the widget header.
252
+ - Added `unregisterCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support removing all custom buttons in the widget header.
253
+ - Added optional `id` property to exported `CustomCommandBarItemProps` type, to support removing a custom command bar item by id.
254
+ - Added optional `pinned` property to exported `CustomCommandBarItemProps` type, to support forcing the widget header to always be visible.
255
+ - Added optional `showNotificationBadge` property to exported `CustomCommandBarItemProps` type, to support showing a red notification badge over the custom command bar item.
256
+ - Added optional `order` property to exported `CustomCommandBarItemProps` type, to support changing the order of custom command bar items.
257
+ - Changed `unregisterCustomCommandBarItem` function of the `instance` object of the `WidgetContext` interface, to support removing a custom command bar item by id.
258
+
259
+ ## 1.8.8 - 2023-02-16
260
+
261
+ - Removed all SharePoint and Teams dependencies.
262
+
263
+ ## 1.8.7 - 2022-12-13
264
+
265
+ - Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
266
+ - Added new exported `UserRole` type.
267
+
268
+ ## 1.8.6 - 2022-12-08
269
+
270
+ - Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
271
+ - 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.
272
+ - Added new exported `BoardType` type.
273
+
274
+ ## 1.8.5 - 2022-09-30
275
+
276
+ - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
277
+ - Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
278
+ - Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
279
+ - Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
280
+
281
+ ## 1.8.4 - 2022-09-05
282
+
283
+ - Added `openIFrameDialog()` function to the `WidgetContext` interface. This has the same functionality as the `openUrlInDialog()` function of the `instance` object, but adds more control over the dimensions of the dialog. The function `openUrlInDialog()` is now deprecated.
284
+
285
+ ## 1.8.3 - 2022-08-16
286
+
287
+ - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
288
+
289
+ ## 1.8.2 - 2022-07-06
290
+
291
+ - Added `subtitle` property to the `WidgetResource` interface.
292
+
293
+ ## 1.8.1 - 2022-06-17
294
+
295
+ - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
296
+ - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
297
+
298
+ ## 1.7.11 - 2022-03-23
299
+
300
+ - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
301
+
302
+ ## 1.7.9 - 2022-01-20
303
+
304
+ - Added `userAccountCreated` date/time to the `WidgetContext` interface.
305
+
306
+ ## 1.7.8 - 2022-01-18
307
+
308
+ ### Changed
309
+
310
+ - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
311
+
312
+ ## 1.7.7 - 2022-01-14
313
+
314
+ ### Changed
315
+
316
+ - Added `tenantId` property to the `WidgetContext` interface.
317
+
318
+ ## 1.7.6 - 2021-11-04
319
+
320
+ ### Changed
321
+
322
+ - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
323
+
324
+ ## 1.7.5 - 2021-10-26
325
+
326
+ ### Changed
327
+
328
+ - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
329
+
330
+ ## 1.7.4 - 2021-10-20
331
+
332
+ ### Changed
333
+
334
+ - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
335
+
336
+ ## 1.7.3 - 2021-10-04
337
+
338
+ ### Changed
339
+
340
+ - Added `manifestVersion` property to the `WidgetManifestConfig` interface to support multiple versions of the manifest. Current version is 2 which introduced this and the `externals` property.
341
+ - Added `externals` property to the `WidgetManifestConfig` interface to support libraries that can be loaded separately from the widget bundle. This reduces widget bundle size and improves overal performance of Ichicraft Boards.
342
+
343
+ ## 1.6.1 - 2021-02-18
344
+
345
+ ### Changed
346
+
347
+ - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
348
+
349
+ ## 1.5.0 - 2021-02-16
350
+
351
+ ### Changed
352
+
353
+ - Added `teamsSdk` property to the `WidgetContext` interface to allow interaction with Teams in case widget board is running in Teams client. Will be `undefined` if running in SharePoint.
354
+
355
+ ## 1.4.0 - 2021-01-25
356
+
357
+ ### Changed
358
+
359
+ - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
360
+
361
+ ## 1.3.0 - 2021-01-15
362
+
363
+ ### Changed
364
+
365
+ - `registerCustomCommandBarItem()` is added to the `WidgetContext` interface as a function to call from within a widget instance to render an additional command bar item in the widget header.
366
+ - `unregisterCustomCommandBarItem()` is added to the `WidgetContext` interface as a function to call from within a widget instance to remove a previously added command bar item from the widget header.
367
+
368
+ ## 1.2.0 - 2021-01-15
369
+
370
+ ### Changed
371
+
372
+ - `loadScript()` is added to the `WidgetContext` interface as a function to call from within a widget in case an external script needs to be loaded. This allows the widget board to load external javascript.
373
+
374
+ ## 1.1.0 - 2021-01-11
375
+
376
+ ### Changed
377
+
378
+ - `handleFatalError()` is added to the `WidgetContext` interface as a function to call from within a widget in case of an unhandled/unresolvable error. This allows the widget board to handle this situation gracefully.
379
+ - **deps:** removed dependency ajv
380
+
381
+ ## <= 1.0.5 - 2020-12-07
382
+
383
+ No changelog was maintained for the earlier versions.
@@ -382,6 +382,10 @@ export interface WidgetBuddyContext {
382
382
  * This will only override the provided properties.
383
383
  */
384
384
  updateBadgeProperties: (props: Partial<BadgeProperties>) => void;
385
+ /**
386
+ * Overrides the onClick function that triggers when clicking on a buddy in the Buddy Bar.
387
+ */
388
+ registerOnBuddyClick: (onClick: () => void) => void;
385
389
  }
386
390
  /**
387
391
  * Widget variant context providing metadata and functionality offered by the widget board. A widget variant is
@@ -488,44 +492,38 @@ export interface WidgetManifestConfig {
488
492
  * Version of the widget manifest schema. The value of this field
489
493
  * is controlled by Ichicraft. The purpose of this field is to help
490
494
  * manage upgrades of the widget manifest schema.
491
- * The current version is version 2, introducing externals + manifestVersion
495
+ * The current version is version `2`, introducing externals + manifestVersion
492
496
  * properties
493
497
  */
494
498
  manifestVersion: number;
495
- /**
496
- * Unique id to identify the widget
497
- */
499
+ /** Unique id to identify the widget */
498
500
  id: string;
499
- /**
500
- * Internal name for the widget, used internally by Ichicraft
501
- */
501
+ /** Internal name for the widget, used internally by Ichicraft */
502
502
  name: string;
503
+ /** Version should contain the semver of this widget. For future use. */
504
+ version: string;
503
505
  /**
504
- * Version should contain the semver of this widget. For future use.
506
+ * The current stage of the software release lifecycle this widget is in.
507
+ * @remark For Ichicraft Boards administrators, anything other than the default will be displayed in the widget library.
508
+ * @default "release"
505
509
  */
506
- version: string;
510
+ releaseType?: ReleaseType;
507
511
  /**
508
- * The minimum number of rows this widget can inhabit in the widget board.
509
- * By default, a widget always takes up 2 rows (and 1 column),
510
- * If you want the widget to be able to shrink to 1 row, specify 1, otherwise, leave this
511
- * property empty.
512
- * _REMARK_: A value higher than 2 is considered invalid and will be ignored.
512
+ * The minimum number of rows this widget must inhabit on a board.
513
+ * @remark The value should be either `1` or `2`. Any other value is considered invalid and will be ignored.
514
+ * @default 2
513
515
  */
514
516
  minRows: number;
515
517
  /**
516
- * The maximum number of rows this widget can inhabit in the widget board.
517
- * By default, a widget always takes up 2 rows (and 1 column).
518
- * Leave this empty and the maxRows will be defaulted to 2.
519
- * Specify Inifinity to allow spanning any number of rows.
520
- * _REMARK_: A value lower than 2 is considered invalid and will be ignored.
518
+ * The maximum number of rows this widget can inhabit on a board.
519
+ * @remark The value should be `2` or higher. Specify `Infinity` to allow spanning any number of rows. Any other value is considered invalid and will be ignored.
520
+ * @default 2
521
521
  */
522
522
  maxRows: number;
523
523
  /**
524
- * The maximum number of columns this widget can inhabit in the widget board.
525
- * By default, a widget always takes up 1 column (and 2 rows).
526
- * Leave this empty and the maxCols will be defaulted to 1.
527
- * Specify Inifinity to allow spanning any number of columns.
528
- * _REMARK_ A value lower than 1 is considered invalid and will be ignored.
524
+ * The maximum number of columns this widget can inhabit on a board.
525
+ * @remark The value should be `1` or higher. Specify `Infinity` to allow spanning any number of columns. Any other value is considered invalid and will be ignored.
526
+ * @default 1
529
527
  */
530
528
  maxCols: number;
531
529
  /**
@@ -537,7 +535,7 @@ export interface WidgetManifestConfig {
537
535
  */
538
536
  isConfigurableByAdmin: boolean;
539
537
  /**
540
- * Internally used by Ichicraft
538
+ * Internally used by Ichicraft.
541
539
  */
542
540
  widgetBoardCompatibilityVersion?: number;
543
541
  /**
@@ -802,6 +800,10 @@ export interface CommandBarTab {
802
800
  * Optional icon to display before the label.
803
801
  */
804
802
  iconName?: string;
803
+ /**
804
+ * Optional image to display before the label.
805
+ */
806
+ imageUrl?: string;
805
807
  /**
806
808
  * Optional tooltip to display when hovering over the tab.
807
809
  */
@@ -923,6 +925,8 @@ export interface FilePickerFileProps {
923
925
  }
924
926
  export type BoardType = 'shared' | 'personal' | 'buddybar';
925
927
  export type UserRole = 'administrator' | 'board-owner' | 'widget-administrator';
928
+ /** Defines the different types of releases an application can have, e.g. alpha, beta, release. */
929
+ export type ReleaseType = 'alpha' | 'beta' | 'release';
926
930
  export interface ExportData {
927
931
  data: object[];
928
932
  }
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.14.3",
4
- "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "scripts": {
8
- "build": "tsc",
9
- "prepare": "tsc"
10
- },
11
- "keywords": [
12
- "ichicraft",
13
- "widget",
14
- "widgets"
15
- ],
16
- "author": "Ichicraft",
17
- "license": "ISC",
18
- "files": [
19
- "lib/**/*"
20
- ],
21
- "overrides": {
22
- "requirejs": "2.3.7"
23
- },
24
- "dependencies": {
25
- "@microsoft/sp-http": "1.18.2",
26
- "@pnp/sp": "4.0.1"
27
- },
28
- "devDependencies": {
29
- "@ianvs/prettier-plugin-sort-imports": "4.4.1",
30
- "eslint": "8.57.0",
31
- "eslint-config-prettier": "9.1.0",
32
- "eslint-plugin-prettier": "5.2.1",
33
- "eslint-plugin-react": "7.35.2",
34
- "eslint-plugin-react-hooks": "4.6.2",
35
- "prettier": "3.3.3",
36
- "typescript": "~5.3.3"
37
- }
38
- }
1
+ {
2
+ "name": "@ichicraft/widgets-widget-base",
3
+ "version": "1.14.5",
4
+ "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "prepare": "tsc"
10
+ },
11
+ "keywords": [
12
+ "ichicraft",
13
+ "widget",
14
+ "widgets"
15
+ ],
16
+ "author": "Ichicraft",
17
+ "license": "ISC",
18
+ "files": [
19
+ "lib/**/*"
20
+ ],
21
+ "overrides": {
22
+ "requirejs": "2.3.7"
23
+ },
24
+ "dependencies": {
25
+ "@microsoft/sp-http": "1.18.2",
26
+ "@pnp/sp": "4.0.1"
27
+ },
28
+ "devDependencies": {
29
+ "@ianvs/prettier-plugin-sort-imports": "4.4.1",
30
+ "eslint": "8.57.0",
31
+ "eslint-config-prettier": "9.1.0",
32
+ "eslint-plugin-prettier": "5.2.1",
33
+ "eslint-plugin-react": "7.35.2",
34
+ "eslint-plugin-react-hooks": "4.6.2",
35
+ "prettier": "3.3.3",
36
+ "typescript": "~5.3.3"
37
+ }
38
+ }