@ichicraft/widgets-widget-base 1.9.8 → 1.9.10
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 +13 -0
- package/lib/types/index.d.ts +31 -36
- package/lib/types/index.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,19 @@ 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.10 - 2024-06-04
|
|
13
|
+
|
|
14
|
+
- Renamed `CustomCommandBarItemProps` interface to `CommandBarItemProps`.
|
|
15
|
+
- Merged `CommandBarIcon`, `CommandBarLink` and `CommandBarItemBase` interfaces into the `CommandBarItemProps` interface, to simplify adding custom command bar items.
|
|
16
|
+
- Added `Overflow` type to `CommandBarItemType` enum, to allow rendering an item inside the overflow menu.
|
|
17
|
+
- Added `highlighted` property to the `CommandBarItemProps` interface, to allow rendering an item as if it is being hovered.
|
|
18
|
+
- Added `cursor` property to the `CommandBarItemProps` interface, to allow a different cursor when hovering over an item.
|
|
19
|
+
- Added `disabled` property to the `CommandBarItemProps` interface, to allow rendering an item in a disabled state.
|
|
20
|
+
|
|
21
|
+
## 1.9.9 - 2024-05-14
|
|
22
|
+
|
|
23
|
+
- Changed return type of `createDeepLink` function of the WidgetInstanceContext interface from `void` to `string`.
|
|
24
|
+
|
|
12
25
|
## 1.9.8 - 2024-05-13
|
|
13
26
|
|
|
14
27
|
- Added `createDeepLink` property to the WidgetInstanceContext interface, to allow creating a deep link URL based on the current board and a widget instance.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -228,8 +228,9 @@ export interface WidgetInstanceContext {
|
|
|
228
228
|
/**
|
|
229
229
|
* Creates a deep link URL based on the current board and this widget instance, combined with
|
|
230
230
|
* the provided data.
|
|
231
|
+
* @returns The deep link URL.
|
|
231
232
|
*/
|
|
232
|
-
createDeepLink?: (data?: string) =>
|
|
233
|
+
createDeepLink?: (data?: string) => string;
|
|
233
234
|
/**
|
|
234
235
|
* Sets deep link data related to this widget instance in the URL of the current page.
|
|
235
236
|
*/
|
|
@@ -285,13 +286,13 @@ export interface WidgetInstanceContext {
|
|
|
285
286
|
* an icon button, depending on the presence of the onClick property. To remove the items,
|
|
286
287
|
* use the [unregisterCommandBarItems] function.
|
|
287
288
|
*/
|
|
288
|
-
registerCustomCommandBarItems?: (props:
|
|
289
|
+
registerCustomCommandBarItems?: (props: CommandBarItemProps[]) => void;
|
|
289
290
|
/**
|
|
290
291
|
* Allows registration of a custom command bar item which can either result in an icon or
|
|
291
292
|
* an icon button, depending on the presence of the onClick property. To remove the item,
|
|
292
293
|
* use the [unregisterCommandBarItem] function.
|
|
293
294
|
*/
|
|
294
|
-
registerCustomCommandBarItem?: (props:
|
|
295
|
+
registerCustomCommandBarItem?: (props: CommandBarItemProps) => void;
|
|
295
296
|
/**
|
|
296
297
|
* Removes all registered custom command bar items.
|
|
297
298
|
*/
|
|
@@ -572,28 +573,25 @@ export declare enum CustomCommandBarItemSeverity {
|
|
|
572
573
|
* Tells how to render the command bar item, e.g. as an icon button or as a link.
|
|
573
574
|
*/
|
|
574
575
|
export declare enum CommandBarItemType {
|
|
575
|
-
/**
|
|
576
|
+
/** Renders the item as an Icon */
|
|
576
577
|
Icon = "icon",
|
|
577
|
-
/**
|
|
578
|
-
Link = "link"
|
|
578
|
+
/** Renders the item as a clickable link */
|
|
579
|
+
Link = "link",
|
|
580
|
+
/** Renders the item in the overflow menu */
|
|
581
|
+
Overflow = "overflow"
|
|
579
582
|
}
|
|
580
583
|
/**
|
|
581
|
-
*
|
|
582
|
-
* rendering of a command bar item.
|
|
583
|
-
*/
|
|
584
|
-
export type CustomCommandBarItemProps = CommandBarIcon | CommandBarLink;
|
|
585
|
-
/**
|
|
586
|
-
* Base properties of a custom CommandBarItem.
|
|
584
|
+
* Base properties of a CommandBarItem, rendered in the widget header.
|
|
587
585
|
*/
|
|
588
|
-
export interface
|
|
586
|
+
export interface CommandBarItemProps {
|
|
589
587
|
/**
|
|
590
588
|
* Optional identifier for the icon.
|
|
591
589
|
*/
|
|
592
590
|
id?: string;
|
|
593
591
|
/**
|
|
594
|
-
*
|
|
592
|
+
* Optional type of item, (e.g. 'icon' or 'link'). When not specified, the item is rendered as an icon.
|
|
595
593
|
*/
|
|
596
|
-
itemType
|
|
594
|
+
itemType?: CommandBarItemType;
|
|
597
595
|
/**
|
|
598
596
|
* Optional content to show as a tooltip above the item.
|
|
599
597
|
*/
|
|
@@ -606,17 +604,28 @@ export interface CommandBarItemBase {
|
|
|
606
604
|
* Optionally tells the Widget Header that this item should always be visible, even when not hovering.
|
|
607
605
|
*/
|
|
608
606
|
pinned?: boolean;
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* Properties to render a custom CommandBarItem either as a single Icon or an Icon Button.
|
|
612
|
-
*/
|
|
613
|
-
export interface CommandBarIcon extends CommandBarItemBase {
|
|
614
|
-
itemType: CommandBarItemType.Icon;
|
|
615
607
|
/**
|
|
616
|
-
*
|
|
608
|
+
* Optionally tells the Widget Header that this item should always be rendered as if it is being hovered.
|
|
609
|
+
*/
|
|
610
|
+
highlighted?: boolean;
|
|
611
|
+
/**
|
|
612
|
+
* Optionally override the cursor when hovering over the item.
|
|
613
|
+
*/
|
|
614
|
+
cursor?: string;
|
|
615
|
+
/**
|
|
616
|
+
* Optionally tells the Widget Header that this item should be rendered in a disabled state.
|
|
617
|
+
*/
|
|
618
|
+
disabled?: boolean;
|
|
619
|
+
/**
|
|
620
|
+
* Name of the icon displayed when rendered as an Icon, or in the overflow menu.
|
|
621
|
+
* See the available icon names in Fluent UI Iconography:
|
|
617
622
|
* https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
|
|
618
623
|
*/
|
|
619
624
|
iconName: string;
|
|
625
|
+
/**
|
|
626
|
+
* Displayed label when rendered as a link, or in the overflow menu.
|
|
627
|
+
*/
|
|
628
|
+
label: string;
|
|
620
629
|
/**
|
|
621
630
|
* Optionally display a red notification icon badge in the top-right corner of the button.
|
|
622
631
|
*/
|
|
@@ -635,20 +644,6 @@ export interface CommandBarIcon extends CommandBarItemBase {
|
|
|
635
644
|
*/
|
|
636
645
|
onClick?: () => void;
|
|
637
646
|
}
|
|
638
|
-
/**
|
|
639
|
-
* Properties to render a custom CommandBarItem as a Link Button.
|
|
640
|
-
*/
|
|
641
|
-
export interface CommandBarLink extends CommandBarItemBase {
|
|
642
|
-
itemType: CommandBarItemType.Link;
|
|
643
|
-
/**
|
|
644
|
-
* Required label to display the clickable link.
|
|
645
|
-
*/
|
|
646
|
-
label: string;
|
|
647
|
-
/**
|
|
648
|
-
* Required onClick event, which is triggered on user click.
|
|
649
|
-
*/
|
|
650
|
-
onClick: () => void;
|
|
651
|
-
}
|
|
652
647
|
/**
|
|
653
648
|
* Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
|
|
654
649
|
*/
|
package/lib/types/index.js
CHANGED
|
@@ -36,8 +36,10 @@ var CustomCommandBarItemSeverity;
|
|
|
36
36
|
*/
|
|
37
37
|
var CommandBarItemType;
|
|
38
38
|
(function (CommandBarItemType) {
|
|
39
|
-
/**
|
|
39
|
+
/** Renders the item as an Icon */
|
|
40
40
|
CommandBarItemType["Icon"] = "icon";
|
|
41
|
-
/**
|
|
41
|
+
/** Renders the item as a clickable link */
|
|
42
42
|
CommandBarItemType["Link"] = "link";
|
|
43
|
+
/** Renders the item in the overflow menu */
|
|
44
|
+
CommandBarItemType["Overflow"] = "overflow";
|
|
43
45
|
})(CommandBarItemType || (exports.CommandBarItemType = CommandBarItemType = {}));
|
package/package.json
CHANGED