bigbluebutton-html-plugin-sdk 0.0.66 → 0.0.68

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.
Files changed (33) hide show
  1. package/README.md +62 -24
  2. package/dist/cjs/core/api/BbbPluginSdk.js +2 -0
  3. package/dist/cjs/core/api/BbbPluginSdk.js.map +1 -1
  4. package/dist/cjs/core/api/types.d.ts +9 -0
  5. package/dist/cjs/event-persistence/enums.d.ts +3 -0
  6. package/dist/cjs/event-persistence/enums.js +8 -0
  7. package/dist/cjs/event-persistence/enums.js.map +1 -0
  8. package/dist/cjs/event-persistence/hooks.d.ts +1 -0
  9. package/dist/cjs/event-persistence/hooks.js +15 -0
  10. package/dist/cjs/event-persistence/hooks.js.map +1 -0
  11. package/dist/cjs/event-persistence/types.d.ts +6 -0
  12. package/dist/cjs/event-persistence/types.js +3 -0
  13. package/dist/cjs/event-persistence/types.js.map +1 -0
  14. package/dist/cjs/index.d.ts +1 -0
  15. package/dist/cjs/index.js +1 -0
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/cjs/ui-commands/commands.d.ts +3 -0
  18. package/dist/cjs/ui-commands/commands.js +2 -0
  19. package/dist/cjs/ui-commands/commands.js.map +1 -1
  20. package/dist/cjs/ui-commands/index.d.ts +1 -0
  21. package/dist/cjs/ui-commands/index.js +6 -0
  22. package/dist/cjs/ui-commands/index.js.map +1 -0
  23. package/dist/cjs/ui-commands/notification/commands.d.ts +7 -0
  24. package/dist/cjs/ui-commands/notification/commands.js +15 -0
  25. package/dist/cjs/ui-commands/notification/commands.js.map +1 -0
  26. package/dist/cjs/ui-commands/notification/enums.d.ts +10 -0
  27. package/dist/cjs/ui-commands/notification/enums.js +16 -0
  28. package/dist/cjs/ui-commands/notification/enums.js.map +1 -0
  29. package/dist/cjs/ui-commands/notification/types.d.ts +17 -0
  30. package/dist/cjs/ui-commands/notification/types.js +3 -0
  31. package/dist/cjs/ui-commands/notification/types.js.map +1 -0
  32. package/dist/cjs/ui-commands/types.d.ts +2 -0
  33. package/package.json +1 -1
package/README.md CHANGED
@@ -22,6 +22,8 @@ For development purposes you can run a plugin locally from source.
22
22
  For example if you take the [`sample-action-button-dropdown-plugin`](samples/sample-action-button-dropdown-plugin),
23
23
  you do the following:
24
24
 
25
+ *Running from source code with local BBB-server*
26
+
25
27
  1. Start the development server:
26
28
 
27
29
  ```bash
@@ -29,19 +31,59 @@ you do the following:
29
31
  npm install
30
32
  npm start
31
33
  ```
32
- 2. Add reference to it on BigBlueButton's `settings.yml`:
33
34
 
34
- ```yaml
35
- public:
36
- plugins:
37
- - name: SampleActionButtonDropdownPlugin
38
- url: http://127.0.0.1:4701/static/SampleActionButtonDropdownPlugin.js
39
- ```
35
+ 2. Add reference to it on BigBlueButton's `/create` call or add it on `/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties`:
36
+
37
+ ```
38
+ pluginsManifests=[{"url": "http://localhost:4701/manifest.json"}]
39
+ ```
40
+
41
+ *Running from souce code with a remote BBB-server*
42
+
43
+ If you are running your BBB-server elsewhere, than you can't simply point the manifest URL to a local address, you'll need to either serve the built version into a CDN or serve the dev version using a service to make it public. And for the second option we'd recommend NGROK. Here are the instructions to do that:
44
+
45
+ 1. Create an account on https://ngrok.com/ (Official website of NGROK);
46
+
47
+ 2. Install NGROK in your computer. They have a guide for that right after you created your account;
48
+
49
+ 3. Start the Plugin development server:
50
+
51
+ ```bash
52
+ cd $HOME/src/plugin-pick-random-user-plugin
53
+ npm install
54
+ npm start
55
+ ```
56
+
57
+ 4. Start the NGROK server into your machine with the following command:
58
+
59
+ ```bash
60
+ ngrok http http://172.17.0.1:4701
61
+ ```
62
+
63
+ Make sure to point NGROK to the correct local URL (In our case - The samples are made this way, for instance - we used `http://172.17.0.1:4701`)
64
+
65
+ Right after that, NGROK will create an interface into your terminal and will display the URL which your static files are being served.
66
+
67
+ Here's an example of URL: `https://<uuid>.ngrok-free.app`
68
+
69
+ You can already interact with this URL and access both
40
70
 
