@ichicraft/widgets-widget-base 1.7.9 → 1.8.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
@@ -8,6 +8,9 @@ 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.7.11 - 2022-03-23
12
+ * Added `setWidgetHeaderVisibilty()` function to the `instance` object of the `WidgetContext` interface, allowing widgets to render in full height.
13
+
11
14
  ## 1.7.9 - 2022-01-20
12
15
  * Added `userAccountCreated` date/time to the `WidgetContext` interface.
13
16
 
package/lib/.DS_Store ADDED
Binary file
@@ -45,6 +45,10 @@ export interface WidgetContext {
45
45
  * Functionality offered by the widget board to change the title of the widget
46
46
  */
47
47
  setWidgetTitle?: (title: string) => void;
48
+ /**
49
+ * Show or hide the header of the widget, allowing widgets to take control of full widget real estate
50
+ */
51
+ setWidgetHeaderVisibilty?: (visible: boolean) => void;
48
52
  /**
49
53
  * Optional callback to handle the click event of the widget title
50
54
  */
@@ -59,6 +63,16 @@ export interface WidgetContext {
59
63
  * Removes the custom command bar item that was added by the [registerCommandBarItem] function
60
64
  */
61
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;
62
76
  };
63
77
  /**
64
78
  * Metadata and functions in the context of a widget's definition. A widget definition is
@@ -398,6 +412,30 @@ export interface WidgetManifestConfig {
398
412
  };
399
413
  };
400
414
  };
415
+ /**
416
+ * Everything related to analytics of this widget in Ichicraft Boards
417
+ */
418
+ analytics?: {
419
+ /**
420
+ * A list of time-based events this widget can raise. All the possible events MUST be
421
+ * described in this list for the widget board to be able to pick them up.
422
+ * @ref Use WidgetContext.instance.raiseEvent(object: string, action: string, data?: { [key: string]: string }) to raise these events
423
+ */
424
+ timeBasedEvents: {
425
+ /**
426
+ * The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
427
+ */
428
+ object: string;
429
+ /**
430
+ * The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
431
+ */
432
+ action: string;
433
+ /**
434
+ * A descriptive text used in the Administration panel to describe this event
435
+ */
436
+ description: string;
437
+ }[];
438
+ };
401
439
  }
402
440
  export declare enum DebugComponentType {
403
441
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.7.9",
3
+ "version": "1.8.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",