@ichicraft/widgets-widget-base 1.8.16 → 1.9.0

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
@@ -9,6 +9,16 @@ 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.0 - 2023-10-20
13
+
14
+ - Added optional `importData()` function to the `BaseWidget` class, used to import widget-specific data.
15
+ - Added optional `exportData()` function to the `BaseWidget` class, used to export widget-specific data.
16
+ - Added new exported `ExportData` type.
17
+
18
+ ## 1.8.17 - 2023-10-09
19
+
20
+ - Added `iconName` property to the `definition` object of the `WidgetContext` interface, to support using an icon to represent a widget.
21
+
12
22
  ## 1.8.16 - 2023-09-26
13
23
 
14
24
  - Added `Custom` value to `ICPersonaType` enum, to support a custom ICPersona.
@@ -1,4 +1,4 @@
1
- import { WidgetContext, ValidationResult } from './types';
1
+ import { WidgetContext, ValidationResult, ExportData } from './types';
2
2
  export default abstract class BaseWidget {
3
3
  protected readonly context: WidgetContext;
4
4
  constructor(context: WidgetContext);
@@ -12,5 +12,7 @@ export default abstract class BaseWidget {
12
12
  renderAdminConfigurationForm?(domElement: HTMLDivElement): void;
13
13
  validateAdminConfigurationForm?(): ValidationResult;
14
14
  getSerializedAdminConfiguration?(): string;
15
+ importData?(exportData: ExportData): Promise<void>;
16
+ exportData?(): Promise<ExportData>;
15
17
  cleanupResources?(): void;
16
18
  }
@@ -113,6 +113,10 @@ export interface WidgetContext {
113
113
  * A list of board types applicable for this widget variant.
114
114
  */
115
115
  allowedBoardTypes?: BoardType[];
116
+ /**
117
+ * The icon defined for this widget variant.
118
+ */
119
+ iconName?: string;
116
120
  };
117
121
  /**
118
122
  * Metadata and functions in the context of a widget's manifest. A widget manifest contains
@@ -648,3 +652,6 @@ export interface FilePickerFileProps {
648
652
  }
649
653
  export declare type BoardType = 'shared' | 'personal';
650
654
  export declare type UserRole = 'administrator' | 'board-owner';
655
+ export interface ExportData {
656
+ data: object[];
657
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.8.16",
3
+ "version": "1.9.0",
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",