@ichicraft/widgets-widget-base 1.16.4 → 1.16.6
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 +9 -0
- package/lib/BaseWidget.d.ts +7 -2
- package/lib/types/index.d.ts +16 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,15 @@ 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.16.6 - 2026-06-03
|
|
13
|
+
|
|
14
|
+
- Replaced unused `design.header.activeTextColor` with `design.header.subTextColor`
|
|
15
|
+
|
|
16
|
+
## 1.16.5 - 2026-06-01
|
|
17
|
+
|
|
18
|
+
- Added `BuddyRenderOptions` interface, passed by the host to `BaseWidget.renderBuddy` to describe the slot the widget is about to render into.
|
|
19
|
+
- Added optional `options` parameter to `BaseWidget.renderBuddy`, of type `BuddyRenderOptions`. Contains an `allowRichRendering` boolean that signals whether the slot has room for richer rendering than the standard buddy icon button — letting the widget decide synchronously between custom and default rendering.
|
|
20
|
+
|
|
12
21
|
## 1.16.4 - 2026-05-27
|
|
13
22
|
|
|
14
23
|
- Added `header` property to `WidgetDesignContext` interface, exposing the header's `textColor`, `iconColor`, `activeTextColor` and `activeIconColor` from the user's theme.
|
package/lib/BaseWidget.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { ExportData, ValidationResult, WidgetContext } from './types';
|
|
1
|
+
import { BuddyRenderOptions, ExportData, ValidationResult, WidgetContext } from './types';
|
|
2
2
|
export default abstract class BaseWidget {
|
|
3
3
|
protected readonly context: WidgetContext;
|
|
4
4
|
constructor(context: WidgetContext);
|
|
5
5
|
abstract init(): Promise<void>;
|
|
6
6
|
abstract render(domElement: HTMLDivElement): void;
|
|
7
7
|
/** Render function for the widget buddy component.
|
|
8
|
+
* @param domElement The DOM element to render into.
|
|
9
|
+
* @param options Slot information from the host (e.g. whether the slot has
|
|
10
|
+
* room for richer rendering than the standard buddy button). The
|
|
11
|
+
* argument is optional for backwards compatibility — older hosts may
|
|
12
|
+
* call `renderBuddy` without it.
|
|
8
13
|
* @returns Whether or not the buddy is using custom rendering.
|
|
9
14
|
*/
|
|
10
|
-
renderBuddy?(domElement: HTMLDivElement): boolean;
|
|
15
|
+
renderBuddy?(domElement: HTMLDivElement, options?: BuddyRenderOptions): boolean;
|
|
11
16
|
verifyPersistedUserConfiguration?(config: string): Promise<boolean>;
|
|
12
17
|
renderUserConfigurationForm?(domElement: HTMLDivElement): void;
|
|
13
18
|
validateUserConfigurationForm?(): ValidationResult;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -409,6 +409,20 @@ export interface WidgetBuddyContext {
|
|
|
409
409
|
*/
|
|
410
410
|
registerOnBuddyClick: (onClick: () => void) => void;
|
|
411
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Options passed by the host to `BaseWidget.renderBuddy` describing the slot
|
|
414
|
+
* the widget is about to render into. Lets the widget decide synchronously
|
|
415
|
+
* how rich its buddy rendering can afford to be.
|
|
416
|
+
*/
|
|
417
|
+
export interface BuddyRenderOptions {
|
|
418
|
+
/**
|
|
419
|
+
* Whether the buddy slot has enough room for a richer rendering than the
|
|
420
|
+
* standard buddy icon button. When `false`, the widget should either fall
|
|
421
|
+
* back on the host's default buddy button (by returning `false` from
|
|
422
|
+
* `renderBuddy`) or render a minimal icon that fits the standard slot.
|
|
423
|
+
*/
|
|
424
|
+
allowRichRendering: boolean;
|
|
425
|
+
}
|
|
412
426
|
/**
|
|
413
427
|
* Widget variant context providing metadata and functionality offered by the widget board. A widget variant is
|
|
414
428
|
* a widget that's been installed by an administrator from within the board administration.
|
|
@@ -480,8 +494,8 @@ export interface WidgetDesignContext {
|
|
|
480
494
|
textColor: string;
|
|
481
495
|
/** Icon color used in the header. */
|
|
482
496
|
iconColor: string;
|
|
483
|
-
/** Text color used in the header
|
|
484
|
-
|
|
497
|
+
/** Text color used in the header for secondary/supporting text (e.g. a subtitle or subline). */
|
|
498
|
+
subTextColor: string;
|
|
485
499
|
/** Icon color used in the header when an element is in the active or hover state. */
|
|
486
500
|
activeIconColor: string;
|
|
487
501
|
};
|
package/package.json
CHANGED