@ichicraft/widgets-widget-base 1.8.3 → 1.8.5

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,77 +3,119 @@ 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.5 - 2022-09-30
13
+
14
+ - Added `setWidgetTitleSuffix()` function to the `instance` object of the `WidgetContext` interface, to support appending the title of the widget with additional text.
15
+ - Added `setWidgetSubtitle()` function to the `instance` object of the `WidgetContext` interface, to support overriding the subtitle of the widget.
16
+ - Added `setUserConfigButtonVisibilty()` function to the `instance` object of the `WidgetContext` interface, to support hiding the settings button from the widget header.
17
+ - Fixed spelling of `setWidgetHeaderVisibilty()` function. The function is now called `setWidgetHeaderVisibility()`.
18
+
19
+ ## 1.8.4 - 2022-09-05
20
+
21
+ - 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.
22
+
11
23
  ## 1.8.3 - 2022-08-16
12
- * Added `openFilePicker` property to the `WidgetContext` interface to support file selection from within a widget.
24
+
25
+ - Added `openFilePicker()` function to the `WidgetContext` interface to support file selection from within a widget.
13
26
 
14
27
  ## 1.8.2 - 2022-07-06
15
- * Added `subtitle` property to the `WidgetResource` interface.
28
+
29
+ - Added `subtitle` property to the `WidgetResource` interface.
16
30
 
17
31
  ## 1.8.1 - 2022-06-17
18
- * Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
19
- * Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
32
+
33
+ - Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
34
+ - Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
20
35
 
21
36
  ## 1.7.11 - 2022-03-23
22
- * Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
37
+
38
+ - Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
23
39
 
24
40
  ## 1.7.9 - 2022-01-20
25
- * Added `userAccountCreated` date/time to the `WidgetContext` interface.
41
+
42
+ - Added `userAccountCreated` date/time to the `WidgetContext` interface.
26
43
 
27
44
  ## 1.7.8 - 2022-01-18
45
+
28
46
  ### Changed
29
- * Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
47
+
48
+ - Added `initiateWidgetDeletion()` function to the `WidgetContext` interface.
30
49
 
31
50
  ## 1.7.7 - 2022-01-14
51
+
32
52
  ### Changed
33
- * Added `tenantId` property to the `WidgetContext` interface.
53
+
54
+ - Added `tenantId` property to the `WidgetContext` interface.
34
55
 
35
56
  ## 1.7.6 - 2021-11-04
57
+
36
58
  ### Changed
37
- * Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
59
+
60
+ - Added `theme` property to the `WidgetContext` interface to give access to currently applied theme.
38
61
 
39
62
  ## 1.7.5 - 2021-10-26
63
+
40
64
  ### Changed
41
- * Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
65
+
66
+ - Added `userSecurityGroups` and `userSharePointGroups` properties to the `WidgetContext` interface to inform widgets of SharePoint and security group memberships of the current user.
42
67
 
43
68
  ## 1.7.4 - 2021-10-20
69
+
44
70
  ### Changed
45
- * Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
71
+
72
+ - Added `contentLanguages` property to the `WidgetContext` interface to inform widgets of the available content languages as configured in Ichicraft Boards.
46
73
 
47
74
  ## 1.7.3 - 2021-10-04
75
+
48
76
  ### Changed
49
- * 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.
50
- * 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.
77
+
78
+ - 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.
79
+ - 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.
51
80
 
52
81
  ## 1.6.1 - 2021-02-18
82
+
53
83
  ### Changed
54
- * Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
84
+
85
+ - Added `userEmail` property to the `WidgetContext` interface to provide current user's email address to widgets.
55
86
 
56
87
  ## 1.5.0 - 2021-02-16
88
+
57
89
  ### Changed
58
- * 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.
90
+
91
+ - 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.
59
92
 
60
93
  ## 1.4.0 - 2021-01-25
94
+
61
95
  ### Changed
62
- * Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
96
+
97
+ - Added several properties to the `WidgetContext` interface to identify the context in which the widget is shown (e.g. Team Browser hosted)
63
98
 
64
99
  ## 1.3.0 - 2021-01-15
