@ichicraft/widgets-widget-base 1.9.10 → 1.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,6 +9,16 @@ All notable changes to this project will be documented here.
9
9
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10
10
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
+ ## 1.9.12 - 2024-06-17
13
+
14
+ - Added `sp` object to `WidgetContext` interface, to allow using a centralized PnPjs version across all widgets.
15
+ - Added `siteId` property to `WidgetContext` interface.
16
+ - Added `boardsInstanceId` property to `WidgetContext` interface.
17
+
18
+ ## 1.9.11 - 2024-06-14
19
+
20
+ - Fixed handling of null `ICPersonaType` values in `isCurrentUserInScope` function of `UserHelper` class.
21
+
12
22
  ## 1.9.10 - 2024-06-04
13
23
 
14
24
  - Renamed `CustomCommandBarItemProps` interface to `CommandBarItemProps`.
@@ -1,4 +1,5 @@
1
1
  import type { AadHttpClientFactory, AadTokenProviderFactory } from '@microsoft/sp-http';
2
+ import type { SPFI } from '@pnp/sp/fi';
2
3
  export type { AadTokenProviderFactory, AadTokenProvider, AadHttpClientFactory, AadHttpClient, AadHttpClientConfiguration, AadHttpClientResponse, } from '@microsoft/sp-http';
3
4
  /**
4
5
  * Widget context providing widget metadata and functionality offered by the widget board
@@ -21,6 +22,10 @@ export interface WidgetContext {
21
22
  * can exist in a widget board configuration.
22
23
  */
23
24
  manifest: WidgetManifestContext;
25
+ /**
26
+ * Interacts with the SharePoint REST api, such as fetching/updating sites, lists and users.
27
+ */
28
+ sp: SPFI;
24
29
  /**
25
30
  * Tells whether the widget board is running in a Teams context
26
31
  */
@@ -54,19 +59,27 @@ export interface WidgetContext {
54
59
  */
55
60
  isMobileWebView: boolean;
56
61
  /**
57
- * Tenant ID of current SharePoint tenant
62
+ * Tenant ID of current SharePoint tenant.
58
63
  */
59
64
  tenantId: string;
60
65
  /**
61
- * Site url of the site where the widget board is running
66
+ * ID of current Ichicraft Boards installation. Could either be a Site Collection ID (SP Shell) or a fixed ID (Teams Shell)
67
+ */
68
+ boardsInstanceId: string;
69
+ /**
70
+ * Site ID of the SharePoint site where the widget board is running
71
+ */
72
+ siteId: string;
73
+ /**
74
+ * Site url of the SharePoint site where the widget board is running
62
75
  */
63
76
  siteUrl: string;
64
77
  /**
65
- * User name of the currently signed in user.
78
+ * User name of the currently signed in user
66
79
  */
67
80
  userName: string;
68
81
  /**
69
- * The email address for the current user.
82
+ * The email address for the current user
70
83
  *
71
84
  * @remarks
72
85
  * Example: `"example@contoso.com"`
@@ -62,6 +62,7 @@ var UserHelper = /** @class */ (function () {
62
62
  case types_1.ICPersonaType.SPGroup: return [3 /*break*/, 2];
63
63
  case types_1.ICPersonaType.User: return [3 /*break*/, 4];
64
64
  case types_1.ICPersonaType.Other: return [3 /*break*/, 5];
65
+ case null: return [3 /*break*/, 5];
65
66
  }
66
67
  return [3 /*break*/, 7];
67
68
  case 2: return [4 /*yield*/, context.isCurrentUserMemberOfSPGroup(Number.parseInt(personaItem.id))];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.9.10",
3
+ "version": "1.9.12",
4
4
  "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -19,7 +19,8 @@
19
19
  "lib/**/*"
20
20
  ],
21
21
  "dependencies": {
22
- "@microsoft/sp-http": "1.18.2"
22
+ "@microsoft/sp-http": "1.18.2",
23
+ "@pnp/sp": "4.0.1"
23
24
  },
24
25
  "devDependencies": {
25
26
  "typescript": "^5.4.5"