@ichicraft/widgets-widget-base 1.11.6 → 1.12.0

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
@@ -1,337 +1,344 @@
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.11.6 - 2025-01-30
13
-
14
- - Added `spServiceScope` property to `WidgetContext` interface.
15
- - Added `loadComponentById` function to `WidgetContext` interface.
16
- - Deprecated `definition` property which is replaced by `variant` property in `WidgetContext` interface.
17
- - Deprecated `instance.publishNotification` function in `WidgetContext` interface because feature is no longer available.
18
-
19
- ## 1.11.5 - 2025-01-21
20
-
21
- - Added `defaultColor` property to `WidgetBuddyContext` interface.
22
-
23
- ## 1.11.4 - 2024-11-08
24
-
25
- - Added `driveId` property to `FilePickerFileProps` interface.
26
-
27
- ## 1.11.3 - 2024-11-05
28
-
29
- - Added `fileName` property to `FilePickerFileProps` interface.
30
-
31
- ## 1.11.2 - 2024-10-21
32
-
33
- - Added optional `objectId` property to the `ICPersona` interface.
34
-
35
- ## 1.11.1 - 2024-10-17
36
-
37
- - Made `buddy` property of type `WidgetBuddyContext` optional.
38
-
39
- ## 1.11.0 - 2024-10-17
40
-
41
- - Added `renderBuddy` function to the `BaseWidget` class, to support rendering widgets as a buddy.
42
- - Added `buddy` property of type `WidgetBuddyContext` to the `WidgetContext` interface, to support utility functions specifically for a widget buddy.
43
- - Added `setBadgeProperties` function to the `WidgetBuddyContext` interface, to allow rendering a badge on top of the buddy.
44
-
45
- ## 1.10.8 - 2024-10-15
46
-
47
- - Added `buddybar` to the `BoardType` type, to support widgets that run in the scope of the upcoming buddy bar feature
48
-
49
- ## 1.10.7 - 2024-08-20
50
-
51
- - Replaced `onInit` function with a new asynchronous `init` function in the `BaseWidget` class, to allow waiting until initialization is complete.
52
-
53
- ## 1.10.6 - 2024-08-19
54
-
55
- - Added `userDisplayName` property to the `WidgetContext` interface, to allow using the currently signed-in user's display name in widgets.
56
-
57
- ## 1.10.5 - 2024-08-07
58
-
59
- - Added `onSearch` property to the `CommandBarSearchItem` interface, to allow executing a callback when the user presses enter in the search box.
60
-
61
- ## 1.10.4 - 2024-07-23
62
-
63
- - Added `SearchBar` value to the `CommandBarItemType` enum, to allow rendering a command bar item as a search bar.
64
- - Added `CommandBarSearchItem` interface, to allow passing extra search-related props to a CommandBarItem of type `SearchBar`.
65
- - Added optional `overflowButtonIconName` and `overflowButtonTooltip` properties to the `CommandBarTabOptions` interface, to allow customization of the overflow menu button.
66
- - Added optional `itemCount` property to the `CommandBarTab` interface.
67
- - Added summaries to functions and interfaces related to widget command bar tabs.
68
-
69
- ## 1.10.3 - 2024-07-22
70
-
71
- - 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
72
-
73
- ## 1.10.2 - 2024-07-19
74
-
75
- - Added `registerTabs` function to the `WidgetInstanceContext` interface, to allow rendering of tabs in the widget header.
76
- - Added `setSelectedTab` function to the `WidgetInstanceContext` interface, to allow setting the current selected tab in the widget header.
77
- - Added `CommandBarTab` interface.
78
- - Added `CommandBarTabOptions` interface.
79
-
80
- ## 1.10.1 - 2024-07-08
81
-
82
- - Added `widget-administrator` role to the `UserRole` type.
83
-
84
- ## 1.10.0 - 2024-06-25
85
-
86
- - Added optional `updateDataAccess()` function to the `BaseWidget` class, used to update access to widget-specific data.
87
- - Added `administrators` property to the `WidgetVariantContext` interface.
88
-
89
- ## 1.9.14 - 2024-06-18
90
-
91
- - Change import of `SPFI` type to decrease bundle sizes in widgets.
92
-
93
- ## 1.9.13 - 2024-06-18
94
-
95
- - Added `spHttpClient` property to `WidgetContext` interface, to perform REST calls against SharePoint.
96
- - Added `spHttpClientConfiguration` property to `WidgetContext` interface.
97
-
98
- ## 1.9.12 - 2024-06-17
99
-
100
- - Added `sp` property to `WidgetContext` interface, to allow using a centralized PnPjs version across all widgets.
101
- - Added `siteId` property to `WidgetContext` interface.
102
- - Added `boardsInstanceId` property to `WidgetContext` interface.
103
-
104
- ## 1.9.11 - 2024-06-14
105
-
106
- - Fixed handling of null `ICPersonaType` values in `isCurrentUserInScope` function of `UserHelper` class.
107
-
108
- ## 1.9.10 - 2024-06-04
109
-
110
- - Renamed `CustomCommandBarItemProps` interface to `CommandBarItemProps`.
111
- - Merged `CommandBarIcon`, `CommandBarLink` and `CommandBarItemBase` interfaces into the `CommandBarItemProps` interface, to simplify adding custom command bar items.
112
- - Added `Overflow` type to `CommandBarItemType` enum, to allow rendering an item inside the overflow menu.
113
- - Added `highlighted` property to the `CommandBarItemProps` interface, to allow rendering an item as if it is being hovered.
114
- - Added `cursor` property to the `CommandBarItemProps` interface, to allow a different cursor when hovering over an item.
115
- - Added `disabled` property to the `CommandBarItemProps` interface, to allow rendering an item in a disabled state.
116
-
117
- ## 1.9.9 - 2024-05-14
118
-
119
- - Changed return type of `createDeepLink` function of the WidgetInstanceContext interface from `void` to `string`.
120
-
121
- ## 1.9.8 - 2024-05-13
122
-
123
- - Added `createDeepLink` property to the WidgetInstanceContext interface, to allow creating a deep link URL based on the current board and a widget instance.
124
- - 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.
125
- - 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.
126
-
127
- ## 1.9.7 - 2024-04-19
128
-
129
- - Added `hideSpHubNav` property to the IFrameDialogOptions interface, to allow hiding the Hub navigation on SharePoint sites.
130
- - Added `hideSpSiteHeader` property to the IFrameDialogOptions interface, to allow hiding the site header on SharePoint sites.
131
- - Added `showHistoryButtons` property to the IFrameDialogOptions interface, to render back and forward buttons, allowing the user to navigate the browser history.
132
- - 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.
133
-
134
- ## 1.9.6 - 2024-04-19
135
-
136
- - Changed `onRenderHeaderIcon` property of the IFrameDialogOptions interface, to work similarly to the widget render functions.
137
-
138
- ## 1.9.5 - 2024-04-18
139
-
140
- - Added `title` property to the IFrameDialogOptions interface, to allow rendering a title in the dialog header.
141
- - Added `titleUrl` property to the IFrameDialogOptions interface, to allow making the dialog header title clickable.
142
- - Added `onRenderHeaderIcon` property to the IFrameDialogOptions interface, to allow rendering an icon in the dialog header.
143
- - Added `onLoad` property to the IFrameDialogOptions interface, to support executing some code after the iframe finishes loading.
144
-
145
- ## 1.9.4 - 2024-04-11
146
-
147
- - Reintroduced the following types: `AadHttpClient`,`AadHttpClientConfiguration`,`AadHttpClientFactory`,`AadHttpClientResponse`, `AadTokenProvider`, `AadTokenProviderFactory`
148
-
149
- ## 1.9.2 - 2024-03-21
150
-
151
- - Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
152
- - Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
153
- - Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
154
- - Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
155
- - Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
156
-
157
- ## 1.9.1 - 2023-10-20
158
-
159
- - Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
160
- - Added `WidgetVariantContext` interface, to allow typing the `definition` property of the `WidgetContext` interface.
161
- - Added `WidgetManifestContext` interface, to allow typing the `manifest` property of the `WidgetContext` interface.
162
-
163
- ## 1.9.0 - 2023-10-20
164
-
165
- - Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
166
- - Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
167
- - Added new exported `ExportData` type.
168
-
169
- ## 1.8.17 - 2023-10-09
170
-
171
- - Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
172
-
173
- ## 1.8.16 - 2023-09-26
174
-
175
- - Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
176
-
177
- ## 1.8.15 - 2023-09-01
178
-
179
- - Added `thumbnailUrl` property to `WidgetManifestConfig` interface, as a non-translatable substitute of the newly deprecated `preview_small` property from `WidgetImages` interface.
180
- - Removed the deprecated `preview_small` property from `WidgetImages` interface.
181
-
182
- ## 1.8.14 - 2023-09-01
183
-
184
- - Added `iconName` property to `WidgetManifestConfig` interface, to support using an icon to represent a widget, e.g. in the widget library or widget header.
185
- - Removed the deprecated `notificationIcon` property from `WidgetManifestConfig` interface.
186
-
187
- ## 1.8.13 - 2023-06-08
188
-
189
- - Removed the deprecated `resolved` property from `ICPersona` interface
190
-
191
- ## 1.8.12 - 2023-04-04
192
-
193
- - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
194
-
195
- ## 1.8.11 - 2023-04-03
196
-
197
- - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
198
-
199
- ## 1.8.10 - 2023-03-30
200
-
201
- - Changed `openFilePicker` function to accept `options`, to support configuration of picker behavior
202
-
203
- ## 1.8.9 - 2023-03-06
204
-
205
- - Added `registerCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support multiple custom buttons in the widget header.
206
- - Added `unregisterCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support removing all custom buttons in the widget header.
207
- - Added optional `id` property to exported `CustomCommandBarItemProps` type, to support removing a custom command bar item by id.
208
- - Added optional `pinned` property to exported `CustomCommandBarItemProps` type, to support forcing the widget header to always be visible.
209
- - Added optional `showNotificationBadge` property to exported `CustomCommandBarItemProps` type, to support showing a red notification badge over the custom command bar item.
210
- - Added optional `order` property to exported `CustomCommandBarItemProps` type, to support changing the order of custom command bar items.
211
- - Changed `unregisterCustomCommandBarItem` function of the `instance` object of the `WidgetContext` interface, to support removing a custom command bar item by id.
212
-
213
- ## 1.8.8 - 2023-02-16
214
-
215
- - Removed all SharePoint and Teams dependencies.
216
-
217
- ## 1.8.7 - 2022-12-13
218
-
219
- - Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
220
- - Added new exported `UserRole` type.
221
-
222
- ## 1.8.6 - 2022-12-08
223
-
224
- - Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
225
- - 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.
226
- - Added new exported `BoardType` type.
227
-
228
- ## 1.8.5 - 2022-09-30
229
-
230
- - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
231
- - Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
232
- - Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
233
- - Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
234
-
235
- ## 1.8.4 - 2022-09-05
236
-
237
- - 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.
238
-
239
- ## 1.8.3 - 2022-08-16
240
-
241
- - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
242
-
243
- ## 1.8.2 - 2022-07-06
244
-
245
- - Added `subtitle` property to the `WidgetResource` interface.
246
-
247
- ## 1.8.1 - 2022-06-17
248
-
249
- - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
250
- - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
251
-
252
- ## 1.7.11 - 2022-03-23
253
-
254
- - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
255
-
256
- ## 1.7.9 - 2022-01-20
257
-
258
- - Added `userAccountCreated` date/time to the `WidgetContext` interface.
259
-
260
- ## 1.7.8 - 2022-01-18
261
-
262
- ### Changed
263
-
264
- - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
265
-
266
- ## 1.7.7 - 2022-01-14
267
-
268
- ### Changed
269
-
270
- - Added `tenantId` property to the `WidgetContext` interface.
271
-
272
- ## 1.7.6 - 2021-11-04
273
-
274
- ### Changed
275
-
276
- - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
277
-
278
- ## 1.7.5 - 2021-10-26
279
-
280
- ### Changed
281
-
282
- - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
283
-
284
- ## 1.7.4 - 2021-10-20
285
-
286
- ### Changed
287
-
288
- - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
289
-
290
- ## 1.7.3 - 2021-10-04
291
-
292
- ### Changed
293
-
294
- - 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.
295
- - 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.
296
-
297
- ## 1.6.1 - 2021-02-18
298
-
299
- ### Changed
300
-
301
- - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
302
-
303
- ## 1.5.0 - 2021-02-16
304
-
305
- ### Changed
306
-
307
- - 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.
308
-
309
- ## 1.4.0 - 2021-01-25
310
-
311
- ### Changed
312
-
313
- - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
314
-
315
- ## 1.3.0 - 2021-01-15
316
-
317
- ### Changed
318
-
319
- - `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.
320
- - `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.
321
-
322
- ## 1.2.0 - 2021-01-15
323
-
324
- ### Changed
325
-
326
- - `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.
327
-
328
- ## 1.1.0 - 2021-01-11
329
-
330
- ### Changed
331
-
332
- - `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.
333
- - **deps:** removed dependency ajv
334
-
335
- ## <= 1.0.5 - 2020-12-07
336
-
337
- 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.12.0 - 2025-02-11
13
+
14
+ - Added `ColorOption` interface.
15
+ - Added `WidgetDesignContext` interface.
16
+ - Added `design` property of type `WidgetDesignContext` to `WidgetContext` interface, to support UI settings within widgets.
17
+ - Deprecated `elementBorderRadius` property which is renamed to `borderRadius` and moved under `design` property in `WidgetContext` interface.
18
+
19
+ ## 1.11.6 - 2025-01-30
20
+
21
+ - Added `spServiceScope` property to `WidgetContext` interface.
22
+ - Added `loadComponentById` function to `WidgetContext` interface.
23
+ - Deprecated `definition` property which is replaced by `variant` property in `WidgetContext` interface.
24
+ - Deprecated `instance.publishNotification` function in `WidgetContext` interface because feature is no longer available.
25
+
26
+ ## 1.11.5 - 2025-01-21
27
+
28
+ - Added `defaultColor` property to `WidgetBuddyContext` interface.
29
+
30
+ ## 1.11.4 - 2024-11-08
31
+
32
+ - Added `driveId` property to `FilePickerFileProps` interface.
33
+
34
+ ## 1.11.3 - 2024-11-05
35
+
36
+ - Added `fileName` property to `FilePickerFileProps` interface.
37
+
38
+ ## 1.11.2 - 2024-10-21
39
+
40
+ - Added optional `objectId` property to the `ICPersona` interface.
41
+
42
+ ## 1.11.1 - 2024-10-17
43
+
44
+ - Made `buddy` property of type `WidgetBuddyContext` optional.
45
+
46
+ ## 1.11.0 - 2024-10-17
47
+
48
+ - Added `renderBuddy` function to the `BaseWidget` class, to support rendering widgets as a buddy.
49
+ - Added `buddy` property of type `WidgetBuddyContext` to the `WidgetContext` interface, to support utility functions specifically for a widget buddy.
50
+ - Added `setBadgeProperties` function to the `WidgetBuddyContext` interface, to allow rendering a badge on top of the buddy.
51
+
52
+ ## 1.10.8 - 2024-10-15
53
+
54
+ - Added `buddybar` to the `BoardType` type, to support widgets that run in the scope of the upcoming buddy bar feature
55
+
56
+ ## 1.10.7 - 2024-08-20
57
+
58
+ - Replaced `onInit` function with a new asynchronous `init` function in the `BaseWidget` class, to allow waiting until initialization is complete.
59
+
60
+ ## 1.10.6 - 2024-08-19
61
+
62
+ - Added `userDisplayName` property to the `WidgetContext` interface, to allow using the currently signed-in user's display name in widgets.
63
+
64
+ ## 1.10.5 - 2024-08-07
65
+
66
+ - Added `onSearch` property to the `CommandBarSearchItem` interface, to allow executing a callback when the user presses enter in the search box.
67
+
68
+ ## 1.10.4 - 2024-07-23
69
+
70
+ - Added `SearchBar` value to the `CommandBarItemType` enum, to allow rendering a command bar item as a search bar.
71
+ - Added `CommandBarSearchItem` interface, to allow passing extra search-related props to a CommandBarItem of type `SearchBar`.
72
+ - Added optional `overflowButtonIconName` and `overflowButtonTooltip` properties to the `CommandBarTabOptions` interface, to allow customization of the overflow menu button.
73
+ - Added optional `itemCount` property to the `CommandBarTab` interface.
74
+ - Added summaries to functions and interfaces related to widget command bar tabs.
75
+
76
+ ## 1.10.3 - 2024-07-22
77
+
78
+ - 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
79
+
80
+ ## 1.10.2 - 2024-07-19
81
+
82
+ - Added `registerTabs` function to the `WidgetInstanceContext` interface, to allow rendering of tabs in the widget header.
83
+ - Added `setSelectedTab` function to the `WidgetInstanceContext` interface, to allow setting the current selected tab in the widget header.
84
+ - Added `CommandBarTab` interface.
85
+ - Added `CommandBarTabOptions` interface.
86
+
87
+ ## 1.10.1 - 2024-07-08
88
+
89
+ - Added `widget-administrator` role to the `UserRole` type.
90
+
91
+ ## 1.10.0 - 2024-06-25
92
+
93
+ - Added optional `updateDataAccess()` function to the `BaseWidget` class, used to update access to widget-specific data.
94
+ - Added `administrators` property to the `WidgetVariantContext` interface.
95
+
96
+ ## 1.9.14 - 2024-06-18
97
+
98
+ - Change import of `SPFI` type to decrease bundle sizes in widgets.
99
+
100
+ ## 1.9.13 - 2024-06-18
101
+
102
+ - Added `spHttpClient` property to `WidgetContext` interface, to perform REST calls against SharePoint.
103
+ - Added `spHttpClientConfiguration` property to `WidgetContext` interface.
104
+
105
+ ## 1.9.12 - 2024-06-17
106
+
107
+ - Added `sp` property to `WidgetContext` interface, to allow using a centralized PnPjs version across all widgets.
108
+ - Added `siteId` property to `WidgetContext` interface.
109
+ - Added `boardsInstanceId` property to `WidgetContext` interface.
110
+
111
+ ## 1.9.11 - 2024-06-14
112
+
113
+ - Fixed handling of null `ICPersonaType` values in `isCurrentUserInScope` function of `UserHelper` class.
114
+
115
+ ## 1.9.10 - 2024-06-04
116
+
117
+ - Renamed `CustomCommandBarItemProps` interface to `CommandBarItemProps`.
118
+ - Merged `CommandBarIcon`, `CommandBarLink` and `CommandBarItemBase` interfaces into the `CommandBarItemProps` interface, to simplify adding custom command bar items.
119
+ - Added `Overflow` type to `CommandBarItemType` enum, to allow rendering an item inside the overflow menu.
120
+ - Added `highlighted` property to the `CommandBarItemProps` interface, to allow rendering an item as if it is being hovered.
121
+ - Added `cursor` property to the `CommandBarItemProps` interface, to allow a different cursor when hovering over an item.
122
+ - Added `disabled` property to the `CommandBarItemProps` interface, to allow rendering an item in a disabled state.
123
+
124
+ ## 1.9.9 - 2024-05-14
125
+
126
+ - Changed return type of `createDeepLink` function of the WidgetInstanceContext interface from `void` to `string`.
127
+
128
+ ## 1.9.8 - 2024-05-13
129
+
130
+ - Added `createDeepLink` property to the WidgetInstanceContext interface, to allow creating a deep link URL based on the current board and a widget instance.
131
+ - 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.
132
+ - 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.
133
+
134
+ ## 1.9.7 - 2024-04-19
135
+
136
+ - Added `hideSpHubNav` property to the IFrameDialogOptions interface, to allow hiding the Hub navigation on SharePoint sites.
137
+ - Added `hideSpSiteHeader` property to the IFrameDialogOptions interface, to allow hiding the site header on SharePoint sites.
138
+ - Added `showHistoryButtons` property to the IFrameDialogOptions interface, to render back and forward buttons, allowing the user to navigate the browser history.
139
+ - 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.
140
+
141
+ ## 1.9.6 - 2024-04-19
142
+
143
+ - Changed `onRenderHeaderIcon` property of the IFrameDialogOptions interface, to work similarly to the widget render functions.
144
+
145
+ ## 1.9.5 - 2024-04-18
146
+
147
+ - Added `title` property to the IFrameDialogOptions interface, to allow rendering a title in the dialog header.
148
+ - Added `titleUrl` property to the IFrameDialogOptions interface, to allow making the dialog header title clickable.
149
+ - Added `onRenderHeaderIcon` property to the IFrameDialogOptions interface, to allow rendering an icon in the dialog header.
150
+ - Added `onLoad` property to the IFrameDialogOptions interface, to support executing some code after the iframe finishes loading.
151
+
152
+ ## 1.9.4 - 2024-04-11
153
+
154
+ - Reintroduced the following types: `AadHttpClient`,`AadHttpClientConfiguration`,`AadHttpClientFactory`,`AadHttpClientResponse`, `AadTokenProvider`, `AadTokenProviderFactory`
155
+
156
+ ## 1.9.2 - 2024-03-21
157
+
158
+ - Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
159
+ - Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
160
+ - Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
161
+ - Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
162
+ - Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
163
+
164
+ ## 1.9.1 - 2023-10-20
165
+
166
+ - Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
167
+ - Added `WidgetVariantContext` interface, to allow typing the `definition` property of the `WidgetContext` interface.
168
+ - Added `WidgetManifestContext` interface, to allow typing the `manifest` property of the `WidgetContext` interface.
169
+
170
+ ## 1.9.0 - 2023-10-20
171
+
172
+ - Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
173
+ - Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
174
+ - Added new exported `ExportData` type.
175
+
176
+ ## 1.8.17 - 2023-10-09
177
+
178
+ - Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
179
+
180
+ ## 1.8.16 - 2023-09-26
181
+
182
+ - Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
183
+
184
+ ## 1.8.15 - 2023-09-01
185
+
186
+ - Added `thumbnailUrl` property to `WidgetManifestConfig` interface, as a non-translatable substitute of the newly deprecated `preview_small` property from `WidgetImages` interface.
187
+ - Removed the deprecated `preview_small` property from `WidgetImages` interface.
188
+
189
+ ## 1.8.14 - 2023-09-01
190
+
191
+ - Added `iconName` property to `WidgetManifestConfig` interface, to support using an icon to represent a widget, e.g. in the widget library or widget header.
192
+ - Removed the deprecated `notificationIcon` property from `WidgetManifestConfig` interface.
193
+
194
+ ## 1.8.13 - 2023-06-08
195
+
196
+ - Removed the deprecated `resolved` property from `ICPersona` interface
197
+
198
+ ## 1.8.12 - 2023-04-04
199
+
200
+ - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
201
+
202
+ ## 1.8.11 - 2023-04-03
203
+
204
+ - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
205
+
206
+ ## 1.8.10 - 2023-03-30
207
+
208
+ - Changed `openFilePicker` function to accept `options`, to support configuration of picker behavior
209
+
210
+ ## 1.8.9 - 2023-03-06
211
+
212
+ - Added `registerCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support multiple custom buttons in the widget header.
213
+ - Added `unregisterCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support removing all custom buttons in the widget header.
214
+ - Added optional `id` property to exported `CustomCommandBarItemProps` type, to support removing a custom command bar item by id.
215
+ - Added optional `pinned` property to exported `CustomCommandBarItemProps` type, to support forcing the widget header to always be visible.
216
+ - Added optional `showNotificationBadge` property to exported `CustomCommandBarItemProps` type, to support showing a red notification badge over the custom command bar item.
217
+ - Added optional `order` property to exported `CustomCommandBarItemProps` type, to support changing the order of custom command bar items.
218
+ - Changed `unregisterCustomCommandBarItem` function of the `instance` object of the `WidgetContext` interface, to support removing a custom command bar item by id.
219
+
220
+ ## 1.8.8 - 2023-02-16
221
+
222
+ - Removed all SharePoint and Teams dependencies.
223
+
224
+ ## 1.8.7 - 2022-12-13
225
+
226
+ - Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
227
+ - Added new exported `UserRole` type.
228
+
229
+ ## 1.8.6 - 2022-12-08
230
+
231
+ - Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
232
+ - 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.
233
+ - Added new exported `BoardType` type.
234
+
235
+ ## 1.8.5 - 2022-09-30
236
+
237
+ - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
238
+ - Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
239
+ - Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
240
+ - Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
241
+
242
+ ## 1.8.4 - 2022-09-05
243
+
244
+ - 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.
245
+
246
+ ## 1.8.3 - 2022-08-16
247
+
248
+ - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
249
+
250
+ ## 1.8.2 - 2022-07-06
251
+
252
+ - Added `subtitle` property to the `WidgetResource` interface.
253
+
254
+ ## 1.8.1 - 2022-06-17
255
+
256
+ - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
257
+ - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
258
+
259
+ ## 1.7.11 - 2022-03-23
260
+
261
+ - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
262
+
263
+ ## 1.7.9 - 2022-01-20
264
+
265
+ - Added `userAccountCreated` date/time to the `WidgetContext` interface.
266
+
267
+ ## 1.7.8 - 2022-01-18
268
+
269
+ ### Changed
270
+
271
+ - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
272
+
273
+ ## 1.7.7 - 2022-01-14
274
+
275
+ ### Changed
276
+
277
+ - Added `tenantId` property to the `WidgetContext` interface.
278
+
279
+ ## 1.7.6 - 2021-11-04
280
+
281
+ ### Changed
282
+
283
+ - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
284
+
285
+ ## 1.7.5 - 2021-10-26
286
+
287
+ ### Changed
288
+
289
+ - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
290
+
291
+ ## 1.7.4 - 2021-10-20
292
+
293
+ ### Changed
294
+
295
+ - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
296
+
297
+ ## 1.7.3 - 2021-10-04
298
+
299
+ ### Changed
300
+
301
+ - 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.
302
+ - 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.
303
+
304
+ ## 1.6.1 - 2021-02-18
305
+
306
+ ### Changed
307
+
308
+ - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
309
+
310
+ ## 1.5.0 - 2021-02-16
311
+
312
+ ### Changed
313
+
314
+ - 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.
315
+
316
+ ## 1.4.0 - 2021-01-25
317
+
318
+ ### Changed
319
+
320
+ - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
321
+
322
+ ## 1.3.0 - 2021-01-15
323
+
324
+ ### Changed
325
+
326
+ - `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.
327
+ - `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.
328
+
329
+ ## 1.2.0 - 2021-01-15
330
+
331
+ ### Changed
332
+
333
+ - `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.
334
+
335
+ ## 1.1.0 - 2021-01-11
336
+
337
+ ### Changed
338
+
339
+ - `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.
340
+ - **deps:** removed dependency ajv
341
+
342
+ ## <= 1.0.5 - 2020-12-07
343
+
344
+ No changelog was maintained for the earlier versions.
@@ -33,6 +33,10 @@ export interface WidgetContext {
33
33
  * can exist in a widget board configuration.
34
34
  */
35
35
  manifest: WidgetManifestContext;
36
+ /**
37
+ * Metadata in the context of the user's current theme, e.g. color settings and the preferred border radius for UI elements.
38
+ */
39
+ design: WidgetDesignContext;
36
40
  /**
37
41
  * Tells whether the widget board is running in a Teams context
38
42
  */
@@ -158,7 +162,8 @@ export interface WidgetContext {
158
162
  isCurrent?: boolean;
159
163
  }[];
160
164
  /**
161
- * Preferred border radius of UI elements as configured in Widget Board configuration
165
+ * Preferred border radius of UI elements as configured in Widget Board configuration.
166
+ * @deprecated This property has been moved under `design`.
162
167
  */
163
168
  elementBorderRadius: number;
164
169
  /**
@@ -419,6 +424,21 @@ export interface WidgetManifestContext {
419
424
  */
420
425
  id: string;
421
426
  }
427
+ export interface WidgetDesignContext {
428
+ /** Available options in the ColorPicker.*/
429
+ colorOptions: ColorOption[];
430
+ /** Preferred border radius of UI elements.*/
431
+ borderRadius: number;
432
+ /** The height of a single row in the board grid. Use this to determine how many columns high a widget is. */
433
+ rowHeight: number;
434
+ /** Design settings related to icon badges. */
435
+ badge: {
436
+ /** Background color of an icon badge. */
437
+ color: string;
438
+ /** Inner text color of an icon badge. */
439
+ textColor: string;
440
+ };
441
+ }
422
442
  export interface ValidationResult {
423
443
  isValid: boolean;
424
444
  errors: string[];
@@ -888,3 +908,8 @@ export interface BadgeProperties {
888
908
  count?: number;
889
909
  color?: string;
890
910
  }
911
+ export interface ColorOption {
912
+ id: string;
913
+ title: string;
914
+ color: string;
915
+ }
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
- {
2
- "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.11.6",
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
- "typescript": "^5.4.5"
30
- }
31
- }
1
+ {
2
+ "name": "@ichicraft/widgets-widget-base",
3
+ "version": "1.12.0",
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
+ "typescript": "^5.4.5"
30
+ }
31
+ }