bigbluebutton-html-plugin-sdk 0.0.71 → 0.0.73
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 +25 -7
- package/dist/cjs/core/api/BbbPluginSdk.js +5 -2
- package/dist/cjs/core/api/BbbPluginSdk.js.map +1 -1
- package/dist/cjs/core/api/types.d.ts +8 -8
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/subscriptions.d.ts +2 -0
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/subscriptions.js +6 -0
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/subscriptions.js.map +1 -0
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/types.d.ts +20 -0
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/types.js.map +1 -0
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/useLocaleMessages.d.ts +3 -0
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/useLocaleMessages.js +60 -0
- package/dist/cjs/core/auxiliary/plugin-information/locale-messages/useLocaleMessages.js.map +1 -0
- package/dist/cjs/data-consumption/domain/settings/plugin-settings/utils.js +3 -3
- package/dist/cjs/data-consumption/domain/settings/plugin-settings/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/asset-persistence/enums.d.ts +0 -6
- package/dist/cjs/asset-persistence/enums.js +0 -12
- package/dist/cjs/asset-persistence/enums.js.map +0 -1
- package/dist/cjs/asset-persistence/hook.d.ts +0 -2
- package/dist/cjs/asset-persistence/hook.js +0 -16
- package/dist/cjs/asset-persistence/hook.js.map +0 -1
- package/dist/cjs/asset-persistence/types.d.ts +0 -8
- package/dist/cjs/asset-persistence/types.js.map +0 -1
- /package/dist/cjs/{asset-persistence → core/auxiliary/plugin-information/locale-messages}/types.js +0 -0
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ follow these steps:
|
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
96
|
cd $HOME/src/bigbluebutton-html-plugin-sdk/samples/sample-action-button-dropdown-plugin
|
|
97
|
-
npm
|
|
97
|
+
npm ci
|
|
98
98
|
npm run build-bundle
|
|
99
99
|
```
|
|
100
100
|
|
|
@@ -142,7 +142,7 @@ Here is as complete `manifet.json` example with all possible configurations:
|
|
|
142
142
|
{
|
|
143
143
|
"name": "allUsers",
|
|
144
144
|
"url": "${meta_pluginSettingsUserInformation}",
|
|
145
|
-
"fetchMode": "onMeetingCreate",
|
|
145
|
+
"fetchMode": "onMeetingCreate", // Possible values: "onMeetingCreate", "onDemand"
|
|
146
146
|
"permissions": ["moderator", "viewer"]
|
|
147
147
|
}
|
|
148
148
|
]
|
|
@@ -188,10 +188,11 @@ That being said, here are the extensible areas we have so far:
|
|
|
188
188
|
|
|
189
189
|
Mind that no plugin will interfere into another's extensible area. So feel free to set whatever you need into a certain plugin with no worries.
|
|
190
190
|
|
|
191
|
-
###
|
|
191
|
+
### Auxiliar functions:
|
|
192
192
|
|
|
193
193
|
- `getSessionToken`: returns the user session token located on the user's URL.
|
|
194
194
|
- `getJoinUrl`: returns the join url associated with the parameters passed as an argument. Since it fetches the BigBlueButton API, this getter method is asynchronous.
|
|
195
|
+
- `useLocaleMessages`: returns the messages to be used in internationalization functions (recommend to use `react-intl`, as example, refer to official plugins)
|
|
195
196
|
|
|
196
197
|
### Realtime data consumption
|
|
197
198
|
|
|
@@ -397,21 +398,32 @@ This is possible by simply configuring the dataResource name in the manifest and
|
|
|
397
398
|
{
|
|
398
399
|
"name": "allUsers",
|
|
399
400
|
"url": "${meta_pluginSettingsUserInformation}",
|
|
400
|
-
"fetchMode": "onMeetingCreate",
|
|
401
|
-
"permissions": ["moderator", "viewer"]
|
|
401
|
+
"fetchMode": "onMeetingCreate", // Possible values: "onMeetingCreate", "onDemand"
|
|
402
|
+
"permissions": ["moderator", "viewer"] // Possible values: "moderator", "viewer", "presenter"
|
|
402
403
|
}
|
|
403
404
|
]
|
|
404
405
|
}
|
|
405
406
|
```
|
|
406
407
|
|
|
407
|
-
|
|
408
|
+
Going through each parameter to better understand it's structure:
|
|
409
|
+
|
|
410
|
+
- `name`: It is the name of the remote data source, that is the name you'll use later on in the plugin when developing it;
|
|
411
|
+
- `url`: The Url to which the data will be fetched (it can be hard-coded in the `manifest.json`, but we recommend passing it as a `meta_` parameter);
|
|
412
|
+
- `fetchMode`: It tells the plugin-server if it should fetch the data only when creating the meeting, or everytime the function is called in the plugin portion;
|
|
413
|
+
- If one chooses `onMeetingCreate`, the data will be fetched when the create endpoint of the meeting is called, then it's cached in the plugin-server so that everytime the plugin wants that data, the plugin-server will respond with the cached data;
|
|
414
|
+
- On the other hand, if `onDemand` is selected, everytime the plugin calls this method, the plugin-server will fetch the data and then proxy it to the plugin;
|
|
415
|
+
- `permissions`: This tells the back-end which role of the meeting can access this remote data;
|
|
416
|
+
|
|
417
|
+
Here is the `/create` parameters you would have to pass to make this remote-data-source api work:
|
|
408
418
|
|
|
409
419
|
```
|
|
410
420
|
meta_pluginSettingsUserInformation=https://<your-external-source-with-your-authentication>/api/users
|
|
411
421
|
pluginManifests=[{"url": "http://<domain-of-your-manifest>/your-plugin/manifest.json"}]
|
|
412
422
|
```
|
|
413
423
|
|
|
414
|
-
|
|
424
|
+
See that we send the `meta_` parameter, for more information, refer to the [meta parameters section](#meta_-parameters)
|
|
425
|
+
|
|
426
|
+
Lastly, in the plugin, just use the function like:
|
|
415
427
|
|
|
416
428
|
```typescript
|
|
417
429
|
pluginApi.getRemoteData('allUsers').then((response: Response) => {
|
|
@@ -427,6 +439,12 @@ pluginApi.getRemoteData('allUsers').then((response: Response) => {
|
|
|
427
439
|
});
|
|
428
440
|
```
|
|
429
441
|
|
|
442
|
+
### Meta_ parameters
|
|
443
|
+
|
|
444
|
+
This is not part of the API, but it's a way of passing information to the manifest. Any value can be passed like this, one just needs to put something like `${meta_nameOfParameter}` in a specific config of the manifest, and in the `/create` call, set this meta-parameter to whatever is preferred, like `meta_nameOfParameter="Sample message"`
|
|
445
|
+
|
|
446
|
+
This feature is mainly used for security purposes, see [external data section](#external-data-resources). But can be used for customization reasons as well.
|
|
447
|
+
|
|
430
448
|
### Event persistence
|
|
431
449
|
|
|
432
450
|
This feature will allow the developer to save an information (which is basically an event) in the `event.xml` file of the meeting if it's being recorded.
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.BbbPluginSdk = void 0;
|
|
4
7
|
/* eslint-disable no-console */
|
|
@@ -24,7 +27,7 @@ var commands_2 = require("../../server-commands/commands");
|
|
|
24
27
|
var hooks_13 = require("../../learning-analytics-dashboard/hooks");
|
|
25
28
|
var utils_1 = require("../../remote-data/utils");
|
|
26
29
|
var hooks_14 = require("../../event-persistence/hooks");
|
|
27
|
-
var
|
|
30
|
+
var useLocaleMessages_1 = __importDefault(require("../auxiliary/plugin-information/locale-messages/useLocaleMessages"));
|
|
28
31
|
/**
|
|
29
32
|
* Class responsible for either initialize or get the PluginApi
|
|
30
33
|
*
|
|
@@ -74,7 +77,7 @@ var BbbPluginSdk = /** @class */ (function () {
|
|
|
74
77
|
pluginApi.sendGenericDataForLearningAnalyticsDashboard = function (data) { return (0, hooks_13.sendGenericDataForLearningAnalyticsDashboard)(data, pluginName); };
|
|
75
78
|
pluginApi.getRemoteData = function (dataSourceName) { return (0, utils_1.getRemoteData)(dataSourceName, pluginName); };
|
|
76
79
|
pluginApi.persistEvent = function (eventName, payload) { return (0, hooks_14.persistEventFunctionWrapper)(pluginName, eventName, payload); };
|
|
77
|
-
pluginApi.
|
|
80
|
+
pluginApi.useLocaleMessages = function (fetchConfigs) { return (0, useLocaleMessages_1.default)({ pluginApi: pluginApi, fetchConfigs: fetchConfigs }); };
|
|
78
81
|
}
|
|
79
82
|
else {
|
|
80
83
|
throw new Error('Plugin name not set');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BbbPluginSdk.js","sourceRoot":"","sources":["../../../../src/core/api/BbbPluginSdk.ts"],"names":[],"mappings":"
|
|
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;AACxD,wDAA4E;AAC5E,wHAA2G;AAI3G;;;;;;GAMG;AACH;IAAA;IAkIA,CAAC;IAjIC;;;;;;;;;;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,yBAAiB,GAAE,EAAnB,CAAmB,CAA8B,CAAC;QACvF,SAAS,CAAC,cAAc,GAAG,C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AAC;SACH;QAED,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IACH,mBAAC;AAAD,CAAC,AAlID,IAkIC;AAlIqB,oCAAY"}
|
|
@@ -32,7 +32,7 @@ import { UseUserCameraDomElementsFunction } from '../../dom-element-manipulation
|
|
|
32
32
|
import { ScreenshareHelperInterface, UserCameraHelperInterface } from '../../extensible-areas';
|
|
33
33
|
import { GetDataSource } from '../../remote-data/types';
|
|
34
34
|
import { PersistEventFunction } from '../../event-persistence/types';
|
|
35
|
-
import {
|
|
35
|
+
import { UseLocaleMessagesFunction } from '../auxiliary/plugin-information/locale-messages/types';
|
|
36
36
|
export type SetPresentationToolbarItems = (presentationToolbarItem: PresentationToolbarInterface[]) => string[];
|
|
37
37
|
export type SetUserListDropdownItems = (userListDropdownItem: UserListDropdownInterface[]) => string[];
|
|
38
38
|
export type SetActionButtonDropdownItems = (actionButtonDropdownInterface: ActionButtonDropdownInterface[]) => string[];
|
|
@@ -187,6 +187,13 @@ export interface PluginApi {
|
|
|
187
187
|
useUserCameraDomElements?: UseUserCameraDomElementsFunction;
|
|
188
188
|
getSessionToken?: GetSessionTokenFunction;
|
|
189
189
|
getJoinUrl?: GetJoinUrlFunction;
|
|
190
|
+
/**
|
|
191
|
+
* Return messages to be used in the internacionalization functions (react-intl is recommended)
|
|
192
|
+
*
|
|
193
|
+
* @param fetchConfigs - fetch configuration object for the locale files (otional,
|
|
194
|
+
* usefull in dev environments).
|
|
195
|
+
*/
|
|
196
|
+
useLocaleMessages?: UseLocaleMessagesFunction;
|
|
190
197
|
/**
|
|
191
198
|
* Send data to the Learning analytics dashboard
|
|
192
199
|
*
|
|
@@ -209,13 +216,6 @@ export interface PluginApi {
|
|
|
209
216
|
*
|
|
210
217
|
*/
|
|
211
218
|
persistEvent?: PersistEventFunction;
|
|
212
|
-
/**
|
|
213
|
-
* Persists assets to the current meeting, e.g.: presentation.
|
|
214
|
-
*
|
|
215
|
-
* @param payload - payload to be persisted in `events.xml`
|
|
216
|
-
*
|
|
217
|
-
*/
|
|
218
|
-
persistAsset?: PersistAssetFunction;
|
|
219
219
|
}
|
|
220
220
|
export interface PluginBrowserWindow extends Window {
|
|
221
221
|
bbb_plugins: {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_PLUGIN_INFORMATION = void 0;
|
|
4
|
+
var GET_PLUGIN_INFORMATION = "\nsubscription GetPluginInformation {\n plugin {\n javascriptEntrypointIntegrity\n javascriptEntrypointUrl\n localesBaseUrl\n name\n }\n}\n";
|
|
5
|
+
exports.GET_PLUGIN_INFORMATION = GET_PLUGIN_INFORMATION;
|
|
6
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../../../../src/core/auxiliary/plugin-information/locale-messages/subscriptions.ts"],"names":[],"mappings":";;;AAAA,IAAM,sBAAsB,GAAG,2JAS9B,CAAC;AAEO,wDAAsB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PluginApi } from 'src/core/api/types';
|
|
2
|
+
interface UseLocaleMessagesProps {
|
|
3
|
+
pluginApi: PluginApi;
|
|
4
|
+
fetchConfigs?: RequestInit;
|
|
5
|
+
}
|
|
6
|
+
interface PluginInformationResult {
|
|
7
|
+
javascriptEntrypointIntegrity: string;
|
|
8
|
+
javascriptEntrypointUrl: string;
|
|
9
|
+
localesBaseUrl: string;
|
|
10
|
+
}
|
|
11
|
+
interface GraphqlResponseWrapper {
|
|
12
|
+
plugin: PluginInformationResult[];
|
|
13
|
+
}
|
|
14
|
+
interface IntlMessages {
|
|
15
|
+
loading: boolean;
|
|
16
|
+
messages: Record<string, string>;
|
|
17
|
+
currentLocale: string;
|
|
18
|
+
}
|
|
19
|
+
type UseLocaleMessagesFunction = (fetchConfigs?: RequestInit) => IntlMessages;
|
|
20
|
+
export { UseLocaleMessagesProps, PluginInformationResult, GraphqlResponseWrapper, IntlMessages, UseLocaleMessagesFunction, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/core/auxiliary/plugin-information/locale-messages/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var React = __importStar(require("react"));
|
|
27
|
+
var ui_data_hooks_1 = require("../../../../ui-data-hooks");
|
|
28
|
+
var utils_1 = require("../../../../utils");
|
|
29
|
+
var subscriptions_1 = require("./subscriptions");
|
|
30
|
+
function useLocaleMessagesAuxiliary(_a) {
|
|
31
|
+
var pluginApi = _a.pluginApi, fetchConfigs = _a.fetchConfigs;
|
|
32
|
+
var currentLocale = pluginApi.useUiData(ui_data_hooks_1.IntlLocaleUiDataNames.CURRENT_LOCALE, {
|
|
33
|
+
locale: 'en',
|
|
34
|
+
fallbackLocale: 'en',
|
|
35
|
+
});
|
|
36
|
+
var _b = React.useState(true), loading = _b[0], setLoading = _b[1];
|
|
37
|
+
var _c = React.useState({}), messages = _c[0], setMessages = _c[1];
|
|
38
|
+
var pluginInformation = pluginApi.useCustomSubscription(subscriptions_1.GET_PLUGIN_INFORMATION).data;
|
|
39
|
+
React.useEffect(function () {
|
|
40
|
+
if (pluginInformation && pluginInformation.plugin && currentLocale.locale) {
|
|
41
|
+
var localesBaseUrl = pluginInformation.plugin[0].localesBaseUrl;
|
|
42
|
+
var locale = currentLocale.locale;
|
|
43
|
+
var localeUrl_1 = "".concat(localesBaseUrl, "/").concat(locale, ".json");
|
|
44
|
+
fetch(localeUrl_1, fetchConfigs).then(function (result) { return result.json(); }).then(function (localeMessages) {
|
|
45
|
+
setLoading(false);
|
|
46
|
+
setMessages(localeMessages);
|
|
47
|
+
}).catch(function (err) {
|
|
48
|
+
setLoading(false);
|
|
49
|
+
utils_1.pluginLogger.error("Something went wrong while trying to fetch ".concat(localeUrl_1, ": "), err);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, [pluginInformation, currentLocale]);
|
|
53
|
+
return {
|
|
54
|
+
messages: messages,
|
|
55
|
+
loading: loading,
|
|
56
|
+
currentLocale: currentLocale.locale,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
exports.default = useLocaleMessagesAuxiliary;
|
|
60
|
+
//# sourceMappingURL=useLocaleMessages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocaleMessages.js","sourceRoot":"","sources":["../../../../../../src/core/auxiliary/plugin-information/locale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;gBAClB,oBAAY,CAAC,KAAK,CAAC,qDAA8C,WAAS,OAAI,EAAE,GAAG,CAAC,CAAC;YACvF,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC,CAAC;IACvC,OAAO;QACL,QAAQ,UAAA;QACR,OAAO,SAAA;QACP,aAAa,EAAE,aAAa,CAAC,MAAM;KACpC,CAAC;AACJ,CAAC;AAED,kBAAe,0BAA0B,CAAC"}
|
|
@@ -13,9 +13,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.filterPluginSpecificSettings = void 0;
|
|
15
15
|
var filterPluginSpecificSettings = function (completeSettings) {
|
|
16
|
-
var _a;
|
|
17
|
-
var pluginSettings = (_a = completeSettings
|
|
18
|
-
.data) === null || _a === void 0 ? void 0 : _a.meeting_clientPluginSettings[0].settings;
|
|
16
|
+
var _a, _b;
|
|
17
|
+
var pluginSettings = (_b = (_a = completeSettings
|
|
18
|
+
.data) === null || _a === void 0 ? void 0 : _a.meeting_clientPluginSettings[0]) === null || _b === void 0 ? void 0 : _b.settings;
|
|
19
19
|
return __assign(__assign({}, completeSettings), { data: pluginSettings });
|
|
20
20
|
};
|
|
21
21
|
exports.filterPluginSpecificSettings = filterPluginSpecificSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/data-consumption/domain/settings/plugin-settings/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGO,IAAM,4BAA4B,GAAG,UAC1C,gBAAkF;;IAElF,IAAM,cAAc,GAAG,MAAA,gBAAgB;SACpC,IAAI,0CAAE,4BAA4B,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/data-consumption/domain/settings/plugin-settings/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGO,IAAM,4BAA4B,GAAG,UAC1C,gBAAkF;;IAElF,IAAM,cAAc,GAAG,MAAA,MAAA,gBAAgB;SACpC,IAAI,0CAAE,4BAA4B,CAAC,CAAC,CAAC,0CAAE,QAAQ,CAAC;IACnD,6BACK,gBAAgB,KACnB,IAAI,EAAE,cAAc,IACpB;AACJ,CAAC,CAAC;AATW,QAAA,4BAA4B,gCASvC"}
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AssetType = exports.AssetPersistenceEvents = void 0;
|
|
4
|
-
var AssetPersistenceEvents;
|
|
5
|
-
(function (AssetPersistenceEvents) {
|
|
6
|
-
AssetPersistenceEvents["ASSET_PERSISTED"] = "PLUGIN_ASSET_PERSISTED";
|
|
7
|
-
})(AssetPersistenceEvents || (exports.AssetPersistenceEvents = AssetPersistenceEvents = {}));
|
|
8
|
-
var AssetType;
|
|
9
|
-
(function (AssetType) {
|
|
10
|
-
AssetType["PRESENTATION"] = "PLUGIN_ASSET_PERSISTENCE_TYPE_PRESENTATION";
|
|
11
|
-
})(AssetType || (exports.AssetType = AssetType = {}));
|
|
12
|
-
//# sourceMappingURL=enums.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/asset-persistence/enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,oEAA0C,CAAA;AAC5C,CAAC,EAFW,sBAAsB,sCAAtB,sBAAsB,QAEjC;AAED,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,wEAA2D,CAAA;AAC7D,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.persistAssetFunctionWrapper = void 0;
|
|
4
|
-
var enums_1 = require("./enums");
|
|
5
|
-
var persistAssetFunctionWrapper = function (pluginName, assetUrl, typeOfAsset, assetName) {
|
|
6
|
-
window.dispatchEvent(new CustomEvent(enums_1.AssetPersistenceEvents.ASSET_PERSISTED, {
|
|
7
|
-
detail: {
|
|
8
|
-
pluginName: pluginName,
|
|
9
|
-
assetUrl: assetUrl,
|
|
10
|
-
typeOfAsset: typeOfAsset,
|
|
11
|
-
assetName: assetName,
|
|
12
|
-
},
|
|
13
|
-
}));
|
|
14
|
-
};
|
|
15
|
-
exports.persistAssetFunctionWrapper = persistAssetFunctionWrapper;
|
|
16
|
-
//# sourceMappingURL=hook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/asset-persistence/hook.ts"],"names":[],"mappings":";;;AAGA,iCAA4D;AAErD,IAAM,2BAA2B,GAAG,UACzC,UAAkB,EAClB,QAAgB,EAChB,WAAsB,EACtB,SAAkB;IAElB,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CACU,8BAAsB,CAAC,eAAe,EAAE;QAC/D,MAAM,EAAE;YACN,UAAU,YAAA;YACV,QAAQ,UAAA;YACR,WAAW,aAAA;YACX,SAAS,WAAA;SACV;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,2BAA2B,+BAiBtC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AssetType } from './enums';
|
|
2
|
-
export interface AssetPersistenceDetails {
|
|
3
|
-
pluginName: string;
|
|
4
|
-
assetUrl: string;
|
|
5
|
-
typeOfAsset: AssetType;
|
|
6
|
-
assetName?: string;
|
|
7
|
-
}
|
|
8
|
-
export type PersistAssetFunction = (assetUrl: string, typeOfAsset: AssetType, assetName?: string) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/asset-persistence/types.ts"],"names":[],"mappings":""}
|
/package/dist/cjs/{asset-persistence → core/auxiliary/plugin-information/locale-messages}/types.js
RENAMED
|
File without changes
|