@ichicraft/widgets-widget-base 1.9.2 → 1.9.3

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,200 +1,200 @@
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.9.2 - 2024-03-21
13
-
14
- - Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
15
- - Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
16
- - Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
17
- - Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
18
- - Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
19
-
20
- ## 1.9.1 - 2023-10-20
21
-
22
- - Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
23
- - Added `WidgetVariantContext` interface, to allow typing the `definition` property of the `WidgetContext` interface.
24
- - Added `WidgetManifestContext` interface, to allow typing the `manifest` property of the `WidgetContext` interface.
25
-
26
- ## 1.9.0 - 2023-10-20
27
-
28
- - Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
29
- - Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
30
- - Added new exported `ExportData` type.
31
-
32
- ## 1.8.17 - 2023-10-09
33
-
34
- - Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
35
-
36
- ## 1.8.16 - 2023-09-26
37
-
38
- - Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
39
-
40
- ## 1.8.15 - 2023-09-01
41
-
42
- - Added `thumbnailUrl` property to `WidgetManifestConfig` interface, as a non-translatable substitute of the newly deprecated `preview_small` property from `WidgetImages` interface.
43
- - Removed the deprecated `preview_small` property from `WidgetImages` interface.
44
-
45
- ## 1.8.14 - 2023-09-01
46
-
47
- - Added `iconName` property to `WidgetManifestConfig` interface, to support using an icon to represent a widget, e.g. in the widget library or widget header.
48
- - Removed the deprecated `notificationIcon` property from `WidgetManifestConfig` interface.
49
-
50
- ## 1.8.13 - 2023-06-08
51
-
52
- - Removed the deprecated `resolved` property from `ICPersona` interface
53
-
54
- ## 1.8.12 - 2023-04-04
55
-
56
- - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
57
-
58
- ## 1.8.11 - 2023-04-03
59
-
60
- - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
61
-
62
- ## 1.8.10 - 2023-03-30
63
-
64
- - Changed `openFilePicker` function to accept `options`, to support configuration of picker behavior
65
-
66
- ## 1.8.9 - 2023-03-06
67
-
68
- - Added `registerCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support multiple custom buttons in the widget header.
69
- - Added `unregisterCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support removing all custom buttons in the widget header.
70
- - Added optional `id` property to exported `CustomCommandBarItemProps` type, to support removing a custom command bar item by id.
71
- - Added optional `pinned` property to exported `CustomCommandBarItemProps` type, to support forcing the widget header to always be visible.
72
- - Added optional `showNotificationBadge` property to exported `CustomCommandBarItemProps` type, to support showing a red notification badge over the custom command bar item.
73
- - Added optional `order` property to exported `CustomCommandBarItemProps` type, to support changing the order of custom command bar items.
74
- - Changed `unregisterCustomCommandBarItem` function of the `instance` object of the `WidgetContext` interface, to support removing a custom command bar item by id.
75
-
76
- ## 1.8.8 - 2023-02-16
77
-
78
- - Removed all SharePoint and Teams dependencies.
79
-
80
- ## 1.8.7 - 2022-12-13
81
-
82
- - Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
83
- - Added new exported `UserRole` type.
84
-
85
- ## 1.8.6 - 2022-12-08
86
-
87
- - Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
88
- - 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.
89
- - Added new exported `BoardType` type.
90
-
91
- ## 1.8.5 - 2022-09-30
92
-
93
- - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
94
- - Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
95
- - Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
96
- - Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
97
-
98
- ## 1.8.4 - 2022-09-05
99
-
100
- - 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.
101
-
102
- ## 1.8.3 - 2022-08-16
103
-
104
- - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
105
-
106
- ## 1.8.2 - 2022-07-06
107
-
108
- - Added `subtitle` property to the `WidgetResource` interface.
109
-
110
- ## 1.8.1 - 2022-06-17
111
-
112
- - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
113
- - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
114
-
115
- ## 1.7.11 - 2022-03-23
116
-
117
- - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
118
-
119
- ## 1.7.9 - 2022-01-20
120
-
121
- - Added `userAccountCreated` date/time to the `WidgetContext` interface.
122
-
123
- ## 1.7.8 - 2022-01-18
124
-
125
- ### Changed
126
-
127
- - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
128
-
129
- ## 1.7.7 - 2022-01-14
130
-
131
- ### Changed
132
-
133
- - Added `tenantId` property to the `WidgetContext` interface.
134
-
135
- ## 1.7.6 - 2021-11-04
136
-
137
- ### Changed
138
-
139
- - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
140
-
141
- ## 1.7.5 - 2021-10-26
142
-
143
- ### Changed
144
-
145
- - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
146
-
147
- ## 1.7.4 - 2021-10-20
148
-
149
- ### Changed
150
-
151
- - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
152
-
153
- ## 1.7.3 - 2021-10-04
154
-
155
- ### Changed
156
-
157
- - 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.
158
- - 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.
159
-
160
- ## 1.6.1 - 2021-02-18
161
-
162
- ### Changed
163
-
164
- - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
165
-
166
- ## 1.5.0 - 2021-02-16
167
-
168
- ### Changed
169
-
170
- - 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.
171
-
172
- ## 1.4.0 - 2021-01-25
173
-
174
- ### Changed
175
-
176
- - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
177
-
178
- ## 1.3.0 - 2021-01-15
179
-
180
- ### Changed
181
-
182
- - `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.
183
- - `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.
184
-
185
- ## 1.2.0 - 2021-01-15
186
-
187
- ### Changed
188
-
189
- - `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.
190
-
191
- ## 1.1.0 - 2021-01-11
192
-
193
- ### Changed
194
-
195
- - `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.
196
- - **deps:** removed dependency ajv
197
-
198
- ## <= 1.0.5 - 2020-12-07
199
-
200
- 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.9.2 - 2024-03-21
13
+
14
+ - Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
15
+ - Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
16
+ - Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
17
+ - Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
18
+ - Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
19
+
20
+ ## 1.9.1 - 2023-10-20
21
+
22
+ - Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
23
+ - Added `WidgetVariantContext` interface, to allow typing the `definition` property of the `WidgetContext` interface.
24
+ - Added `WidgetManifestContext` interface, to allow typing the `manifest` property of the `WidgetContext` interface.
25
+
26
+ ## 1.9.0 - 2023-10-20
27
+
28
+ - Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
29
+ - Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
30
+ - Added new exported `ExportData` type.
31
+
32
+ ## 1.8.17 - 2023-10-09
33
+
34
+ - Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
35
+
36
+ ## 1.8.16 - 2023-09-26
37
+
38
+ - Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
39
+
40
+ ## 1.8.15 - 2023-09-01
41
+
42
+ - Added `thumbnailUrl` property to `WidgetManifestConfig` interface, as a non-translatable substitute of the newly deprecated `preview_small` property from `WidgetImages` interface.
43
+ - Removed the deprecated `preview_small` property from `WidgetImages` interface.
44
+
45
+ ## 1.8.14 - 2023-09-01
46
+
47
+ - Added `iconName` property to `WidgetManifestConfig` interface, to support using an icon to represent a widget, e.g. in the widget library or widget header.
48
+ - Removed the deprecated `notificationIcon` property from `WidgetManifestConfig` interface.
49
+
50
+ ## 1.8.13 - 2023-06-08
51
+
52
+ - Removed the deprecated `resolved` property from `ICPersona` interface
53
+
54
+ ## 1.8.12 - 2023-04-04
55
+
56
+ - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
57
+
58
+ ## 1.8.11 - 2023-04-03
59
+
60
+ - Changed `openFilePicker` function to return more details of the picked file in the shape of `FilePickerFileProps`
61
+
62
+ ## 1.8.10 - 2023-03-30
63
+
64
+ - Changed `openFilePicker` function to accept `options`, to support configuration of picker behavior
65
+
66
+ ## 1.8.9 - 2023-03-06
67
+
68
+ - Added `registerCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support multiple custom buttons in the widget header.
69
+ - Added `unregisterCustomCommandBarItems` function to the `instance` object of the `WidgetContext` interface, to support removing all custom buttons in the widget header.
70
+ - Added optional `id` property to exported `CustomCommandBarItemProps` type, to support removing a custom command bar item by id.
71
+ - Added optional `pinned` property to exported `CustomCommandBarItemProps` type, to support forcing the widget header to always be visible.
72
+ - Added optional `showNotificationBadge` property to exported `CustomCommandBarItemProps` type, to support showing a red notification badge over the custom command bar item.
73
+ - Added optional `order` property to exported `CustomCommandBarItemProps` type, to support changing the order of custom command bar items.
74
+ - Changed `unregisterCustomCommandBarItem` function of the `instance` object of the `WidgetContext` interface, to support removing a custom command bar item by id.
75
+
76
+ ## 1.8.8 - 2023-02-16
77
+
78
+ - Removed all SharePoint and Teams dependencies.
79
+
80
+ ## 1.8.7 - 2022-12-13
81
+
82
+ - Added `userRoles` property to the `WidgetContext` interface, to inform widgets of the roles of the current user.
83
+ - Added new exported `UserRole` type.
84
+
85
+ ## 1.8.6 - 2022-12-08
86
+
87
+ - Added `boardType` property to the `instance` object of the `WidgetContext` interface, to inform widgets of the type of their board.
88
+ - 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.
89
+ - Added new exported `BoardType` type.
90
+
91
+ ## 1.8.5 - 2022-09-30
92
+
93
+ - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
94
+ - Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
95
+ - Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
96
+ - Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
97
+
98
+ ## 1.8.4 - 2022-09-05
99
+
100
+ - 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.
101
+
102
+ ## 1.8.3 - 2022-08-16
103
+
104
+ - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
105
+
106
+ ## 1.8.2 - 2022-07-06
107
+
108
+ - Added `subtitle` property to the `WidgetResource` interface.
109
+
110
+ ## 1.8.1 - 2022-06-17
111
+
112
+ - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
113
+ - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
114
+
115
+ ## 1.7.11 - 2022-03-23
116
+
117
+ - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
118
+
119
+ ## 1.7.9 - 2022-01-20
120
+
121
+ - Added `userAccountCreated` date/time to the `WidgetContext` interface.
122
+
123
+ ## 1.7.8 - 2022-01-18
124
+
125
+ ### Changed
126
+
127
+ - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
128
+
129
+ ## 1.7.7 - 2022-01-14
130
+
131
+ ### Changed
132
+
133
+ - Added `tenantId` property to the `WidgetContext` interface.
134
+
135
+ ## 1.7.6 - 2021-11-04
136
+
137
+ ### Changed
138
+
139
+ - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
140
+
141
+ ## 1.7.5 - 2021-10-26
142
+
143
+ ### Changed
144
+
145
+ - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
146
+
147
+ ## 1.7.4 - 2021-10-20
148
+
149
+ ### Changed
150
+
151
+ - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
152
+
153
+ ## 1.7.3 - 2021-10-04
154
+
155
+ ### Changed
156
+
157
+ - 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.
158
+ - 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.
159
+
160
+ ## 1.6.1 - 2021-02-18
161
+
162
+ ### Changed
163
+
164
+ - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
165
+
166
+ ## 1.5.0 - 2021-02-16
167
+
168
+ ### Changed
169
+
170
+ - 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.
171
+
172
+ ## 1.4.0 - 2021-01-25
173
+
174
+ ### Changed
175
+
176
+ - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
177
+
178
+ ## 1.3.0 - 2021-01-15
179
+
180
+ ### Changed
181
+
182
+ - `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.
183
+ - `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.
184
+
185
+ ## 1.2.0 - 2021-01-15
186
+
187
+ ### Changed
188
+
189
+ - `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.
190
+
191
+ ## 1.1.0 - 2021-01-11
192
+
193
+ ### Changed
194
+
195
+ - `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.
196
+ - **deps:** removed dependency ajv
197
+
198
+ ## <= 1.0.5 - 2020-12-07
199
+
200
+ No changelog was maintained for the earlier versions.
package/lib/.DS_Store ADDED
Binary file
@@ -1,18 +1,18 @@
1
- import { WidgetContext, ValidationResult, ExportData } from './types';
2
- export default abstract class BaseWidget {
3
- protected readonly context: WidgetContext;
4
- constructor(context: WidgetContext);
5
- protected onInit(): Promise<void>;
6
- abstract render(domElement: HTMLDivElement): void;
7
- verifyPersistedUserConfiguration?(config: string): Promise<boolean>;
8
- renderUserConfigurationForm?(domElement: HTMLDivElement): void;
9
- validateUserConfigurationForm?(): ValidationResult;
10
- getSerializedUserConfiguration?(): string;
11
- verifyPersistedAdminConfiguration?(config: string): Promise<boolean>;
12
- renderAdminConfigurationForm?(domElement: HTMLDivElement): void;
13
- validateAdminConfigurationForm?(): ValidationResult;
14
- getSerializedAdminConfiguration?(): string;
15
- importData?(exportData: ExportData): Promise<void>;
16
- exportData?(): Promise<ExportData>;
17
- cleanupResources?(): void;
18
- }
1
+ import { WidgetContext, ValidationResult, ExportData } from './types';
2
+ export default abstract class BaseWidget {
3
+ protected readonly context: WidgetContext;
4
+ constructor(context: WidgetContext);
5
+ protected onInit(): Promise<void>;
6
+ abstract render(domElement: HTMLDivElement): void;
7
+ verifyPersistedUserConfiguration?(config: string): Promise<boolean>;
8
+ renderUserConfigurationForm?(domElement: HTMLDivElement): void;
9
+ validateUserConfigurationForm?(): ValidationResult;
10
+ getSerializedUserConfiguration?(): string;
11
+ verifyPersistedAdminConfiguration?(config: string): Promise<boolean>;
12
+ renderAdminConfigurationForm?(domElement: HTMLDivElement): void;
13
+ validateAdminConfigurationForm?(): ValidationResult;
14
+ getSerializedAdminConfiguration?(): string;
15
+ importData?(exportData: ExportData): Promise<void>;
16
+ exportData?(): Promise<ExportData>;
17
+ cleanupResources?(): void;
18
+ }
package/lib/BaseWidget.js CHANGED
@@ -1,51 +1,51 @@
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
- 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;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var BaseWidget = /** @class */ (function () {
40
- function BaseWidget(context) {
41
- this.context = context;
42
- this.onInit();
43
- }
44
- BaseWidget.prototype.onInit = function () {
45
- return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
46
- return [2 /*return*/];
47
- }); });
48
- };
49
- return BaseWidget;
50
- }());
51
- exports.default = BaseWidget;
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
+ 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;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var BaseWidget = /** @class */ (function () {
40
+ function BaseWidget(context) {
41
+ this.context = context;
42
+ this.onInit();
43
+ }
44
+ BaseWidget.prototype.onInit = function () {
45
+ return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
46
+ return [2 /*return*/];
47
+ }); });
48
+ };
49
+ return BaseWidget;
50
+ }());
51
+ exports.default = BaseWidget;
package/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { default as BaseWidget } from './BaseWidget';
2
- export * from './types';
1
+ export { default as BaseWidget } from './BaseWidget';
2
+ export * from './types';
3
+ export { AadTokenProviderFactory, AadTokenProvider } from '@microsoft/sp-http';
package/lib/index.js CHANGED
@@ -1,8 +1,26 @@
1
- "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var BaseWidget_1 = require("./BaseWidget");
7
- exports.BaseWidget = BaseWidget_1.default;
8
- __export(require("./types"));
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.AadTokenProvider = exports.AadTokenProviderFactory = exports.BaseWidget = void 0;
21
+ var BaseWidget_1 = require("./BaseWidget");
22
+ Object.defineProperty(exports, "BaseWidget", { enumerable: true, get: function () { return __importDefault(BaseWidget_1).default; } });
23
+ __exportStar(require("./types"), exports);
24
+ var sp_http_1 = require("@microsoft/sp-http");
25
+ Object.defineProperty(exports, "AadTokenProviderFactory", { enumerable: true, get: function () { return sp_http_1.AadTokenProviderFactory; } });
26
+ Object.defineProperty(exports, "AadTokenProvider", { enumerable: true, get: function () { return sp_http_1.AadTokenProvider; } });