41
- _N.B.:_ Be aware that in this case the url is interpreted from the plugin in the browser,
42
- so the localhost is actually your local development machine.
71
+ `https://<uuid>.ngrok-free.app/manifest.json`
43
72
 
44
- ### Building the Plugin
73
+ or
74
+
75
+ `https://<uuid>.ngrok-free.app/PickRandomUserPlugin.js`
76
+
77
+
78
+ 5. Add this create parameter into the API-mate of the server you are testing it on:
79
+
80
+ ```
81
+ pluginsManifests=[{"url": "https://<uuid>.ngrok-free.app/manifest.json"}]
82
+ ```
83
+
84
+ And there you go, you can test it freely.
85
+
86
+ ### Building the Plugin (Production)
45
87
 
46
88
  To build a plugin for production use
47
89
  (again, using the example of [`sample-action-button-dropdown-plugin`](samples/sample-action-button-dropdown-plugin)),
@@ -53,26 +95,20 @@ npm install
53
95
  npm run build-bundle
54
96
  ```
55
97
 
56
- The above command will generate the `dist` folder, containing the bundled JavaScript file named `SampleActionButtonDropdownPlugin.js`.
57
- This file can be hosted on any HTTPS server.
98
+ The above command will generate the `dist` folder, containing the bundled JavaScript file named `SampleActionButtonDropdownPlugin.js` along with the `manifest.json`.
99
+ These files can be hosted on any HTTPS server.
58
100
 
59
- To use the plugin with BigBlueButton, add the plugin's URL to `settings.yml` as shown below:
101
+ To use the plugin with BigBlueButton, add the plugin's `manifest.json` URL to `bigbluebutton.properties` or you can simply send it via `/create` parameter:
60
102
 
61
- ```yaml
62
- public:
63
- app:
64
- ... // All app configurations
65
- plugins:
66
- - name: SampleActionButtonDropdownPlugin
67
- url: <<PLUGIN_URL>>
68
- ... // All other configurations
103
+ ```
104
+ pluginManifests=[{"url":"<your-domain>/path/to/manifest.json"}]
69
105
  ```
70
106
 
71
107
  #### Hosting the Plugin on a BBB Server
72
108
 
73
109
  While the plugin can be hosted on any Server, it is also possible to host the bundled file directly on
74
- a BigBlueButton server. For that you copy the `dist/SampleActionButtonDropdownPlugin.js` to the folder `/var/www/bigbluebutton-default/assets/plugins`.
75
- In this case, the `<<PLUGIN_URL>>` will be `https://<your-host>/plugins/SampleActionButtonDropdownPlugin.js`.
110
+ a BigBlueButton server. For that you copy `dist/SampleActionButtonDropdownPlugin.js` and `dist/manifest.json` to the folder `/var/www/bigbluebutton-default/assets/plugins/sampleActionButtonDropdownPlugin`.
111
+ In this case, the your manifest URL will be `https://<your-host>/plugins/sampleActionButtonDropdownPlugin/manifest.json`.
76
112
 
77
113
  ## API
78
114
 
@@ -251,6 +287,8 @@ One other thing is that the type of the return is precisely the same type requir
251
287
  - close: this function will close the presentation area content automatically;
252
288
  - conference:
253
289
  - setSpeakerLevel: this function will set the speaker volume level(audio output) of the conference to a certain number between 0 and 1;
290
+ - notification:
291
+ - send: This function will send a notification for the client to render, keep in mind that it's only client-side. Should you want it to be rendered in multiple clients, use this with a data-channel;
254
292
  - user-status:
255
293
  - setAwayStatus: this function will set the away status of the user to a certain status;
256
294
 
