@ichicraft/widgets-widget-base 1.8.1 → 1.8.4

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
@@ -3,71 +3,112 @@ This package supports development of widgets built using the Widget Development
3
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
4
 
5
5
  # Changelog
6
+
6
7
  All notable changes to this project will be documented here.
7
8
 
8
9
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
9
10
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10
11
 
12
+ ## 1.8.4 - 2022-09-05
13
+
14
+ - 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.
15
+
16
+ ## 1.8.3 - 2022-08-16
17
+
18
+ - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
19
+
20
+ ## 1.8.2 - 2022-07-06
21
+
22
+ - Added `subtitle` property to the `WidgetResource` interface.
23
+
11
24
  ## 1.8.1 - 2022-06-17
12
- * Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
13
- * Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
25
+
26
+ - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
27
+ - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
14
28
 
15
29
  ## 1.7.11 - 2022-03-23
16
- * Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
30
+
31
+ - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
17
32
 
18
33
  ## 1.7.9 - 2022-01-20
19
- * Added `userAccountCreated` date/time to the `WidgetContext` interface.
34
+
35
+ - Added `userAccountCreated` date/time to the `WidgetContext` interface.
20
36
 
21
37
  ## 1.7.8 - 2022-01-18
38
+
22
39
  ### Changed
23
- * Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
40
+
41
+ - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
24
42
 
25
43
  ## 1.7.7 - 2022-01-14
44
+
26
45
  ### Changed
27
- * Added `tenantId` property to the `WidgetContext` interface.
46
+
47
+ - Added `tenantId` property to the `WidgetContext` interface.
28
48
 
29
49
  ## 1.7.6 - 2021-11-04
50
+
30
51
  ### Changed
31
- * Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
52
+
53
+ - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
32
54
 
33
55
  ## 1.7.5 - 2021-10-26
56
+
34
57
  ### Changed
35
- * Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
58
+
59
+ - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
36
60
 
37
61
  ## 1.7.4 - 2021-10-20
62
+
38
63
  ### Changed
39
- * Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
64
+
65
+ - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
40
66
 
41
67
  ## 1.7.3 - 2021-10-04
68
+
42
69
  ### Changed
43
- * 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.
44
- * 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.
70
+
71
+ - 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.
72
+ - 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.
45
73
 
46
74
  ## 1.6.1 - 2021-02-18
75
+
47
76
  ### Changed
48
- * Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
77
+
78
+ - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
49
79
 
50
80
  ## 1.5.0 - 2021-02-16
81
+
51
82
  ### Changed
52
- * 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.
83
+
84
+ - 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.
53
85
 
54
86
  ## 1.4.0 - 2021-01-25
87
+
55
88
  ### Changed
56
- * Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
89
+
90
+ - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
57
91
 
58
92
  ## 1.3.0 - 2021-01-15
93
+
59
94
  ### Changed
60
- * `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.
61
- * `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.
95
+
96
+ - `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.
97
+ - `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.
62
98
 
63
99
  ## 1.2.0 - 2021-01-15
100
+
64
101
  ### Changed
65
- * `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.
102
+
103
+ - `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.
66
104
 
67
105
  ## 1.1.0 - 2021-01-11
106
+
68
107
  ### Changed
69
- * `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.
70
- * **deps:** removed dependency ajv
108
+
109
+ - `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.
110
+ - **deps:** removed dependency ajv
71
111
 
72
112
  ## <= 1.0.5 - 2020-12-07
73
- No changelog was maintained for the earlier versions.
113
+
114
+ No changelog was maintained for the earlier versions.
@@ -38,7 +38,7 @@ export interface WidgetContext {
38
38
  */
39
39
  initiateWidgetDeletion?: () => void;
40
40
  /**
41
- * Functionality offered by the widget board to open a url in an iframe dialog.
41
+ * @deprecated Functionality offered by the widget board to open a url in an iframe dialog.
42
42
  */
43
43
  openUrlInDialog?: (url: string, onDismissed?: () => void) => void;
44
44
  /**
@@ -249,13 +249,23 @@ export interface WidgetContext {
249
249
  /**
250
250
  * Call this function from within one of the applicable render methods in case of an unresolvable error.
251
251
  * The widgetboard will render a 'disrupted' message and in case of an error in widget rendering it
252
- * offers the user the option to delete the widget from the board
252
+ * offers the user the option to delete the widget from the board.
253
253
  */
254
254
  handleFatalError?: () => void;
255
255
  /**
256
- * Functionality offered by the widget board to load a script using SPComponentLoader
256
+ * Functionality offered by the widget board to load a script using SPComponentLoader.
257
257
  */
258
258
  loadScript?: <TModule>(url: string, options?: any) => Promise<TModule>;
259
+ /**
260
+ * Functionality offered by the widget board to open a File Picker panel to select files.
261
+ */
262
+ openFilePicker?: (onFilePicked: (fileUrl: string) => void, onCancel?: () => void) => void;
263
+ /**
264
+ * Functionality offered by the widget board to open a url in an iframe dialog.
265
+ * @param url The url to open in a dialog.
266
+ * @param options Options to configure the dialog (e.g. size, margin, callbacks, ...)
267
+ */
268
+ openIFrameDialog?: (url: string, options?: IFrameDialogOptions) => void;
259
269
  /**
260
270
  * Provides access to the Teams SDK and Teams context. Only provided when the web part is loaded in Teams.
261
271
  */
@@ -282,6 +292,7 @@ export interface WidgetImages {
282
292
  export interface WidgetResource {
283
293
  lang: number;
284
294
  title: string;
295
+ subtitle?: string;
285
296
  shortDescription: string;
286
297
  instructions: string;
287
298
  images: WidgetImages;
@@ -513,3 +524,28 @@ export interface CustomCommandBarItemProps {
513
524
  */
514
525
  onClick?: () => void;
515
526
  }
527
+ /**
528
+ * Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
529
+ */
530
+ export interface IFrameDialogOptions {
531
+ /**
532
+ * Maximum width of the dialog. If it exceeds the window width, that width is used instead.
533
+ */
534
+ maxWidth?: number;
535
+ /**
536
+ * Maximum height of the dialog. If it exceeds the window height, that height is used instead.
537
+ */
538
+ maxHeight?: number;
539
+ /**
540
+ * Minimum margin on the left- and right side of the dialog.
541
+ */
542
+ marginHorizontal?: number;
543
+ /**
544
+ * Minimum margin on the top- and bottom side of the dialog.
545
+ */
546
+ marginVertical?: number;
547
+ /**
548
+ * This event is triggered when the iFrame dialog is dismissed by the user.
549
+ */
550
+ onDismissed?: () => void;
551
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.8.1",
3
+ "version": "1.8.4",
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",