@ichicraft/widgets-widget-base 1.7.11 → 1.8.2

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
@@ -8,6 +8,13 @@ All notable changes to this project will be documented here.
8
8
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
9
9
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10
10
 
11
+ ## 1.8.2 - 2022-07-06
12
+ * Added `subtitle` property to the `WidgetResource` interface.
13
+
14
+ ## 1.8.1 - 2022-06-17
15
+ * Added new section `analytics` to `WidgetManifestConfig` interface to allow definition of time-based events that can be raised by a widget.
16
+ * Added `raiseEvent(...)` to the `instance` object of the `WidgetContent` interface, allowing widgets to raise an event.
17
+
11
18
  ## 1.7.11 - 2022-03-23
12
19
  * Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
13
20
 
package/lib/.DS_Store CHANGED
Binary file
@@ -63,6 +63,16 @@ export interface WidgetContext {
63
63
  * Removes the custom command bar item that was added by the [registerCommandBarItem] function
64
64
  */
65
65
  unregisterCustomCommandBarItem?: () => void;
66
+ /**
67
+ * Raises an event to be handled by the Time-based Events feature of Ichicraft Boards.
68
+ * @param object The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
69
+ * @param action The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
70
+ * @param data Optionally provide extra metadata to be included with the raised event.
71
+ * widgetAlias property (from manifest) and variantTitle property will automatically be added by the widget board.
72
+ */
73
+ raiseEvent?: (object: string, action: string, data?: {
74
+ [key: string]: string;
75
+ }) => void;
66
76
  };
67
77
  /**
68
78
  * Metadata and functions in the context of a widget's definition. A widget definition is
@@ -272,6 +282,7 @@ export interface WidgetImages {
272
282
  export interface WidgetResource {
273
283
  lang: number;
274
284
  title: string;
285
+ subtitle?: string;
275
286
  shortDescription: string;
276
287
  instructions: string;
277
288
  images: WidgetImages;
@@ -402,6 +413,30 @@ export interface WidgetManifestConfig {
402
413
  };
403
414
  };
404
415
  };
416
+ /**
417
+ * Everything related to analytics of this widget in Ichicraft Boards
418
+ */
419
+ analytics?: {
420
+ /**
421
+ * A list of time-based events this widget can raise. All the possible events MUST be
422
+ * described in this list for the widget board to be able to pick them up.
423
+ * @ref Use WidgetContext.instance.raiseEvent(object: string, action: string, data?: { [key: string]: string }) to raise these events
424
+ */
425
+ timeBasedEvents: {
426
+ /**
427
+ * The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
428
+ */
429
+ object: string;
430
+ /**
431
+ * The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
432
+ */
433
+ action: string;
434
+ /**
435
+ * A descriptive text used in the Administration panel to describe this event
436
+ */
437
+ description: string;
438
+ }[];
439
+ };
405
440
  }
406
441
  export declare enum DebugComponentType {
407
442
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.7.11",
3
+ "version": "1.8.2",
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",