@@ -397,7 +435,7 @@ module.exports = {
397
435
  ```
398
436
 
399
437
  **Does the builded plugin need to be in the same BBB server?**
400
- No, feel free to host it anywhere you want, just make sure to point the URL from `settings.yml`correctly.
438
+ No, feel free to host it anywhere you want, just make sure to point the URL from `manifest.json` correctly (into the create endpoint or `bigbluebutton.properties`).
401
439
 
402
440
  **I am making my plugin based on a sample inside the SDK, but somehow, the sample is not working properly, what do I do to run it in dev mode and make it work?**
403
441
  Well there are several motives to why the sample is not working properly, so I will go through each one of them briefly:
@@ -23,6 +23,7 @@ var hooks_12 = require("../../data-consumption/domain/meeting/from-core/hooks");
23
23
  var commands_2 = require("../../server-commands/commands");
24
24
  var hooks_13 = require("../../learning-analytics-dashboard/hooks");
25
25
  var utils_1 = require("../../remote-data/utils");
26
+ var hooks_14 = require("../../event-persistence/hooks");
26
27
  /**
27
28
  * Class responsible for either initialize or get the PluginApi
28
29
  *
@@ -71,6 +72,7 @@ var BbbPluginSdk = /** @class */ (function () {
71
72
  pluginApi.serverCommands = (0, commands_2.serverCommands)(pluginName);
72
73
  pluginApi.sendGenericDataForLearningAnalyticsDashboard = function (data) { return (0, hooks_13.sendGenericDataForLearningAnalyticsDashboard)(data, pluginName); };
73
74
  pluginApi.getRemoteData = function (dataSourceName) { return (0, utils_1.getRemoteData)(dataSourceName, pluginName); };
75
+ pluginApi.persistEvent = function (eventName, payload) { return (0, hooks_14.persistEventFunctionWrapper)(pluginName, eventName, payload); };
74
76
  }
75
77
  else {
76
78
  throw new Error('Plugin name not set');
@@ -1 +1 @@
1
- {"version":3,"file":"BbbPluginSdk.js","sourceRoot":"","sources":["../../../../src/core/api/BbbPluginSdk.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+BAAkC;AAOlC,kDAA4D;AAO5D,uDAAwD;AAQxD,kDAAiE;AACjE,gGAEgF;AAChF,wFAEwE;AACxE,oFAA+F;AAC/F,gFAAwF;AACxF,oFAA+F;AAC/F,4DAAoE;AACpE,uDAA0D;AAC1D,mEAA2E;AAE3E,uFAAsG;AACtG,2EAA8F;AAC9F,0EAA4F;AAE5F,2FAAuG;AACvG,oDAAsD;AAEtD,gFAAmF;AACnF,2DAAgE;AAChE,mEAAwG;AAExG,iDAAwD;AAIxD;;;;;;GAMG;AACH;IAAA;IAuHA,CAAC;IAtHC;;;;;;;;;;OAUG;IACW,uBAAU,GAAxB,UAAyB,IAAY;QACnC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;QAC1I,IAAM,SAAS,GAAc,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtD,SAAS,CAAC,qBAAqB,GAAG,CAAC,UACjC,KAAa,EACb,sBAAsD,IACnD,OAAA,IAAA,6BAAqB,EAAC,KAAK,EAAE,sBAAsB,CAAC,EAApD,CAAoD,CAAkC,CAAC;QAC5F,SAAS,CAAC,sBAAsB,GAAG,CACjC,cAAM,OAAA,IAAA,8BAAsB,GAAE,EAAxB,CAAwB,CAAmC,CAAC;QACpE,SAAS,CAAC,iBAAiB,GAAG,CAAC,cAAM,OAAA,IAAA,yBAAi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AAM,OAAA,EAAE,EAAF,CAAE;gBAC5B,6BAA6B,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBACvC,4BAA4B,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBACtC,cAAc,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBACxB,yBAAyB,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBACnC,wBAAwB,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBAClC,uBAAuB,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBACjC,8BAA8B,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBACxC,0BAA0B,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBACpC,oCAAoC,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBAC9C,kBAAkB,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBAC5B,sBAAsB,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;gBAChC,uBAAuB,EAAE;oBACvB,EAAE,EAAE,cAAO,CAAC;iBACb;gBACD,eAAe,EAAE,cAAM,OAAA,IAAA,wBAAe,GAAE,EAAjB,CAAiB;gBACxC,UAAU,EAAE,UAAC,MAAM,IAAK,OAAA,IAAA,mBAAU,EAAC,MAAM,CAAC,EAAlB,CAAkB;gBAC1C,UAAU,YAAA;aACX,CAAC;SACH;QAED,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IACH,mBAAC;AAAD,CAAC,AA/HD,IA+HC;AA/HqB,oCAAY"}
@@ -31,6 +31,7 @@ import { SendGenericDataForLearningAnalyticsDashboard } from '../../learning-ana
31
31
  import { UseUserCameraDomElementsFunction } from '../../dom-element-manipulation/user-camera/types';
32
32
  import { ScreenshareHelperInterface, UserCameraHelperInterface } from '../../extensible-areas';
33
33
  import { GetDataSource } from '../../remote-data/types';
34
+ import { PersistEventFunction } from '../../event-persistence/types';
34
35
  export type SetPresentationToolbarItems = (presentationToolbarItem: PresentationToolbarInterface[]) => string[];
35
36
  export type SetUserListDropdownItems = (userListDropdownItem: UserListDropdownInterface[]) => string[];
36
37
  export type SetActionButtonDropdownItems = (actionButtonDropdownInterface: ActionButtonDropdownInterface[]) => string[];
@@ -199,6 +200,14 @@ export interface PluginApi {
199
200
  *
200
201
  */
201
202
  getRemoteData?: GetDataSource;
203
+ /**
204
+ * Persists events to `events.xml` file.
205
+ *
206
+ * @param eventName - name of the event to be persisted in `events.xml`
207
+ * @param payload - payload to be persisted in `events.xml`
208
+ *
209
+ */
210
+ persistEvent?: PersistEventFunction;
202
211
  }
203
212
  export interface PluginBrowserWindow extends Window {
204
213
  bbb_plugins: {
@@ -0,0 +1,3 @@
1
+ export declare enum EventPersistenceEvents {
2
+ EVENT_PERSISTED = "PLUGIN_EVENT_PERSISTED"
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventPersistenceEvents = void 0;
4
+ var EventPersistenceEvents;
5
+ (function (EventPersistenceEvents) {
6
+ EventPersistenceEvents["EVENT_PERSISTED"] = "PLUGIN_EVENT_PERSISTED";
7
+ })(EventPersistenceEvents || (exports.EventPersistenceEvents = EventPersistenceEvents = {}));
8
+ //# sourceMappingURL=enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/event-persistence/enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,oEAA0C,CAAA;AAC5C,CAAC,EAFW,sBAAsB,sCAAtB,sBAAsB,QAEjC"}
@@ -0,0 +1 @@
1
+ export declare const persistEventFunctionWrapper: <T = object>(pluginName: string, eventName: string, payload: T) => void;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.persistEventFunctionWrapper = void 0;
4
+ var enums_1 = require("./enums");
5
+ var persistEventFunctionWrapper = function (pluginName, eventName, payload) {
6
+ window.dispatchEvent(new CustomEvent(enums_1.EventPersistenceEvents.EVENT_PERSISTED, {
7
+ detail: {
8
+ pluginName: pluginName,
9
+ eventName: eventName,
10
+ payload: payload,
11
+ },
12
+ }));
13
+ };
14
+ exports.persistEventFunctionWrapper = persistEventFunctionWrapper;
15
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/event-persistence/hooks.ts"],"names":[],"mappings":";;;AAGA,iCAAiD;AAE1C,IAAM,2BAA2B,GAAG,UACzC,UAAkB,EAClB,SAAiB,EACjB,OAAU;IAEV,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CACa,8BAAsB,CAAC,eAAe,EAAE;QAClE,MAAM,EAAE;YACN,UAAU,YAAA;YACV,SAAS,WAAA;YACT,OAAO,SAAA;SACR;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,2BAA2B,+BAetC"}
@@ -0,0 +1,6 @@
1
+ export interface EventPersistenceDetails<T = object> {
2
+ pluginName: string;
3
+ eventName: string;
4
+ payload: T;
5
+ }
6
+ export type PersistEventFunction = <T = object>(eventName: string, payload: T) => void;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/event-persistence/types.ts"],"names":[],"mappings":""}
@@ -3,5 +3,6 @@ export * from './data-consumption';
3
3
  export * from './data-channel';
4
4
  export * from './ui-data-hooks';
5
5
  export * from './server-commands';
6
+ export * from './ui-commands';
6
7
  export * from './core';
7
8
  export * from './utils';
package/dist/cjs/index.js CHANGED
@@ -19,6 +19,7 @@ __exportStar(require("./data-consumption"), exports);
19
19
  __exportStar(require("./data-channel"), exports);
20
20
  __exportStar(require("./ui-data-hooks"), exports);
21
21
  __exportStar(require("./server-commands"), exports);
22
+ __exportStar(require("./ui-commands"), exports);
22
23
  __exportStar(require("./core"), exports);
23
24
  __exportStar(require("./utils"), exports);
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AAEnC,qDAAmC;AAEnC,iDAA+B;AAE/B,kDAAgC;AAEhC,oDAAkC;AAElC,yCAAuB;AAEvB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AAEnC,qDAAmC;AAEnC,iDAA+B;AAE/B,kDAAgC;AAEhC,oDAAkC;AAElC,gDAA8B;AAE9B,yCAAuB;AAEvB,0CAAwB"}
@@ -24,4 +24,7 @@ export declare const uiCommands: {
24
24
  conference: {
25
25
  setSpeakerLevel: (setSpeakerLevelCommandArguments: import("./conference/types").SetSpeakerLevelCommandArguments) => void;
26
26
  };
27
+ notification: {
28
+ send: (information: import("./notification/types").SendNotificationCommandArguments) => void;
29
+ };
27
30
  };
@@ -7,6 +7,7 @@ var commands_3 = require("./sidekick-options-container/commands");
7
7
  var commands_4 = require("./presentation-area/commands");
8
8
  var commands_5 = require("./user-status/commands");
9
9
  var commands_6 = require("./conference/commands");
10
+ var commands_7 = require("./notification/commands");
10
11
  exports.uiCommands = {
11
12
  chat: commands_1.chat,
12
13
  externalVideo: commands_2.externalVideo,
@@ -14,5 +15,6 @@ exports.uiCommands = {
14
15
  presentationArea: commands_4.presentationArea,
15
16
  userStatus: commands_5.userStatus,
16
17
  conference: commands_6.conference,
18
+ notification: commands_7.notification,
17
19
  };
18
20
  //# sourceMappingURL=commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/ui-commands/commands.ts"],"names":[],"mappings":";;;AAAA,4CAAuC;AACvC,sDAA0D;AAC1D,kEAAiF;AACjF,yDAAgE;AAChE,mDAAoD;AACpD,kDAAmD;AAEtC,QAAA,UAAU,GAAG;IACxB,IAAI,iBAAA;IACJ,aAAa,0BAAA;IACb,wBAAwB,qCAAA;IACxB,gBAAgB,6BAAA;IAChB,UAAU,uBAAA;IACV,UAAU,uBAAA;CACX,CAAC"}
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/ui-commands/commands.ts"],"names":[],"mappings":";;;AAAA,4CAAuC;AACvC,sDAA0D;AAC1D,kEAAiF;AACjF,yDAAgE;AAChE,mDAAoD;AACpD,kDAAmD;AACnD,oDAAuD;AAE1C,QAAA,UAAU,GAAG;IACxB,IAAI,iBAAA;IACJ,aAAa,0BAAA;IACb,wBAAwB,qCAAA;IACxB,gBAAgB,6BAAA;IAChB,UAAU,uBAAA;IACV,UAAU,uBAAA;IACV,YAAY,yBAAA;CACb,CAAC"}
@@ -0,0 +1 @@
1
+ export { NotificationTypeUiCommand } from './notification/enums';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationTypeUiCommand = void 0;
4
+ var enums_1 = require("./notification/enums");
5
+ Object.defineProperty(exports, "NotificationTypeUiCommand", { enumerable: true, get: function () { return enums_1.NotificationTypeUiCommand; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui-commands/index.ts"],"names":[],"mappings":";;;AAAA,8CAAiE;AAAxD,kHAAA,yBAAyB,OAAA"}
@@ -0,0 +1,7 @@
1
+ import { SendNotificationCommandArguments } from './types';
2
+ export declare const notification: {
3
+ /**
4
+ * Sends notification to be rendered in the front-end.
5
+ */
6
+ send: (information: SendNotificationCommandArguments) => void;
7
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.notification = void 0;
4
+ var enums_1 = require("./enums");
5
+ exports.notification = {
6
+ /**
7
+ * Sends notification to be rendered in the front-end.
8
+ */
9
+ send: function (information) {
10
+ window.dispatchEvent(new CustomEvent(enums_1.NotificationEnum.SEND, {
11
+ detail: information,
12
+ }));
13
+ },
14
+ };
15
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../src/ui-commands/notification/commands.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAG9B,QAAA,YAAY,GAAG;IAC1B;;OAEG;IACH,IAAI,EAAE,UAAC,WAA6C;QAClD,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAEb,wBAAgB,CAAC,IAAI,EAAE;YACvB,MAAM,EAAE,WAAW;SACpB,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare enum NotificationEnum {
2
+ SEND = "SEND_NOTIFICATION"
3
+ }
4
+ export declare enum NotificationTypeUiCommand {
5
+ INFO = "info",
6
+ DEFAULT = "default",
7
+ WARNING = "warning",
8
+ SUCCESS = "success",
9
+ ERROR = "error"
10
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationTypeUiCommand = exports.NotificationEnum = void 0;
4
+ var NotificationEnum;
5
+ (function (NotificationEnum) {
6
+ NotificationEnum["SEND"] = "SEND_NOTIFICATION";
7
+ })(NotificationEnum || (exports.NotificationEnum = NotificationEnum = {}));
8
+ var NotificationTypeUiCommand;
9
+ (function (NotificationTypeUiCommand) {
10
+ NotificationTypeUiCommand["INFO"] = "info";
11
+ NotificationTypeUiCommand["DEFAULT"] = "default";
12
+ NotificationTypeUiCommand["WARNING"] = "warning";
13
+ NotificationTypeUiCommand["SUCCESS"] = "success";
14
+ NotificationTypeUiCommand["ERROR"] = "error";
15
+ })(NotificationTypeUiCommand || (exports.NotificationTypeUiCommand = NotificationTypeUiCommand = {}));
16
+ //# sourceMappingURL=enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../../src/ui-commands/notification/enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,8CAA0B,CAAA;AAC5B,CAAC,EAFW,gBAAgB,gCAAhB,gBAAgB,QAE3B;AAED,IAAY,yBAMX;AAND,WAAY,yBAAyB;IACnC,0CAAa,CAAA;IACb,gDAAmB,CAAA;IACnB,gDAAmB,CAAA;IACnB,gDAAmB,CAAA;IACnB,4CAAe,CAAA;AACjB,CAAC,EANW,yBAAyB,yCAAzB,yBAAyB,QAMpC"}
@@ -0,0 +1,17 @@
1
+ import { NotificationTypeUiCommand } from './enums';
2
+ export interface SendNotificationCommandArgumentsOptions {
3
+ helpLabel?: string;
4
+ helpLink?: string;
5
+ autoClose?: number;
6
+ }
7
+ export interface SendNotificationCommandArguments {
8
+ message: string;
9
+ icon: string;
10
+ type: NotificationTypeUiCommand;
11
+ options?: SendNotificationCommandArgumentsOptions;
12
+ content?: string;
13
+ small?: boolean;
14
+ }
15
+ export interface UiCommandsNotificationObject {
16
+ send: (information: SendNotificationCommandArguments) => void;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui-commands/notification/types.ts"],"names":[],"mappings":""}
@@ -4,6 +4,7 @@ import { UiCommandsSidekickOptionsContainerObject } from './sidekick-options-con
4
4
  import { UiCommandsPresentationAreaObject } from './presentation-area/types';
5
5
  import { UiCommandsUserStatusObject } from './user-status/types';
6
6
  import { UiCommandsConferenceObject } from './conference/types';
7
+ import { UiCommandsNotificationObject } from './notification/types';
7
8
  export interface UiCommands {
8
9
  chat: UiCommandsChatObject;
9
10
  externalVideo: UiCommandsExternalVideoObject;
@@ -11,4 +12,5 @@ export interface UiCommands {
11
12
  presentationArea: UiCommandsPresentationAreaObject;
12
13
  userStatus: UiCommandsUserStatusObject;
13
14
  conference: UiCommandsConferenceObject;
15
+ notification: UiCommandsNotificationObject;
14
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigbluebutton-html-plugin-sdk",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
4
4
  "homepage": "https://github.com/bigbluebutton/bigbluebutton-html-plugin-sdk",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",