100
+
65
101
  ### Changed
66
- * `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.
67
- * `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.
102
+
103
+ - `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.
104
+ - `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.
68
105
 
69
106
  ## 1.2.0 - 2021-01-15
107
+
70
108
  ### Changed
71
- * `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.
109
+
110
+ - `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.
72
111
 
73
112
  ## 1.1.0 - 2021-01-11
113
+
74
114
  ### Changed
75
- * `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.
76
- * **deps:** removed dependency ajv
115
+
116
+ - `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.
117
+ - **deps:** removed dependency ajv
77
118
 
78
119
  ## <= 1.0.5 - 2020-12-07
79
- No changelog was maintained for the earlier versions.
120
+
121
+ No changelog was maintained for the earlier versions.
@@ -38,19 +38,27 @@ 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
+ * Functionality offered by the widget board to change the title of the widget.
42
42
  */
43
- openUrlInDialog?: (url: string, onDismissed?: () => void) => void;
43
+ setWidgetTitle?: (title: string) => void;
44
44
  /**
45
- * Functionality offered by the widget board to change the title of the widget
45
+ * Functionality offered by the widget board to append the title of the widget with additional text.
46
46
  */
47
- setWidgetTitle?: (title: string) => void;
47
+ setWidgetTitleSuffix?: (suffix: string) => void;
48
+ /**
49
+ * Functionality offered by the widget board to change the subtitle of the widget.
50
+ */
51
+ setWidgetSubtitle?: (subtitle: string) => void;
52
+ /**
53
+ * Show or hide the header of the widget, allowing widgets to take control of full widget real estate.
54
+ */
55
+ setWidgetHeaderVisibility?: (visible: boolean) => void;
48
56
  /**
49
- * Show or hide the header of the widget, allowing widgets to take control of full widget real estate
57
+ * Show or hide the settings button of the widget.
50
58
  */
51
- setWidgetHeaderVisibilty?: (visible: boolean) => void;
59
+ setUserConfigButtonVisibility?: (visible: boolean) => void;
52
60
  /**
53
- * Optional callback to handle the click event of the widget title
61
+ * Optional callback to handle the click event of the widget title.
54
62
  */
55
63
  onWidgetTitleClicked?: () => void;
56
64
  /**
@@ -260,6 +268,12 @@ export interface WidgetContext {
260
268
  * Functionality offered by the widget board to open a File Picker panel to select files.
261
269
  */
262
270
  openFilePicker?: (onFilePicked: (fileUrl: string) => void, onCancel?: () => void) => void;
271
+ /**
272
+ * Functionality offered by the widget board to open a url in an iframe dialog.
273
+ * @param url The url to open in a dialog.
274
+ * @param options Options to configure the dialog (e.g. size, margin, callbacks, ...)
275
+ */
276
+ openIFrameDialog?: (url: string, options?: IFrameDialogOptions) => void;
263
277
  /**
264
278
  * Provides access to the Teams SDK and Teams context. Only provided when the web part is loaded in Teams.
265
279
  */
@@ -518,3 +532,28 @@ export interface CustomCommandBarItemProps {
518
532
  */
519
533
  onClick?: () => void;
520
534
  }
535
+ /**
536
+ * Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
537
+ */
538
+ export interface IFrameDialogOptions {
539
+ /**
540
+ * Maximum width of the dialog. If it exceeds the window width, that width is used instead.
541
+ */
542
+ maxWidth?: number;
543
+ /**
544
+ * Maximum height of the dialog. If it exceeds the window height, that height is used instead.
545
+ */
546
+ maxHeight?: number;
547
+ /**
548
+ * Minimum margin on the left- and right side of the dialog.
549
+ */
550
+ marginHorizontal?: number;
551
+ /**
552
+ * Minimum margin on the top- and bottom side of the dialog.
553
+ */
554
+ marginVertical?: number;
555
+ /**
556
+ * This event is triggered when the iFrame dialog is dismissed by the user.
557
+ */
558
+ onDismissed?: () => void;
559
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.8.3",
3
+ "version": "1.8.5",
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",