@telia-ace/knowledge-widget-core 1.0.6 → 1.0.9
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/LICENSE.txt +5 -5
- package/README.md +3 -3
- package/{lib-esm → dist}/bootstrap.d.ts +15 -15
- package/{lib → dist}/data-types.d.ts +87 -87
- package/{lib-esm → dist}/humany.d.ts +48 -48
- package/{lib-esm → dist}/implementation.d.ts +7 -7
- package/{lib-esm → dist}/index.d.ts +13 -13
- package/dist/index.js +122 -0
- package/dist/index.js.map +1 -0
- package/{lib → dist}/load-implementation.d.ts +8 -8
- package/{lib-esm → dist}/plugin.d.ts +7 -7
- package/{lib-esm → dist}/verify-auth.d.ts +2 -2
- package/{lib-esm → dist}/version.d.ts +2 -2
- package/{lib → dist}/widget-type.d.ts +7 -7
- package/package.json +11 -11
- package/lib/bootstrap.d.ts +0 -15
- package/lib/bootstrap.js +0 -26
- package/lib/data-types.js +0 -16
- package/lib/humany.d.ts +0 -48
- package/lib/humany.js +0 -119
- package/lib/implementation.d.ts +0 -7
- package/lib/implementation.js +0 -31
- package/lib/index.d.ts +0 -13
- package/lib/index.js +0 -43
- package/lib/load-implementation.js +0 -15
- package/lib/plugin.d.ts +0 -7
- package/lib/plugin.js +0 -29
- package/lib/verify-auth.d.ts +0 -2
- package/lib/verify-auth.js +0 -10
- package/lib/version.d.ts +0 -2
- package/lib/version.js +0 -3
- package/lib/widget-type.js +0 -29
- package/lib-esm/bootstrap.js +0 -24
- package/lib-esm/data-types.d.ts +0 -87
- package/lib-esm/data-types.js +0 -13
- package/lib-esm/humany.js +0 -114
- package/lib-esm/implementation.js +0 -29
- package/lib-esm/index.js +0 -12
- package/lib-esm/load-implementation.d.ts +0 -8
- package/lib-esm/load-implementation.js +0 -13
- package/lib-esm/plugin.js +0 -27
- package/lib-esm/verify-auth.js +0 -8
- package/lib-esm/version.js +0 -1
- package/lib-esm/widget-type.d.ts +0 -7
- package/lib-esm/widget-type.js +0 -27
package/lib/bootstrap.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var bootstrapping_1 = require("@webprovisions/bootstrapping");
|
|
4
|
-
var platform_1 = require("@webprovisions/platform");
|
|
5
|
-
/**
|
|
6
|
-
* Bootstraps an `Implementation` by scanning trigger elements and attaches them to
|
|
7
|
-
* their corresponding widgets.
|
|
8
|
-
*/
|
|
9
|
-
exports.default = (function (implementation, configure, options) {
|
|
10
|
-
if (options === void 0) { options = {}; }
|
|
11
|
-
return (0, bootstrapping_1.bootstrapImplementation)(implementation, implementation.bindings, function () {
|
|
12
|
-
var runtimeConfigurationHandlers = implementation.container
|
|
13
|
-
.get('$runtimecfg')
|
|
14
|
-
.map(function (cfgHandlerArgs) {
|
|
15
|
-
var fnOrSelector = cfgHandlerArgs[0];
|
|
16
|
-
if (typeof fnOrSelector === 'function') {
|
|
17
|
-
return fnOrSelector;
|
|
18
|
-
}
|
|
19
|
-
if ((0, platform_1.selectImplementations)(fnOrSelector)(implementation)) {
|
|
20
|
-
return cfgHandlerArgs[1];
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
.filter(function (handler) { return !!handler; });
|
|
24
|
-
return (configure ? [configure] : []).concat(runtimeConfigurationHandlers);
|
|
25
|
-
}, options.rootElementResolver || (function () { return document.body; }));
|
|
26
|
-
});
|
package/lib/data-types.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PickerTypes = exports.DialogItemType = void 0;
|
|
4
|
-
var DialogItemType;
|
|
5
|
-
(function (DialogItemType) {
|
|
6
|
-
DialogItemType["guide"] = "guide";
|
|
7
|
-
DialogItemType["link"] = "link";
|
|
8
|
-
DialogItemType["default"] = "default";
|
|
9
|
-
})(DialogItemType = exports.DialogItemType || (exports.DialogItemType = {}));
|
|
10
|
-
var PickerTypes;
|
|
11
|
-
(function (PickerTypes) {
|
|
12
|
-
PickerTypes["MODAL"] = "modal";
|
|
13
|
-
PickerTypes["DRAWER"] = "drawer";
|
|
14
|
-
PickerTypes["DROPDOWN"] = "dropdown";
|
|
15
|
-
PickerTypes["NONE"] = "none";
|
|
16
|
-
})(PickerTypes = exports.PickerTypes || (exports.PickerTypes = {}));
|
package/lib/humany.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { BootstrappedImplementationConfiguration } from '@webprovisions/bootstrapping';
|
|
2
|
-
import { ConfigurationApiDefinition, Environment, WidgetSelector } from '@webprovisions/platform';
|
|
3
|
-
import Implementation from './implementation';
|
|
4
|
-
export interface HumanyConfiguration {
|
|
5
|
-
/**
|
|
6
|
-
* Extensions for the configuration API (optional).
|
|
7
|
-
*/
|
|
8
|
-
configurationApiExtensions?: ConfigurationApiDefinition[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The Humany widget runtime.
|
|
12
|
-
*/
|
|
13
|
-
export default class Humany extends Environment {
|
|
14
|
-
/**
|
|
15
|
-
* Version of the Humany runtime.
|
|
16
|
-
*/
|
|
17
|
-
static version: string;
|
|
18
|
-
constructor(name: string, configurationApiExtensions?: ConfigurationApiDefinition[]);
|
|
19
|
-
createImplementation(configuration: BootstrappedImplementationConfiguration): Implementation;
|
|
20
|
-
/**
|
|
21
|
-
* Performs navigation for widgets matching the specified selector by invoking a
|
|
22
|
-
* 'navigate' command.
|
|
23
|
-
* @param selector Widget selector matching the widget(s) to perform navigation on.
|
|
24
|
-
* @param route Route name.
|
|
25
|
-
* @param params Route params.
|
|
26
|
-
*/
|
|
27
|
-
navigate(selector: WidgetSelector, route: string, params: {
|
|
28
|
-
[key: string]: string;
|
|
29
|
-
}): void;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a `Humany` runtime based on provided configuration.
|
|
32
|
-
* @param configuration Runtime configuration.
|
|
33
|
-
*/
|
|
34
|
-
static create(configuration?: HumanyConfiguration): Humany;
|
|
35
|
-
/**
|
|
36
|
-
* Creates a `Humany` runtime based on provided configuration and retains configuration handlers
|
|
37
|
-
* registered on global context. Use this factory to fully support the default embed script.
|
|
38
|
-
* Will return any existing `Humany` runtime if available.
|
|
39
|
-
* @param configuration Runtime configuration.
|
|
40
|
-
* @param global Object to read configuration handlers from (default: window).
|
|
41
|
-
*/
|
|
42
|
-
static createFromGlobal(globalHumany: any, configuration?: HumanyConfiguration): Humany;
|
|
43
|
-
/**
|
|
44
|
-
* Determines whether the specified object is a valid `Humany` runtime.
|
|
45
|
-
* @param obj Object to compare.
|
|
46
|
-
*/
|
|
47
|
-
static isRuntime(obj: any): boolean;
|
|
48
|
-
}
|
package/lib/humany.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var bootstrapping_1 = require("@webprovisions/bootstrapping");
|
|
33
|
-
var platform_1 = require("@webprovisions/platform");
|
|
34
|
-
var version_1 = __importDefault(require("./version"));
|
|
35
|
-
/**
|
|
36
|
-
* The Humany widget runtime.
|
|
37
|
-
*/
|
|
38
|
-
var Humany = /** @class */ (function (_super) {
|
|
39
|
-
__extends(Humany, _super);
|
|
40
|
-
function Humany(name, configurationApiExtensions) {
|
|
41
|
-
if (configurationApiExtensions === void 0) { configurationApiExtensions = []; }
|
|
42
|
-
return _super.call(this, name, configurationApiExtensions, {
|
|
43
|
-
transformPluginSettings: function (settings, name, container) {
|
|
44
|
-
var $settings = container.get('$settings');
|
|
45
|
-
var configPluginSettings = $settings.plugins && name ? $settings.plugins[name] || {} : {};
|
|
46
|
-
return __assign(__assign({}, configPluginSettings), settings);
|
|
47
|
-
},
|
|
48
|
-
}) || this;
|
|
49
|
-
}
|
|
50
|
-
Humany.prototype.createImplementation = function (configuration) {
|
|
51
|
-
var implementation = _super.prototype.createImplementation.call(this, configuration);
|
|
52
|
-
implementation.bindings = configuration.bindings;
|
|
53
|
-
return implementation;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Performs navigation for widgets matching the specified selector by invoking a
|
|
57
|
-
* 'navigate' command.
|
|
58
|
-
* @param selector Widget selector matching the widget(s) to perform navigation on.
|
|
59
|
-
* @param route Route name.
|
|
60
|
-
* @param params Route params.
|
|
61
|
-
*/
|
|
62
|
-
Humany.prototype.navigate = function (selector, route, params) {
|
|
63
|
-
this.widgets
|
|
64
|
-
.query(selector)
|
|
65
|
-
.forEach(function (widget) { return widget.invoke('navigate', { route: route, params: params }); });
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Creates a `Humany` runtime based on provided configuration.
|
|
69
|
-
* @param configuration Runtime configuration.
|
|
70
|
-
*/
|
|
71
|
-
Humany.create = function (configuration) {
|
|
72
|
-
if (configuration === void 0) { configuration = {}; }
|
|
73
|
-
var configurationApiExtensions = [bootstrapping_1.ConfigurationApi].concat(configuration.configurationApiExtensions || []);
|
|
74
|
-
return new Humany('humany', configurationApiExtensions);
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Creates a `Humany` runtime based on provided configuration and retains configuration handlers
|
|
78
|
-
* registered on global context. Use this factory to fully support the default embed script.
|
|
79
|
-
* Will return any existing `Humany` runtime if available.
|
|
80
|
-
* @param configuration Runtime configuration.
|
|
81
|
-
* @param global Object to read configuration handlers from (default: window).
|
|
82
|
-
*/
|
|
83
|
-
Humany.createFromGlobal = function (globalHumany, configuration) {
|
|
84
|
-
if (configuration === void 0) { configuration = {}; }
|
|
85
|
-
if (this.isRuntime(globalHumany)) {
|
|
86
|
-
globalHumany.patch(configuration);
|
|
87
|
-
return globalHumany;
|
|
88
|
-
}
|
|
89
|
-
var runtimeConfiguration = [];
|
|
90
|
-
var tempRuntimeConfiguration = globalHumany && globalHumany._c;
|
|
91
|
-
if (tempRuntimeConfiguration) {
|
|
92
|
-
tempRuntimeConfiguration.forEach(function (args) { return runtimeConfiguration.push(args); });
|
|
93
|
-
}
|
|
94
|
-
var runtime = this.create(configuration);
|
|
95
|
-
runtime.container.register('$runtimecfg', runtimeConfiguration);
|
|
96
|
-
return runtime;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Determines whether the specified object is a valid `Humany` runtime.
|
|
100
|
-
* @param obj Object to compare.
|
|
101
|
-
*/
|
|
102
|
-
Humany.isRuntime = function (obj) {
|
|
103
|
-
if (obj &&
|
|
104
|
-
typeof obj === 'object' &&
|
|
105
|
-
obj.container &&
|
|
106
|
-
typeof obj.container.get === 'function' &&
|
|
107
|
-
obj.container.get('$environment') === obj &&
|
|
108
|
-
obj.container.owner === obj) {
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
return false;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Version of the Humany runtime.
|
|
115
|
-
*/
|
|
116
|
-
Humany.version = "".concat(version_1.default, " (").concat(platform_1.version, ")");
|
|
117
|
-
return Humany;
|
|
118
|
-
}(platform_1.Environment));
|
|
119
|
-
exports.default = Humany;
|
package/lib/implementation.d.ts
DELETED
package/lib/implementation.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var platform_1 = require("@webprovisions/platform");
|
|
19
|
-
/**
|
|
20
|
-
* Represents a Humany implementation.
|
|
21
|
-
*/
|
|
22
|
-
var Implementation = /** @class */ (function (_super) {
|
|
23
|
-
__extends(Implementation, _super);
|
|
24
|
-
function Implementation() {
|
|
25
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
_this.bindings = [];
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
29
|
-
return Implementation;
|
|
30
|
-
}(platform_1.Implementation));
|
|
31
|
-
exports.default = Implementation;
|
package/lib/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from '@telia-ace/widget-core';
|
|
2
|
-
export { supportBootstrapping } from '@webprovisions/bootstrapping';
|
|
3
|
-
export type { BootstrappingActivationData } from '@webprovisions/bootstrapping';
|
|
4
|
-
export { destroyWidget as destroy, Widget } from '@webprovisions/platform';
|
|
5
|
-
export { default as bootstrap } from './bootstrap';
|
|
6
|
-
export * from './data-types';
|
|
7
|
-
export { default as Humany } from './humany';
|
|
8
|
-
export { default as Implementation } from './implementation';
|
|
9
|
-
export { default as loadImplementation } from './load-implementation';
|
|
10
|
-
export { default as Plugin } from './plugin';
|
|
11
|
-
export { default as verifyAuth } from './verify-auth';
|
|
12
|
-
export { default as version } from './version';
|
|
13
|
-
export { default as WidgetType } from './widget-type';
|
package/lib/index.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.WidgetType = exports.version = exports.verifyAuth = exports.Plugin = exports.loadImplementation = exports.Implementation = exports.Humany = exports.bootstrap = exports.Widget = exports.destroy = exports.supportBootstrapping = void 0;
|
|
21
|
-
__exportStar(require("@telia-ace/widget-core"), exports);
|
|
22
|
-
var bootstrapping_1 = require("@webprovisions/bootstrapping");
|
|
23
|
-
Object.defineProperty(exports, "supportBootstrapping", { enumerable: true, get: function () { return bootstrapping_1.supportBootstrapping; } });
|
|
24
|
-
var platform_1 = require("@webprovisions/platform");
|
|
25
|
-
Object.defineProperty(exports, "destroy", { enumerable: true, get: function () { return platform_1.destroyWidget; } });
|
|
26
|
-
Object.defineProperty(exports, "Widget", { enumerable: true, get: function () { return platform_1.Widget; } });
|
|
27
|
-
var bootstrap_1 = require("./bootstrap");
|
|
28
|
-
Object.defineProperty(exports, "bootstrap", { enumerable: true, get: function () { return __importDefault(bootstrap_1).default; } });
|
|
29
|
-
__exportStar(require("./data-types"), exports);
|
|
30
|
-
var humany_1 = require("./humany");
|
|
31
|
-
Object.defineProperty(exports, "Humany", { enumerable: true, get: function () { return __importDefault(humany_1).default; } });
|
|
32
|
-
var implementation_1 = require("./implementation");
|
|
33
|
-
Object.defineProperty(exports, "Implementation", { enumerable: true, get: function () { return __importDefault(implementation_1).default; } });
|
|
34
|
-
var load_implementation_1 = require("./load-implementation");
|
|
35
|
-
Object.defineProperty(exports, "loadImplementation", { enumerable: true, get: function () { return __importDefault(load_implementation_1).default; } });
|
|
36
|
-
var plugin_1 = require("./plugin");
|
|
37
|
-
Object.defineProperty(exports, "Plugin", { enumerable: true, get: function () { return __importDefault(plugin_1).default; } });
|
|
38
|
-
var verify_auth_1 = require("./verify-auth");
|
|
39
|
-
Object.defineProperty(exports, "verifyAuth", { enumerable: true, get: function () { return __importDefault(verify_auth_1).default; } });
|
|
40
|
-
var version_1 = require("./version");
|
|
41
|
-
Object.defineProperty(exports, "version", { enumerable: true, get: function () { return __importDefault(version_1).default; } });
|
|
42
|
-
var widget_type_1 = require("./widget-type");
|
|
43
|
-
Object.defineProperty(exports, "WidgetType", { enumerable: true, get: function () { return __importDefault(widget_type_1).default; } });
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* Loads a Humany implementation by fetching the configuration from the specified URL.
|
|
5
|
-
* @param implementationPath Implementation URL.
|
|
6
|
-
*/
|
|
7
|
-
var loadImplementation = function (humany, url) {
|
|
8
|
-
return fetch(url + '/config.json')
|
|
9
|
-
.then(function (response) { return response.json(); })
|
|
10
|
-
.then(function (json) { return json.implementation; })
|
|
11
|
-
.then(function (configuration) {
|
|
12
|
-
return humany.createImplementation(configuration);
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
exports.default = loadImplementation;
|
package/lib/plugin.d.ts
DELETED
package/lib/plugin.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var platform_1 = require("@webprovisions/platform");
|
|
19
|
-
/**
|
|
20
|
-
* Base class for a Humany plugin.
|
|
21
|
-
*/
|
|
22
|
-
var Plugin = /** @class */ (function (_super) {
|
|
23
|
-
__extends(Plugin, _super);
|
|
24
|
-
function Plugin(container, settings) {
|
|
25
|
-
return _super.call(this, container, settings) || this;
|
|
26
|
-
}
|
|
27
|
-
return Plugin;
|
|
28
|
-
}(platform_1.Plugin));
|
|
29
|
-
exports.default = Plugin;
|
package/lib/verify-auth.d.ts
DELETED
package/lib/verify-auth.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var verifyAuth = function (host, widgetName) {
|
|
4
|
-
var url = "".concat(host).concat(widgetName, "/interfaceauthorized");
|
|
5
|
-
return fetch(url, {
|
|
6
|
-
method: 'GET',
|
|
7
|
-
credentials: 'include',
|
|
8
|
-
}).then(function (response) { return response.status === 200 && response.ok; });
|
|
9
|
-
};
|
|
10
|
-
exports.default = verifyAuth;
|
package/lib/version.d.ts
DELETED
package/lib/version.js
DELETED
package/lib/widget-type.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var platform_1 = require("@webprovisions/platform");
|
|
19
|
-
/**
|
|
20
|
-
* Base class for a Humany widget.
|
|
21
|
-
*/
|
|
22
|
-
var WidgetType = /** @class */ (function (_super) {
|
|
23
|
-
__extends(WidgetType, _super);
|
|
24
|
-
function WidgetType(container) {
|
|
25
|
-
return _super.call(this, container) || this;
|
|
26
|
-
}
|
|
27
|
-
return WidgetType;
|
|
28
|
-
}(platform_1.WidgetType));
|
|
29
|
-
exports.default = WidgetType;
|
package/lib-esm/bootstrap.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { bootstrapImplementation } from '@webprovisions/bootstrapping';
|
|
2
|
-
import { selectImplementations } from '@webprovisions/platform';
|
|
3
|
-
/**
|
|
4
|
-
* Bootstraps an `Implementation` by scanning trigger elements and attaches them to
|
|
5
|
-
* their corresponding widgets.
|
|
6
|
-
*/
|
|
7
|
-
export default (function (implementation, configure, options) {
|
|
8
|
-
if (options === void 0) { options = {}; }
|
|
9
|
-
return bootstrapImplementation(implementation, implementation.bindings, function () {
|
|
10
|
-
var runtimeConfigurationHandlers = implementation.container
|
|
11
|
-
.get('$runtimecfg')
|
|
12
|
-
.map(function (cfgHandlerArgs) {
|
|
13
|
-
var fnOrSelector = cfgHandlerArgs[0];
|
|
14
|
-
if (typeof fnOrSelector === 'function') {
|
|
15
|
-
return fnOrSelector;
|
|
16
|
-
}
|
|
17
|
-
if (selectImplementations(fnOrSelector)(implementation)) {
|
|
18
|
-
return cfgHandlerArgs[1];
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
.filter(function (handler) { return !!handler; });
|
|
22
|
-
return (configure ? [configure] : []).concat(runtimeConfigurationHandlers);
|
|
23
|
-
}, options.rootElementResolver || (function () { return document.body; }));
|
|
24
|
-
});
|
package/lib-esm/data-types.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
export declare type Symbol = {
|
|
2
|
-
type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
|
|
3
|
-
content: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type Guide = {
|
|
6
|
-
id: string;
|
|
7
|
-
title: string;
|
|
8
|
-
tags: Tag[];
|
|
9
|
-
published?: string;
|
|
10
|
-
modified?: string;
|
|
11
|
-
publishedBy?: string;
|
|
12
|
-
modifiedBy?: string;
|
|
13
|
-
};
|
|
14
|
-
export declare type Category = {
|
|
15
|
-
id: string;
|
|
16
|
-
title: string;
|
|
17
|
-
symbol?: Symbol;
|
|
18
|
-
activeSymbol?: Symbol;
|
|
19
|
-
description?: string;
|
|
20
|
-
items?: Category[];
|
|
21
|
-
matches?: number;
|
|
22
|
-
};
|
|
23
|
-
export declare type Tag = {
|
|
24
|
-
id: string;
|
|
25
|
-
title: string;
|
|
26
|
-
symbol?: Symbol;
|
|
27
|
-
matches?: number;
|
|
28
|
-
defaultIcon?: Symbol;
|
|
29
|
-
activeIcon?: Symbol;
|
|
30
|
-
};
|
|
31
|
-
export declare enum DialogItemType {
|
|
32
|
-
guide = "guide",
|
|
33
|
-
link = "link",
|
|
34
|
-
default = "default"
|
|
35
|
-
}
|
|
36
|
-
export declare type DialogItem = {
|
|
37
|
-
id: string;
|
|
38
|
-
title: string;
|
|
39
|
-
parent: Guide;
|
|
40
|
-
type: DialogItemType;
|
|
41
|
-
connection?: string;
|
|
42
|
-
href?: string;
|
|
43
|
-
target?: string;
|
|
44
|
-
};
|
|
45
|
-
export declare type GuideCategoryBrowserList = {
|
|
46
|
-
id: string;
|
|
47
|
-
title: string;
|
|
48
|
-
symbol?: Symbol;
|
|
49
|
-
guides: Guide[];
|
|
50
|
-
paging: boolean;
|
|
51
|
-
pager?: string;
|
|
52
|
-
};
|
|
53
|
-
export declare type Notification = {
|
|
54
|
-
id: string;
|
|
55
|
-
title: string;
|
|
56
|
-
body: string;
|
|
57
|
-
modified?: string;
|
|
58
|
-
expandable?: boolean;
|
|
59
|
-
};
|
|
60
|
-
export declare type NotificationList = {
|
|
61
|
-
id: string;
|
|
62
|
-
title?: string;
|
|
63
|
-
symbol?: Symbol;
|
|
64
|
-
notifications: Notification[];
|
|
65
|
-
defaultHeaderOptions?: {
|
|
66
|
-
visible: boolean;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export declare type Tab = {
|
|
70
|
-
title: string;
|
|
71
|
-
name: string;
|
|
72
|
-
aliases: string[];
|
|
73
|
-
};
|
|
74
|
-
export declare type WidgetEntry = {
|
|
75
|
-
id: string;
|
|
76
|
-
type: string;
|
|
77
|
-
content: {
|
|
78
|
-
open: boolean;
|
|
79
|
-
};
|
|
80
|
-
origin: string;
|
|
81
|
-
};
|
|
82
|
-
export declare enum PickerTypes {
|
|
83
|
-
MODAL = "modal",
|
|
84
|
-
DRAWER = "drawer",
|
|
85
|
-
DROPDOWN = "dropdown",
|
|
86
|
-
NONE = "none"
|
|
87
|
-
}
|
package/lib-esm/data-types.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export var DialogItemType;
|
|
2
|
-
(function (DialogItemType) {
|
|
3
|
-
DialogItemType["guide"] = "guide";
|
|
4
|
-
DialogItemType["link"] = "link";
|
|
5
|
-
DialogItemType["default"] = "default";
|
|
6
|
-
})(DialogItemType || (DialogItemType = {}));
|
|
7
|
-
export var PickerTypes;
|
|
8
|
-
(function (PickerTypes) {
|
|
9
|
-
PickerTypes["MODAL"] = "modal";
|
|
10
|
-
PickerTypes["DRAWER"] = "drawer";
|
|
11
|
-
PickerTypes["DROPDOWN"] = "dropdown";
|
|
12
|
-
PickerTypes["NONE"] = "none";
|
|
13
|
-
})(PickerTypes || (PickerTypes = {}));
|
package/lib-esm/humany.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
|
-
import { ConfigurationApi as BootstrappingConfigurationApi, } from '@webprovisions/bootstrapping';
|
|
28
|
-
import { Environment, version as webprovisionsVersion, } from '@webprovisions/platform';
|
|
29
|
-
import version from './version';
|
|
30
|
-
/**
|
|
31
|
-
* The Humany widget runtime.
|
|
32
|
-
*/
|
|
33
|
-
var Humany = /** @class */ (function (_super) {
|
|
34
|
-
__extends(Humany, _super);
|
|
35
|
-
function Humany(name, configurationApiExtensions) {
|
|
36
|
-
if (configurationApiExtensions === void 0) { configurationApiExtensions = []; }
|
|
37
|
-
return _super.call(this, name, configurationApiExtensions, {
|
|
38
|
-
transformPluginSettings: function (settings, name, container) {
|
|
39
|
-
var $settings = container.get('$settings');
|
|
40
|
-
var configPluginSettings = $settings.plugins && name ? $settings.plugins[name] || {} : {};
|
|
41
|
-
return __assign(__assign({}, configPluginSettings), settings);
|
|
42
|
-
},
|
|
43
|
-
}) || this;
|
|
44
|
-
}
|
|
45
|
-
Humany.prototype.createImplementation = function (configuration) {
|
|
46
|
-
var implementation = _super.prototype.createImplementation.call(this, configuration);
|
|
47
|
-
implementation.bindings = configuration.bindings;
|
|
48
|
-
return implementation;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Performs navigation for widgets matching the specified selector by invoking a
|
|
52
|
-
* 'navigate' command.
|
|
53
|
-
* @param selector Widget selector matching the widget(s) to perform navigation on.
|
|
54
|
-
* @param route Route name.
|
|
55
|
-
* @param params Route params.
|
|
56
|
-
*/
|
|
57
|
-
Humany.prototype.navigate = function (selector, route, params) {
|
|
58
|
-
this.widgets
|
|
59
|
-
.query(selector)
|
|
60
|
-
.forEach(function (widget) { return widget.invoke('navigate', { route: route, params: params }); });
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Creates a `Humany` runtime based on provided configuration.
|
|
64
|
-
* @param configuration Runtime configuration.
|
|
65
|
-
*/
|
|
66
|
-
Humany.create = function (configuration) {
|
|
67
|
-
if (configuration === void 0) { configuration = {}; }
|
|
68
|
-
var configurationApiExtensions = [BootstrappingConfigurationApi].concat(configuration.configurationApiExtensions || []);
|
|
69
|
-
return new Humany('humany', configurationApiExtensions);
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Creates a `Humany` runtime based on provided configuration and retains configuration handlers
|
|
73
|
-
* registered on global context. Use this factory to fully support the default embed script.
|
|
74
|
-
* Will return any existing `Humany` runtime if available.
|
|
75
|
-
* @param configuration Runtime configuration.
|
|
76
|
-
* @param global Object to read configuration handlers from (default: window).
|
|
77
|
-
*/
|
|
78
|
-
Humany.createFromGlobal = function (globalHumany, configuration) {
|
|
79
|
-
if (configuration === void 0) { configuration = {}; }
|
|
80
|
-
if (this.isRuntime(globalHumany)) {
|
|
81
|
-
globalHumany.patch(configuration);
|
|
82
|
-
return globalHumany;
|
|
83
|
-
}
|
|
84
|
-
var runtimeConfiguration = [];
|
|
85
|
-
var tempRuntimeConfiguration = globalHumany && globalHumany._c;
|
|
86
|
-
if (tempRuntimeConfiguration) {
|
|
87
|
-
tempRuntimeConfiguration.forEach(function (args) { return runtimeConfiguration.push(args); });
|
|
88
|
-
}
|
|
89
|
-
var runtime = this.create(configuration);
|
|
90
|
-
runtime.container.register('$runtimecfg', runtimeConfiguration);
|
|
91
|
-
return runtime;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Determines whether the specified object is a valid `Humany` runtime.
|
|
95
|
-
* @param obj Object to compare.
|
|
96
|
-
*/
|
|
97
|
-
Humany.isRuntime = function (obj) {
|
|
98
|
-
if (obj &&
|
|
99
|
-
typeof obj === 'object' &&
|
|
100
|
-
obj.container &&
|
|
101
|
-
typeof obj.container.get === 'function' &&
|
|
102
|
-
obj.container.get('$environment') === obj &&
|
|
103
|
-
obj.container.owner === obj) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
return false;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Version of the Humany runtime.
|
|
110
|
-
*/
|
|
111
|
-
Humany.version = "".concat(version, " (").concat(webprovisionsVersion, ")");
|
|
112
|
-
return Humany;
|
|
113
|
-
}(Environment));
|
|
114
|
-
export default Humany;
|