@ichicraft/widgets-widget-base 1.16.6 → 1.18.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 +450 -442
- package/lib/types/index.d.ts +11 -41
- package/lib/types/index.js +1 -8
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -1
- package/package.json +45 -42
- package/lib/utils/UserHelper.d.ts +0 -9
- package/lib/utils/UserHelper.js +0 -97
package/README.md
CHANGED
|
@@ -1,442 +1,450 @@
|
|
|
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 Bloom Intranet._
|
|
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.
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
## 1.
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
## 1.16.
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
## 1.
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
## 1.
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
## 1.15.
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
## 1.15.
|
|
56
|
-
|
|
57
|
-
- Added
|
|
58
|
-
|
|
59
|
-
## 1.15.
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
## 1.
|
|
64
|
-
|
|
65
|
-
- Added
|
|
66
|
-
|
|
67
|
-
## 1.
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
## 1.14.
|
|
72
|
-
|
|
73
|
-
- Added `
|
|
74
|
-
|
|
75
|
-
## 1.14.
|
|
76
|
-
|
|
77
|
-
- Added `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
## 1.
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
## 1.
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
## 1.13.
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
- Added `
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
## 1.11.
|
|
133
|
-
|
|
134
|
-
- Added `
|
|
135
|
-
|
|
136
|
-
## 1.11.
|
|
137
|
-
|
|
138
|
-
- Added
|
|
139
|
-
|
|
140
|
-
## 1.11.
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
## 1.11.
|
|
145
|
-
|
|
146
|
-
- Added `
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
## 1.10.
|
|
159
|
-
|
|
160
|
-
- Added `
|
|
161
|
-
|
|
162
|
-
## 1.10.
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
## 1.10.
|
|
167
|
-
|
|
168
|
-
- Added `
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
- Added
|
|
173
|
-
|
|
174
|
-
## 1.10.
|
|
175
|
-
|
|
176
|
-
- Added
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- Added
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- Added
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- Added `
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
- Added `
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
- Added `
|
|
237
|
-
- Added `
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
- Added `
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
- Added `
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
-
|
|
261
|
-
|
|
262
|
-
## 1.9.
|
|
263
|
-
|
|
264
|
-
- Added `
|
|
265
|
-
- Added `
|
|
266
|
-
- Added `
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
- Added
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
- Added
|
|
281
|
-
|
|
282
|
-
## 1.8.
|
|
283
|
-
|
|
284
|
-
- Added `
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
-
|
|
299
|
-
|
|
300
|
-
## 1.8.
|
|
301
|
-
|
|
302
|
-
-
|
|
303
|
-
|
|
304
|
-
## 1.8.
|
|
305
|
-
|
|
306
|
-
- Changed `openFilePicker` function to
|
|
307
|
-
|
|
308
|
-
## 1.8.
|
|
309
|
-
|
|
310
|
-
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
- Added `
|
|
338
|
-
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
-
|
|
347
|
-
|
|
348
|
-
## 1.8.
|
|
349
|
-
|
|
350
|
-
- Added `
|
|
351
|
-
|
|
352
|
-
## 1.8.
|
|
353
|
-
|
|
354
|
-
- Added
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
- Added `
|
|
364
|
-
|
|
365
|
-
## 1.7.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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 Bloom Intranet._
|
|
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.18.0 - 2026-08-17
|
|
13
|
+
|
|
14
|
+
- Added optional `assetsBaseUrl` property to the `WidgetContext` interface, containing the base URL of the folder the widget bundle was loaded from. This allows widgets to fetch files that are published alongside their bundle, such as per-language translation files.
|
|
15
|
+
|
|
16
|
+
## 1.17.0 - 2026-07-16
|
|
17
|
+
|
|
18
|
+
- Moved `UserHelper`, `ICPersona`, `ICPersonaType`, `ICSite`, `ICTeam` and `ICTerm` to an internal package.
|
|
19
|
+
|
|
20
|
+
## 1.16.6 - 2026-06-03
|
|
21
|
+
|
|
22
|
+
- Replaced unused `design.header.activeTextColor` with `design.header.subTextColor`
|
|
23
|
+
|
|
24
|
+
## 1.16.5 - 2026-06-01
|
|
25
|
+
|
|
26
|
+
- Added `BuddyRenderOptions` interface, passed by the host to `BaseWidget.renderBuddy` to describe the slot the widget is about to render into.
|
|
27
|
+
- Added optional `options` parameter to `BaseWidget.renderBuddy`, of type `BuddyRenderOptions`. Contains an `allowRichRendering` boolean that signals whether the slot has room for richer rendering than the standard buddy icon button — letting the widget decide synchronously between custom and default rendering.
|
|
28
|
+
|
|
29
|
+
## 1.16.4 - 2026-05-27
|
|
30
|
+
|
|
31
|
+
- Added `header` property to `WidgetDesignContext` interface, exposing the header's `textColor`, `iconColor`, `activeTextColor` and `activeIconColor` from the user's theme.
|
|
32
|
+
- Deprecated `defaultColor` property on `WidgetBuddyContext` interface in favor of `design.header.iconColor` (and `design.header.activeIconColor` for the hover/active state).
|
|
33
|
+
|
|
34
|
+
## 1.16.3 - 2026-05-08
|
|
35
|
+
|
|
36
|
+
- Added `whatsNewUrl` property to `WidgetManifestConfig` to allow quick access to updates that the widget has received.
|
|
37
|
+
- Added `aboutUrl` property to `WidgetManifestConfig` to allow quick access to more information about the widget.
|
|
38
|
+
|
|
39
|
+
## 1.16.2 - 2026-03-25
|
|
40
|
+
|
|
41
|
+
- Fixed issue with using internal library `@ic/caching` by publishing caching library as public (`@ichicraft/caching`)
|
|
42
|
+
|
|
43
|
+
## 1.16.1 - 2026-03-19
|
|
44
|
+
|
|
45
|
+
- Addition of `notificationBadgeCount` property to `CommandBarItemProps` to allow for a number to be displayed in the badge
|
|
46
|
+
|
|
47
|
+
## 1.16.0 - 2026-03-09
|
|
48
|
+
|
|
49
|
+
- Addition of `cache` property to `instance`, `variant` and `manifest` level of `WidgetContext` to centralize cache handling and functionality
|
|
50
|
+
|
|
51
|
+
## 1.15.4 - 2026-01-07
|
|
52
|
+
|
|
53
|
+
- Override version of deep dependency 'validator' to get rid of potential vulnerability
|
|
54
|
+
|
|
55
|
+
## 1.15.3 - 2025-12-09
|
|
56
|
+
|
|
57
|
+
- Added property `isIndeterminate` to `ICTerm` interface, used to represent a term's indeterminate checkmark state.
|
|
58
|
+
|
|
59
|
+
## 1.15.2 - 2025-11-21
|
|
60
|
+
|
|
61
|
+
- Added new interface `ICTerm`, used to represent a SharePoint Taxonomy Term object in code
|
|
62
|
+
|
|
63
|
+
## 1.15.1 - 2025-09-30
|
|
64
|
+
|
|
65
|
+
- Added new interface `ICTeam`, used to represent a Microsoft Teams team object in code
|
|
66
|
+
|
|
67
|
+
## 1.15.0 - 2025-09-29
|
|
68
|
+
|
|
69
|
+
- Deprecated `msGraphClientFactory` in favor of `msGraphClient` in the `WidgetManifestConfig` interface.
|
|
70
|
+
|
|
71
|
+
## 1.14.7 - 2025-08-21
|
|
72
|
+
|
|
73
|
+
- Added `parentId` property to the `WidgetInstanceContext` interface, to support checking the ID of the parent of a widget instance.
|
|
74
|
+
|
|
75
|
+
## 1.14.6 - 2025-08-11
|
|
76
|
+
|
|
77
|
+
- Added `updateInstanceConfiguration` property to the `WidgetInstanceContext` interface, to support updating the instance configuration directly in a widget, instead of through the settings panel.
|
|
78
|
+
|
|
79
|
+
## 1.14.5 - 2025-08-07
|
|
80
|
+
|
|
81
|
+
- Added `imageUrl` property to the `CommandBarTab` interface, to support displaying images in widget header tabs.
|
|
82
|
+
|
|
83
|
+
## 1.14.4 - 2025-08-01
|
|
84
|
+
|
|
85
|
+
- Added `releaseType` property to the `WidgetManifestConfig` interface, to indicate the current stage of the release lifecycle a widget is in.
|
|
86
|
+
- 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).
|
|
87
|
+
|
|
88
|
+
## 1.14.3 - 2025-07-04
|
|
89
|
+
|
|
90
|
+
- Added `justification` string property to widget manifest to describe the reasoning behind the need for certain API permisisons
|
|
91
|
+
|
|
92
|
+
## 1.14.2 - 2025-07-02
|
|
93
|
+
|
|
94
|
+
- Reverted `@microsoft/sp-http` dependency back to SPFx version `1.18.2` due to postponed upgrade
|
|
95
|
+
- Added `isOptional` boolean to widget manifest to allow marking certain API permission requests as optional
|
|
96
|
+
|
|
97
|
+
## 1.14.1 - 2025-06-17
|
|
98
|
+
|
|
99
|
+
- Reverted module type 'commonjs' for backwards compatibility
|
|
100
|
+
|
|
101
|
+
## 1.14.0 - 2025-05-21
|
|
102
|
+
|
|
103
|
+
- Version bumped `@microsoft/sp-http` dependency to latest SPFx version `1.21.1`
|
|
104
|
+
|
|
105
|
+
## 1.13.2 - 2025-04-11
|
|
106
|
+
|
|
107
|
+
- Minor update in documentation of `WebApiPermissionRequest` interface
|
|
108
|
+
|
|
109
|
+
## 1.13.1 - 2025-03-11
|
|
110
|
+
|
|
111
|
+
- Added new interface `ICSite`, used to represent a SharePoint site object in code
|
|
112
|
+
|
|
113
|
+
## 1.13.0 - 2025-02-17
|
|
114
|
+
|
|
115
|
+
- Fixed an issue with detecting external users in `UserHelper`
|
|
116
|
+
- Changed target JavaScript version to `ES6`
|
|
117
|
+
|
|
118
|
+
## 1.12.0 - 2025-02-11
|
|
119
|
+
|
|
120
|
+
- Added `ColorOption` interface.
|
|
121
|
+
- Added `WidgetDesignContext` interface.
|
|
122
|
+
- Added `design` property of type `WidgetDesignContext` to `WidgetContext` interface, to support UI settings within widgets.
|
|
123
|
+
- Deprecated `elementBorderRadius` property which is renamed to `borderRadius` and moved under `design` property in `WidgetContext` interface.
|
|
124
|
+
|
|
125
|
+
## 1.11.6 - 2025-01-30
|
|
126
|
+
|
|
127
|
+
- Added `spServiceScope` property to `WidgetContext` interface.
|
|
128
|
+
- Added `loadComponentById` function to `WidgetContext` interface.
|
|
129
|
+
- Deprecated `definition` property which is replaced by `variant` property in `WidgetContext` interface.
|
|
130
|
+
- Deprecated `instance.publishNotification` function in `WidgetContext` interface because feature is no longer available.
|
|
131
|
+
|
|
132
|
+
## 1.11.5 - 2025-01-21
|
|
133
|
+
|
|
134
|
+
- Added `defaultColor` property to `WidgetBuddyContext` interface.
|
|
135
|
+
|
|
136
|
+
## 1.11.4 - 2024-11-08
|
|
137
|
+
|
|
138
|
+
- Added `driveId` property to `FilePickerFileProps` interface.
|
|
139
|
+
|
|
140
|
+
## 1.11.3 - 2024-11-05
|
|
141
|
+
|
|
142
|
+
- Added `fileName` property to `FilePickerFileProps` interface.
|
|
143
|
+
|
|
144
|
+
## 1.11.2 - 2024-10-21
|
|
145
|
+
|
|
146
|
+
- Added optional `objectId` property to the `ICPersona` interface.
|
|
147
|
+
|
|
148
|
+
## 1.11.1 - 2024-10-17
|
|
149
|
+
|
|
150
|
+
- Made `buddy` property of type `WidgetBuddyContext` optional.
|
|
151
|
+
|
|
152
|
+
## 1.11.0 - 2024-10-17
|
|
153
|
+
|
|
154
|
+
- Added `renderBuddy` function to the `BaseWidget` class, to support rendering widgets as a buddy.
|
|
155
|
+
- Added `buddy` property of type `WidgetBuddyContext` to the `WidgetContext` interface, to support utility functions specifically for a widget buddy.
|
|
156
|
+
- Added `setBadgeProperties` function to the `WidgetBuddyContext` interface, to allow rendering a badge on top of the buddy.
|
|
157
|
+
|
|
158
|
+
## 1.10.8 - 2024-10-15
|
|
159
|
+
|
|
160
|
+
- Added `buddybar` to the `BoardType` type, to support widgets that run in the scope of the upcoming buddy bar feature
|
|
161
|
+
|
|
162
|
+
## 1.10.7 - 2024-08-20
|
|
163
|
+
|
|
164
|
+
- Replaced `onInit` function with a new asynchronous `init` function in the `BaseWidget` class, to allow waiting until initialization is complete.
|
|
165
|
+
|
|
166
|
+
## 1.10.6 - 2024-08-19
|
|
167
|
+
|
|
168
|
+
- Added `userDisplayName` property to the `WidgetContext` interface, to allow using the currently signed-in user's display name in widgets.
|
|
169
|
+
|
|
170
|
+
## 1.10.5 - 2024-08-07
|
|
171
|
+
|
|
172
|
+
- Added `onSearch` property to the `CommandBarSearchItem` interface, to allow executing a callback when the user presses enter in the search box.
|
|
173
|
+
|
|
174
|
+
## 1.10.4 - 2024-07-23
|
|
175
|
+
|
|
176
|
+
- Added `SearchBar` value to the `CommandBarItemType` enum, to allow rendering a command bar item as a search bar.
|
|
177
|
+
- Added `CommandBarSearchItem` interface, to allow passing extra search-related props to a CommandBarItem of type `SearchBar`.
|
|
178
|
+
- Added optional `overflowButtonIconName` and `overflowButtonTooltip` properties to the `CommandBarTabOptions` interface, to allow customization of the overflow menu button.
|
|
179
|
+
- Added optional `itemCount` property to the `CommandBarTab` interface.
|
|
180
|
+
- Added summaries to functions and interfaces related to widget command bar tabs.
|
|
181
|
+
|
|
182
|
+
## 1.10.3 - 2024-07-22
|
|
183
|
+
|
|
184
|
+
- 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
|
|
185
|
+
|
|
186
|
+
## 1.10.2 - 2024-07-19
|
|
187
|
+
|
|
188
|
+
- Added `registerTabs` function to the `WidgetInstanceContext` interface, to allow rendering of tabs in the widget header.
|
|
189
|
+
- Added `setSelectedTab` function to the `WidgetInstanceContext` interface, to allow setting the current selected tab in the widget header.
|
|
190
|
+
- Added `CommandBarTab` interface.
|
|
191
|
+
- Added `CommandBarTabOptions` interface.
|
|
192
|
+
|
|
193
|
+
## 1.10.1 - 2024-07-08
|
|
194
|
+
|
|
195
|
+
- Added `widget-administrator` role to the `UserRole` type.
|
|
196
|
+
|
|
197
|
+
## 1.10.0 - 2024-06-25
|
|
198
|
+
|
|
199
|
+
- Added optional `updateDataAccess()` function to the `BaseWidget` class, used to update access to widget-specific data.
|
|
200
|
+
- Added `administrators` property to the `WidgetVariantContext` interface.
|
|
201
|
+
|
|
202
|
+
## 1.9.14 - 2024-06-18
|
|
203
|
+
|
|
204
|
+
- Change import of `SPFI` type to decrease bundle sizes in widgets.
|
|
205
|
+
|
|
206
|
+
## 1.9.13 - 2024-06-18
|
|
207
|
+
|
|
208
|
+
- Added `spHttpClient` property to `WidgetContext` interface, to perform REST calls against SharePoint.
|
|
209
|
+
- Added `spHttpClientConfiguration` property to `WidgetContext` interface.
|
|
210
|
+
|
|
211
|
+
## 1.9.12 - 2024-06-17
|
|
212
|
+
|
|
213
|
+
- Added `sp` property to `WidgetContext` interface, to allow using a centralized PnPjs version across all widgets.
|
|
214
|
+
- Added `siteId` property to `WidgetContext` interface.
|
|
215
|
+
- Added `boardsInstanceId` property to `WidgetContext` interface.
|
|
216
|
+
|
|
217
|
+
## 1.9.11 - 2024-06-14
|
|
218
|
+
|
|
219
|
+
- Fixed handling of null `ICPersonaType` values in `isCurrentUserInScope` function of `UserHelper` class.
|
|
220
|
+
|
|
221
|
+
## 1.9.10 - 2024-06-04
|
|
222
|
+
|
|
223
|
+
- Renamed `CustomCommandBarItemProps` interface to `CommandBarItemProps`.
|
|
224
|
+
- Merged `CommandBarIcon`, `CommandBarLink` and `CommandBarItemBase` interfaces into the `CommandBarItemProps` interface, to simplify adding custom command bar items.
|
|
225
|
+
- Added `Overflow` type to `CommandBarItemType` enum, to allow rendering an item inside the overflow menu.
|
|
226
|
+
- Added `highlighted` property to the `CommandBarItemProps` interface, to allow rendering an item as if it is being hovered.
|
|
227
|
+
- Added `cursor` property to the `CommandBarItemProps` interface, to allow a different cursor when hovering over an item.
|
|
228
|
+
- Added `disabled` property to the `CommandBarItemProps` interface, to allow rendering an item in a disabled state.
|
|
229
|
+
|
|
230
|
+
## 1.9.9 - 2024-05-14
|
|
231
|
+
|
|
232
|
+
- Changed return type of `createDeepLink` function of the WidgetInstanceContext interface from `void` to `string`.
|
|
233
|
+
|
|
234
|
+
## 1.9.8 - 2024-05-13
|
|
235
|
+
|
|
236
|
+
- Added `createDeepLink` property to the WidgetInstanceContext interface, to allow creating a deep link URL based on the current board and a widget instance.
|
|
237
|
+
- 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.
|
|
238
|
+
- 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.
|
|
239
|
+
|
|
240
|
+
## 1.9.7 - 2024-04-19
|
|
241
|
+
|
|
242
|
+
- Added `hideSpHubNav` property to the IFrameDialogOptions interface, to allow hiding the Hub navigation on SharePoint sites.
|
|
243
|
+
- Added `hideSpSiteHeader` property to the IFrameDialogOptions interface, to allow hiding the site header on SharePoint sites.
|
|
244
|
+
- Added `showHistoryButtons` property to the IFrameDialogOptions interface, to render back and forward buttons, allowing the user to navigate the browser history.
|
|
245
|
+
- 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.
|
|
246
|
+
|
|
247
|
+
## 1.9.6 - 2024-04-19
|
|
248
|
+
|
|
249
|
+
- Changed `onRenderHeaderIcon` property of the IFrameDialogOptions interface, to work similarly to the widget render functions.
|
|
250
|
+
|
|
251
|
+
## 1.9.5 - 2024-04-18
|
|
252
|
+
|
|
253
|
+
- Added `title` property to the IFrameDialogOptions interface, to allow rendering a title in the dialog header.
|
|
254
|
+
- Added `titleUrl` property to the IFrameDialogOptions interface, to allow making the dialog header title clickable.
|
|
255
|
+
- Added `onRenderHeaderIcon` property to the IFrameDialogOptions interface, to allow rendering an icon in the dialog header.
|
|
256
|
+
- Added `onLoad` property to the IFrameDialogOptions interface, to support executing some code after the iframe finishes loading.
|
|
257
|
+
|
|
258
|
+
## 1.9.4 - 2024-04-11
|
|
259
|
+
|
|
260
|
+
- Reintroduced the following types: `AadHttpClient`,`AadHttpClientConfiguration`,`AadHttpClientFactory`,`AadHttpClientResponse`, `AadTokenProvider`, `AadTokenProviderFactory`
|
|
261
|
+
|
|
262
|
+
## 1.9.2 - 2024-03-21
|
|
263
|
+
|
|
264
|
+
- Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
|
|
265
|
+
- Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
|
|
266
|
+
- Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
|
|
267
|
+
- Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
|
|
268
|
+
- Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
|
|
269
|
+
|
|
270
|
+
## 1.9.1 - 2023-10-20
|
|
271
|
+
|
|
272
|
+
- Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
|
|
273
|
+
- Added `WidgetVariantContext` interface, to allow typing the `definition` property of the `WidgetContext` interface.
|
|
274
|
+
- Added `WidgetManifestContext` interface, to allow typing the `manifest` property of the `WidgetContext` interface.
|
|
275
|
+
|
|
276
|
+
## 1.9.0 - 2023-10-20
|
|
277
|
+
|
|
278
|
+
- Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
|
|
279
|
+
- Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
|
|
280
|
+
- Added new exported `ExportData` type.
|
|
281
|
+
|
|
282
|
+
## 1.8.17 - 2023-10-09
|
|
283
|
+
|
|
284
|
+
- Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
|
|
285
|
+
|
|
286
|
+
## 1.8.16 - 2023-09-26
|
|
287
|
+
|
|
288
|
+
- Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
|
|
289
|
+
|
|
290
|
+
## 1.8.15 - 2023-09-01
|
|
291
|
+
|
|
292
|
+
- Added `thumbnailUrl` property to `WidgetManifestConfig` interface, as a non-translatable substitute of the newly deprecated `preview_small` property from `WidgetImages` interface.
|
|
293
|
+
- Removed the deprecated `preview_small` property from `WidgetImages` interface.
|
|
294
|
+
|
|
295
|
+
## 1.8.14 - 2023-09-01
|
|
296
|
+
|
|
297
|
+
- Added `iconName` property to `WidgetManifestConfig` interface, to support using an icon to represent a widget, e.g. in the widget library or widget header.
|
|
298
|
+
- Removed the deprecated `notificationIcon` property from `WidgetManifestConfig` interface.
|
|
299
|
+
|
|
300
|
+
## 1.8.13 - 2023-06-08
|
|
301
|
+
|
|
302
|
+
- Removed the deprecated `resolved` property from `ICPersona` interface
|
|
303
|
+
|
|
304
|
+
## 1.8.12 - 2023-04-04
|
|
305
|
+
|
|
306
|
+
- Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
|
|
307
|
+
|
|
308
|
+
## 1.8.11 - 2023-04-03
|
|
309
|
+
|
|
310
|
+
- Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
|
|
311
|
+
|
|
312
|
+
## 1.8.10 - 2023-03-30
|
|
313
|
+
|
|
314
|
+
- Changed `openFilePicker` function to accept `options`, to support configuration of picker behavior
|
|
315
|
+
|
|
316
|
+
## 1.8.9 - 2023-03-06
|
|
317
|
+
|
|
318
|
+
- Added `registerCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support multiple custom buttons in the widget header.
|
|
319
|
+
- Added `unregisterCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support removing all custom buttons in the widget header.
|
|
320
|
+
- Added optional `id` property to exported `CustomCommandBarItemProps` type, to support removing a custom command bar item by id.
|
|
321
|
+
- Added optional `pinned` property to exported `CustomCommandBarItemProps` type, to support forcing the widget header to always be visible.
|
|
322
|
+
- Added optional `showNotificationBadge` property to exported `CustomCommandBarItemProps` type, to support showing a red notification badge over the custom command bar item.
|
|
323
|
+
- Added optional `order` property to exported `CustomCommandBarItemProps` type, to support changing the order of custom command bar items.
|
|
324
|
+
- Changed `unregisterCustomCommandBarItem` function of the `instance` object of the `WidgetContext` interface, to support removing a custom command bar item by id.
|
|
325
|
+
|
|
326
|
+
## 1.8.8 - 2023-02-16
|
|
327
|
+
|
|
328
|
+
- Removed all SharePoint and Teams dependencies.
|
|
329
|
+
|
|
330
|
+
## 1.8.7 - 2022-12-13
|
|
331
|
+
|
|
332
|
+
- Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
|
|
333
|
+
- Added new exported `UserRole` type.
|
|
334
|
+
|
|
335
|
+
## 1.8.6 - 2022-12-08
|
|
336
|
+
|
|
337
|
+
- Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
|
|
338
|
+
- 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.
|
|
339
|
+
- Added new exported `BoardType` type.
|
|
340
|
+
|
|
341
|
+
## 1.8.5 - 2022-09-30
|
|
342
|
+
|
|
343
|
+
- Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
|
|
344
|
+
- Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
|
|
345
|
+
- Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
|
|
346
|
+
- Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
|
|
347
|
+
|
|
348
|
+
## 1.8.4 - 2022-09-05
|
|
349
|
+
|
|
350
|
+
- 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.
|
|
351
|
+
|
|
352
|
+
## 1.8.3 - 2022-08-16
|
|
353
|
+
|
|
354
|
+
- Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
|
|
355
|
+
|
|
356
|
+
## 1.8.2 - 2022-07-06
|
|
357
|
+
|
|
358
|
+
- Added `subtitle` property to the `WidgetResource` interface.
|
|
359
|
+
|
|
360
|
+
## 1.8.1 - 2022-06-17
|
|
361
|
+
|
|
362
|
+
- Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
|
|
363
|
+
- Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
|
|
364
|
+
|
|
365
|
+
## 1.7.11 - 2022-03-23
|
|
366
|
+
|
|
367
|
+
- Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
|
|
368
|
+
|
|
369
|
+
## 1.7.9 - 2022-01-20
|
|
370
|
+
|
|
371
|
+
- Added `userAccountCreated` date/time to the `WidgetContext` interface.
|
|
372
|
+
|
|
373
|
+
## 1.7.8 - 2022-01-18
|
|
374
|
+
|
|
375
|
+
### Changed
|
|
376
|
+
|
|
377
|
+
- Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
|
|
378
|
+
|
|
379
|
+
## 1.7.7 - 2022-01-14
|
|
380
|
+
|
|
381
|
+
### Changed
|
|
382
|
+
|
|
383
|
+
- Added `tenantId` property to the `WidgetContext` interface.
|
|
384
|
+
|
|
385
|
+
## 1.7.6 - 2021-11-04
|
|
386
|
+
|
|
387
|
+
### Changed
|
|
388
|
+
|
|
389
|
+
- Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
|
|
390
|
+
|
|
391
|
+
## 1.7.5 - 2021-10-26
|
|
392
|
+
|
|
393
|
+
### Changed
|
|
394
|
+
|
|
395
|
+
- Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
|
|
396
|
+
|
|
397
|
+
## 1.7.4 - 2021-10-20
|
|
398
|
+
|
|
399
|
+
### Changed
|
|
400
|
+
|
|
401
|
+
- Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
|
|
402
|
+
|
|
403
|
+
## 1.7.3 - 2021-10-04
|
|
404
|
+
|
|
405
|
+
### Changed
|
|
406
|
+
|
|
407
|
+
- 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.
|
|
408
|
+
- 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.
|
|
409
|
+
|
|
410
|
+
## 1.6.1 - 2021-02-18
|
|
411
|
+
|
|
412
|
+
### Changed
|
|
413
|
+
|
|
414
|
+
- Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
|
|
415
|
+
|
|
416
|
+
## 1.5.0 - 2021-02-16
|
|
417
|
+
|
|
418
|
+
### Changed
|
|
419
|
+
|
|
420
|
+
- 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.
|
|
421
|
+
|
|
422
|
+
## 1.4.0 - 2021-01-25
|
|
423
|
+
|
|
424
|
+
### Changed
|
|
425
|
+
|
|
426
|
+
- Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
|
|
427
|
+
|
|
428
|
+
## 1.3.0 - 2021-01-15
|
|
429
|
+
|
|
430
|
+
### Changed
|
|
431
|
+
|
|
432
|
+
- `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.
|
|
433
|
+
- `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.
|
|
434
|
+
|
|
435
|
+
## 1.2.0 - 2021-01-15
|
|
436
|
+
|
|
437
|
+
### Changed
|
|
438
|
+
|
|
439
|
+
- `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.
|
|
440
|
+
|
|
441
|
+
## 1.1.0 - 2021-01-11
|
|
442
|
+
|
|
443
|
+
### Changed
|
|
444
|
+
|
|
445
|
+
- `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.
|
|
446
|
+
- **deps:** removed dependency ajv
|
|
447
|
+
|
|
448
|
+
## <= 1.0.5 - 2020-12-07
|
|
449
|
+
|
|
450
|
+
No changelog was maintained for the earlier versions.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -134,6 +134,11 @@ export interface WidgetContext {
|
|
|
134
134
|
* Language code of currently used UI rendering language in SharePoint
|
|
135
135
|
*/
|
|
136
136
|
language: string;
|
|
137
|
+
/**
|
|
138
|
+
* Base URL of the folder the widget bundle was loaded from. Widgets can use this to
|
|
139
|
+
* fetch assets published alongside their bundle, such as per-language i18n files.
|
|
140
|
+
*/
|
|
141
|
+
assetsBaseUrl?: string;
|
|
137
142
|
/**
|
|
138
143
|
* List of supported languages as configured in Widget Board configuration
|
|
139
144
|
*/
|
|
@@ -216,6 +221,11 @@ export interface WidgetContext {
|
|
|
216
221
|
* Provide the id of the SP Group.
|
|
217
222
|
*/
|
|
218
223
|
isCurrentUserMemberOfSPGroup?: (groupId: number) => Promise<boolean>;
|
|
224
|
+
/**
|
|
225
|
+
* Returns whether or not the currently signed in user is part of a Bloom Group.
|
|
226
|
+
* Provide the id (GUID) of the Bloom Group.
|
|
227
|
+
*/
|
|
228
|
+
isCurrentUserMemberOfBloomGroup?: (groupId: string) => Promise<boolean>;
|
|
219
229
|
/**
|
|
220
230
|
* Generates a hash of all combined SP Groups of the current user. This can be used as
|
|
221
231
|
* cache invalidator to detect changes.
|
|
@@ -445,7 +455,7 @@ export interface WidgetVariantContext {
|
|
|
445
455
|
/**
|
|
446
456
|
* A list of administrators able to edit the admin configuration of this widget variant.
|
|
447
457
|
*/
|
|
448
|
-
administrators?:
|
|
458
|
+
administrators?: any[];
|
|
449
459
|
/**
|
|
450
460
|
* The icon defined for this widget variant.
|
|
451
461
|
*/
|
|
@@ -714,46 +724,6 @@ export interface WidgetDebugServeConfig {
|
|
|
714
724
|
*/
|
|
715
725
|
debugComponentType?: DebugComponentType;
|
|
716
726
|
}
|
|
717
|
-
export declare enum ICPersonaType {
|
|
718
|
-
User = 0,
|
|
719
|
-
SPGroup = 1,
|
|
720
|
-
Other = 2,
|
|
721
|
-
Custom = 3
|
|
722
|
-
}
|
|
723
|
-
export interface ICPersona {
|
|
724
|
-
displayName: string;
|
|
725
|
-
id: string;
|
|
726
|
-
type?: ICPersonaType;
|
|
727
|
-
objectId?: string;
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* Represents a SharePoint site.
|
|
731
|
-
*/
|
|
732
|
-
export interface ICSite {
|
|
733
|
-
id: string;
|
|
734
|
-
displayName?: string;
|
|
735
|
-
url?: string;
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* Represents a Microsoft Teams team.
|
|
739
|
-
*/
|
|
740
|
-
export interface ICTeam {
|
|
741
|
-
id: string;
|
|
742
|
-
displayName?: string;
|
|
743
|
-
url?: string;
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* Represents a SharePoint Taxonomy Term.
|
|
747
|
-
*/
|
|
748
|
-
export interface ICTerm {
|
|
749
|
-
id: string;
|
|
750
|
-
displayName?: string;
|
|
751
|
-
path?: string;
|
|
752
|
-
termSetId: string;
|
|
753
|
-
termSetDisplayName?: string;
|
|
754
|
-
/** Was this term checked in an indeterminate state? Used e.g. when you only want to select the term itself, not its children. */
|
|
755
|
-
isIndeterminate?: boolean;
|
|
756
|
-
}
|
|
757
727
|
/**
|
|
758
728
|
* Tells the severity of the command bar item, resulting in
|
|
759
729
|
* distinguishable presentation of the item
|
package/lib/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommandBarItemType = exports.CustomCommandBarItemSeverity = exports.
|
|
3
|
+
exports.CommandBarItemType = exports.CustomCommandBarItemSeverity = exports.DebugComponentType = void 0;
|
|
4
4
|
var DebugComponentType;
|
|
5
5
|
(function (DebugComponentType) {
|
|
6
6
|
/**
|
|
@@ -13,13 +13,6 @@ var DebugComponentType;
|
|
|
13
13
|
*/
|
|
14
14
|
DebugComponentType["AdminConfig"] = "AdminConfig";
|
|
15
15
|
})(DebugComponentType || (exports.DebugComponentType = DebugComponentType = {}));
|
|
16
|
-
var ICPersonaType;
|
|
17
|
-
(function (ICPersonaType) {
|
|
18
|
-
ICPersonaType[ICPersonaType["User"] = 0] = "User";
|
|
19
|
-
ICPersonaType[ICPersonaType["SPGroup"] = 1] = "SPGroup";
|
|
20
|
-
ICPersonaType[ICPersonaType["Other"] = 2] = "Other";
|
|
21
|
-
ICPersonaType[ICPersonaType["Custom"] = 3] = "Custom";
|
|
22
|
-
})(ICPersonaType || (exports.ICPersonaType = ICPersonaType = {}));
|
|
23
16
|
/**
|
|
24
17
|
* Tells the severity of the command bar item, resulting in
|
|
25
18
|
* distinguishable presentation of the item
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ichicraft/widgets-widget-base",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Part of the Widget Development Kit for building widgets for Bloom Intranet",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"@
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"@
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"eslint
|
|
38
|
-
"eslint-
|
|
39
|
-
"prettier": "
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@ichicraft/widgets-widget-base",
|
|
3
|
+
"version": "1.18.0",
|
|
4
|
+
"description": "Part of the Widget Development Kit for building widgets for Bloom Intranet",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc --build --force --verbose",
|
|
9
|
+
"build:watch": "tsc --build --force --verbose --watch",
|
|
10
|
+
"clean": "rimraf lib",
|
|
11
|
+
"pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\"",
|
|
12
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"ichicraft",
|
|
16
|
+
"widget",
|
|
17
|
+
"widgets"
|
|
18
|
+
],
|
|
19
|
+
"author": "Ichicraft",
|
|
20
|
+
"license": "UNLICENSED",
|
|
21
|
+
"files": [
|
|
22
|
+
"lib/**/*"
|
|
23
|
+
],
|
|
24
|
+
"overrides": {
|
|
25
|
+
"requirejs": "2.3.7",
|
|
26
|
+
"validator@<13.15.26": "13.15.26",
|
|
27
|
+
"z-schema@<5.0.5": "5.0.5"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@ichicraft/caching": "~1.0.2",
|
|
31
|
+
"@microsoft/microsoft-graph-client": "3.0.2",
|
|
32
|
+
"@microsoft/sp-http": "1.18.2",
|
|
33
|
+
"@pnp/sp": "4.0.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@ianvs/prettier-plugin-sort-imports": "4.4.1",
|
|
37
|
+
"eslint": "8.57.0",
|
|
38
|
+
"eslint-config-prettier": "9.1.0",
|
|
39
|
+
"eslint-plugin-prettier": "5.2.1",
|
|
40
|
+
"eslint-plugin-react": "7.35.2",
|
|
41
|
+
"eslint-plugin-react-hooks": "4.6.2",
|
|
42
|
+
"prettier": "3.3.3",
|
|
43
|
+
"typescript": "~5.3.3"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ICPersona, WidgetContext } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* @class
|
|
4
|
-
* Helper class for User related methods.
|
|
5
|
-
*/
|
|
6
|
-
export declare class UserHelper {
|
|
7
|
-
static isCurrentUserInScope(personas: ICPersona[], context: WidgetContext): Promise<boolean>;
|
|
8
|
-
static gatherAllNormalizedUserPersonaIds(userName: string, claimBasedLoginName: string, spGroups: number[], secGroups: string[]): string[];
|
|
9
|
-
}
|
package/lib/utils/UserHelper.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UserHelper = void 0;
|
|
13
|
-
const types_1 = require("../types");
|
|
14
|
-
/**
|
|
15
|
-
* @class
|
|
16
|
-
* Helper class for User related methods.
|
|
17
|
-
*/
|
|
18
|
-
class UserHelper {
|
|
19
|
-
static isCurrentUserInScope(personas, context) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
let userIsPartOfThis = false;
|
|
22
|
-
for (let i = 0; i < personas.length; i++) {
|
|
23
|
-
const personaItem = personas[i];
|
|
24
|
-
switch (personaItem.type) {
|
|
25
|
-
case types_1.ICPersonaType.SPGroup: {
|
|
26
|
-
const userIsMemberOfSPGroup = yield context.isCurrentUserMemberOfSPGroup(Number.parseInt(personaItem.id));
|
|
27
|
-
if (userIsMemberOfSPGroup) {
|
|
28
|
-
userIsPartOfThis = true;
|
|
29
|
-
}
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
case types_1.ICPersonaType.User: {
|
|
33
|
-
// handle a username exact match and partial match in case picker is in format 'i:0#.f|membership|USERNAME'
|
|
34
|
-
if (personaItem.id.toLowerCase() === context.userName.toLowerCase() ||
|
|
35
|
-
personaItem.id.toLowerCase() ===
|
|
36
|
-
context.claimBasedLoginName.toLowerCase() ||
|
|
37
|
-
(personaItem.id.indexOf('|') > -1 &&
|
|
38
|
-
personaItem.id
|
|
39
|
-
.toLowerCase()
|
|
40
|
-
.endsWith('|' + context.userName.toLowerCase()))) {
|
|
41
|
-
userIsPartOfThis = true;
|
|
42
|
-
}
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
case types_1.ICPersonaType.Other:
|
|
46
|
-
case null: {
|
|
47
|
-
let personaItemId = personaItem.id;
|
|
48
|
-
// Check if this is the infamous "Everyone except external users" group,
|
|
49
|
-
// in which case we need special treatment to check if the user is internal
|
|
50
|
-
if (personaItemId.indexOf('c:0-.f|rolemanager|spo-grid-all-users/') === 0) {
|
|
51
|
-
// There you have it: we need special treatment.
|
|
52
|
-
// If this is an external user, break, otherwise, assume user is member of group
|
|
53
|
-
if (context.claimBasedLoginName.toLocaleLowerCase().indexOf('#ext#') === -1) {
|
|
54
|
-
// This is an internal user and thus a member of the group
|
|
55
|
-
userIsPartOfThis = true;
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
// Check if the id of the picker item contains a pipe, this means we need to strip the id
|
|
60
|
-
if (personaItemId.indexOf('|') > -1) {
|
|
61
|
-
personaItemId = personaItemId.split('|').slice(-1)[0];
|
|
62
|
-
}
|
|
63
|
-
const userIsMemberOfSecGroup = yield context.isCurrentUserMemberOfSecGroup(personaItemId);
|
|
64
|
-
if (userIsMemberOfSecGroup) {
|
|
65
|
-
userIsPartOfThis = true;
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (userIsPartOfThis)
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
return userIsPartOfThis;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
static gatherAllNormalizedUserPersonaIds(userName, claimBasedLoginName, spGroups, secGroups) {
|
|
77
|
-
const personas = [];
|
|
78
|
-
// 1. The user name in two known shapes
|
|
79
|
-
personas.push(`USER|${userName.toLowerCase()}`);
|
|
80
|
-
personas.push(`USER|${claimBasedLoginName.toLowerCase()}`);
|
|
81
|
-
// 2. The SP Groups, just as they are: numeric strings
|
|
82
|
-
spGroups.forEach((spg) => {
|
|
83
|
-
personas.push(`SPGROUP|${spg}`);
|
|
84
|
-
});
|
|
85
|
-
// 3. The Security Groups, as Guids
|
|
86
|
-
secGroups.forEach((secg) => {
|
|
87
|
-
personas.push(`ADGROUP|${secg.toLowerCase()}`);
|
|
88
|
-
});
|
|
89
|
-
// 4. Optionally the all users except external users group:
|
|
90
|
-
if (claimBasedLoginName.indexOf('#ext#') === -1) {
|
|
91
|
-
// This is an internal user
|
|
92
|
-
personas.push('ADGROUP|spo-grid-all-users');
|
|
93
|
-
}
|
|
94
|
-
return personas;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
exports.UserHelper = UserHelper;
|