solid-ui 2.4.14-46ae8b5d → 2.4.14-alpha
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.md +0 -0
- package/README.md +0 -0
- package/lib/acl/access-controller.d.ts +0 -0
- package/lib/acl/access-controller.d.ts.map +0 -0
- package/lib/acl/access-controller.js +334 -441
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.d.ts +1 -1
- package/lib/acl/access-groups.d.ts.map +1 -1
- package/lib/acl/access-groups.js +347 -492
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.d.ts +0 -0
- package/lib/acl/acl-control.d.ts.map +0 -0
- package/lib/acl/acl-control.js +168 -198
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.d.ts +1 -1
- package/lib/acl/acl.d.ts.map +1 -1
- package/lib/acl/acl.js +444 -459
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.d.ts +0 -0
- package/lib/acl/add-agent-buttons.d.ts.map +0 -0
- package/lib/acl/add-agent-buttons.js +318 -515
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.d.ts +0 -0
- package/lib/acl/index.d.ts.map +0 -0
- package/lib/acl/index.js +27 -35
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/styles.d.ts +0 -0
- package/lib/acl/styles.d.ts.map +0 -0
- package/lib/acl/styles.js +84 -90
- package/lib/acl/styles.js.map +1 -1
- package/lib/acl/types.d.ts +0 -0
- package/lib/acl/types.d.ts.map +0 -0
- package/lib/acl/types.js +5 -4
- package/lib/acl/types.js.map +1 -1
- package/lib/authn/authSession.d.ts +0 -0
- package/lib/authn/authSession.d.ts.map +0 -0
- package/lib/authn/authSession.js +14 -21
- package/lib/authn/authSession.js.map +1 -1
- package/lib/authn/authn.d.ts +0 -0
- package/lib/authn/authn.d.ts.map +0 -0
- package/lib/authn/authn.js +1391 -1935
- package/lib/authn/authn.js.map +1 -1
- package/lib/authn/config-default.js +0 -0
- package/lib/authn/config-default.js.map +0 -0
- package/lib/authn/index.d.ts +0 -0
- package/lib/authn/index.d.ts.map +0 -0
- package/lib/authn/index.js +26 -37
- package/lib/authn/index.js.map +1 -1
- package/lib/authn/signup.js +0 -0
- package/lib/authn/signup.js.map +0 -0
- package/lib/authn/types.d.ts +0 -0
- package/lib/authn/types.d.ts.map +0 -0
- package/lib/authn/types.js +1 -4
- package/lib/authn/types.js.map +1 -1
- package/lib/chat/bookmarks.js +0 -0
- package/lib/chat/bookmarks.js.map +0 -0
- package/lib/chat/dateFolder.js +0 -0
- package/lib/chat/dateFolder.js.map +0 -0
- package/lib/chat/infinite.js +0 -0
- package/lib/chat/infinite.js.map +0 -0
- package/lib/chat/message.js +0 -0
- package/lib/chat/message.js.map +0 -0
- package/lib/chat/messageTools.js +0 -0
- package/lib/chat/messageTools.js.map +0 -0
- package/lib/chat/thread.js +0 -0
- package/lib/chat/thread.js.map +0 -0
- package/lib/create/create.d.ts +0 -0
- package/lib/create/create.d.ts.map +0 -0
- package/lib/create/create.js +209 -214
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.d.ts +0 -0
- package/lib/create/index.d.ts.map +0 -0
- package/lib/create/index.js +4 -10
- package/lib/create/index.js.map +1 -1
- package/lib/create/types.d.ts +0 -0
- package/lib/create/types.d.ts.map +0 -0
- package/lib/create/types.js +1 -4
- package/lib/create/types.js.map +1 -1
- package/lib/debug.d.ts +0 -0
- package/lib/debug.d.ts.map +0 -0
- package/lib/debug.js +30 -28
- package/lib/debug.js.map +1 -1
- package/lib/folders.js +0 -0
- package/lib/folders.js.map +0 -0
- package/lib/footer/index.d.ts +0 -0
- package/lib/footer/index.d.ts.map +0 -0
- package/lib/footer/index.js +109 -126
- package/lib/footer/index.js.map +1 -1
- package/lib/footer/styleMap.d.ts +0 -0
- package/lib/footer/styleMap.d.ts.map +0 -0
- package/lib/footer/styleMap.js +7 -11
- package/lib/footer/styleMap.js.map +1 -1
- package/lib/header/empty-profile.d.ts +0 -0
- package/lib/header/empty-profile.d.ts.map +0 -0
- package/lib/header/empty-profile.js +2 -6
- package/lib/header/empty-profile.js.map +1 -1
- package/lib/header/index.d.ts +0 -0
- package/lib/header/index.d.ts.map +0 -0
- package/lib/header/index.js +285 -361
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.d.ts +0 -0
- package/lib/header/styleMap.d.ts.map +0 -0
- package/lib/header/styleMap.js +116 -132
- package/lib/header/styleMap.js.map +1 -1
- package/lib/iconBase.d.ts +0 -0
- package/lib/iconBase.d.ts.map +0 -0
- package/lib/iconBase.js +23 -30
- package/lib/iconBase.js.map +1 -1
- package/lib/icons/solid_logo.d.ts +0 -0
- package/lib/icons/solid_logo.d.ts.map +0 -0
- package/lib/icons/solid_logo.js +0 -0
- package/lib/icons/solid_logo.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +103 -207
- package/lib/index.js.map +1 -1
- package/lib/jss/index.d.ts +0 -0
- package/lib/jss/index.d.ts.map +0 -0
- package/lib/jss/index.js +21 -30
- package/lib/jss/index.js.map +1 -1
- package/lib/log.d.ts +0 -0
- package/lib/log.d.ts.map +0 -0
- package/lib/log.js +83 -131
- package/lib/log.js.map +1 -1
- package/lib/logic.d.ts +0 -0
- package/lib/logic.d.ts.map +0 -0
- package/lib/logic.js +82 -69
- package/lib/logic.js.map +1 -1
- package/lib/matrix/index.d.ts +0 -0
- package/lib/matrix/index.d.ts.map +0 -0
- package/lib/matrix/index.js +4 -10
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.d.ts +0 -0
- package/lib/matrix/matrix.d.ts.map +0 -0
- package/lib/matrix/matrix.js +210 -237
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/matrix/types.d.ts +0 -0
- package/lib/matrix/types.d.ts.map +0 -0
- package/lib/matrix/types.js +1 -4
- package/lib/matrix/types.js.map +1 -1
- package/lib/media/index.d.ts +0 -0
- package/lib/media/index.d.ts.map +0 -0
- package/lib/media/index.js +5 -11
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.d.ts +0 -0
- package/lib/media/media-capture.d.ts.map +0 -0
- package/lib/media/media-capture.js +187 -181
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js +0 -0
- package/lib/messageArea.js.map +0 -0
- package/lib/noun_Camera_1618446_000000.js +0 -0
- package/lib/noun_Camera_1618446_000000.js.map +0 -0
- package/lib/ns.js +0 -0
- package/lib/ns.js.map +0 -0
- package/lib/pad.d.ts +0 -0
- package/lib/pad.d.ts.map +0 -0
- package/lib/pad.js +794 -954
- package/lib/pad.js.map +1 -1
- package/lib/participation.d.ts +0 -0
- package/lib/participation.d.ts.map +0 -0
- package/lib/participation.js +170 -199
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +0 -0
- package/lib/preferences.js.map +0 -0
- package/lib/stories/decorators.js +0 -0
- package/lib/stories/decorators.js.map +0 -0
- package/lib/style.js +0 -0
- package/lib/style.js.map +0 -0
- package/lib/table.js +0 -0
- package/lib/table.js.map +0 -0
- package/lib/tabs.d.ts +0 -0
- package/lib/tabs.d.ts.map +0 -0
- package/lib/tabs.js +235 -342
- package/lib/tabs.js.map +1 -1
- package/lib/typings.d.js +0 -0
- package/lib/typings.d.js.map +0 -0
- package/lib/utils/headerFooterHelpers.d.ts +0 -0
- package/lib/utils/headerFooterHelpers.d.ts.map +0 -0
- package/lib/utils/headerFooterHelpers.js +130 -155
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +0 -0
- package/lib/utils/index.js.map +0 -0
- package/lib/utils/label.d.ts +0 -0
- package/lib/utils/label.d.ts.map +0 -0
- package/lib/utils/label.js +121 -113
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.d.ts +0 -0
- package/lib/versionInfo.d.ts.map +0 -0
- package/lib/versionInfo.js +23 -28
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +9 -9
- package/lib/webpack-bundle.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.d.ts +0 -0
- package/lib/widgets/buttons/iconLinks.d.ts.map +0 -0
- package/lib/widgets/buttons/iconLinks.js +19 -30
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.d.ts +0 -0
- package/lib/widgets/buttons.d.ts.map +0 -0
- package/lib/widgets/buttons.js +935 -1113
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js +0 -0
- package/lib/widgets/dragAndDrop.js.map +0 -0
- package/lib/widgets/error.d.ts +0 -0
- package/lib/widgets/error.d.ts.map +0 -0
- package/lib/widgets/error.js +18 -24
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +234 -325
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteField.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteField.js +246 -276
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +317 -497
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/language.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/language.js +159 -212
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/publicData.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/publicData.js +485 -718
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.d.ts +0 -0
- package/lib/widgets/forms/basic.d.ts.map +0 -0
- package/lib/widgets/forms/basic.js +208 -239
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.d.ts +0 -0
- package/lib/widgets/forms/comment.d.ts.map +0 -0
- package/lib/widgets/forms/comment.js +48 -48
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.d.ts +0 -0
- package/lib/widgets/forms/fieldFunction.d.ts.map +0 -0
- package/lib/widgets/forms/fieldFunction.js +31 -50
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.d.ts +0 -0
- package/lib/widgets/forms/fieldParams.d.ts.map +0 -0
- package/lib/widgets/forms/fieldParams.js +102 -81
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.d.ts +0 -0
- package/lib/widgets/forms/formStyle.d.ts.map +0 -0
- package/lib/widgets/forms/formStyle.js +52 -50
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +0 -0
- package/lib/widgets/forms.js.map +0 -0
- package/lib/widgets/index.js +0 -0
- package/lib/widgets/index.js.map +0 -0
- package/lib/widgets/peoplePicker.js +0 -0
- package/lib/widgets/peoplePicker.js.map +0 -0
- package/lib/widgets/widgetHelpers.d.ts +0 -0
- package/lib/widgets/widgetHelpers.d.ts.map +0 -0
- package/lib/widgets/widgetHelpers.js +18 -30
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,541 +1,344 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.AddAgentButtons = void 0;
|
|
11
|
-
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
-
|
|
18
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
|
-
var _iconBase = require("../iconBase");
|
|
23
|
-
|
|
24
|
-
var widgets = _interopRequireWildcard(require("../widgets"));
|
|
25
|
-
|
|
26
|
-
var ns = _interopRequireWildcard(require("../ns"));
|
|
27
|
-
|
|
28
|
-
var _authn = require("../authn/authn");
|
|
29
|
-
|
|
30
|
-
var utils = _interopRequireWildcard(require("../utils"));
|
|
31
|
-
|
|
32
|
-
var debug = _interopRequireWildcard(require("../debug"));
|
|
33
|
-
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
|
|
38
2
|
/**
|
|
39
3
|
* Contains the [[AddAgentButtons]] class
|
|
40
4
|
* @packageDocumentation
|
|
41
5
|
*/
|
|
42
|
-
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (_) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
exports.AddAgentButtons = void 0;
|
|
63
|
+
var iconBase_1 = require("../iconBase");
|
|
64
|
+
var widgets = __importStar(require("../widgets"));
|
|
65
|
+
var ns = __importStar(require("../ns"));
|
|
66
|
+
var authn_1 = require("../authn/authn");
|
|
67
|
+
var utils = __importStar(require("../utils"));
|
|
68
|
+
var debug = __importStar(require("../debug"));
|
|
43
69
|
/**
|
|
44
70
|
* Renders the Sharing pane's "+" button and the menus behind it,
|
|
45
71
|
* see https://github.com/solid/userguide/blob/main/views/sharing/userguide.md#add
|
|
46
72
|
*/
|
|
47
|
-
var AddAgentButtons =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
(0, _defineProperty2["default"])(this, "isExpanded", false);
|
|
54
|
-
this.rootElement = groupList.controller.dom.createElement('div');
|
|
55
|
-
this.barElement = groupList.controller.dom.createElement('div');
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
(0, _createClass2["default"])(AddAgentButtons, [{
|
|
59
|
-
key: "render",
|
|
60
|
-
value: function render() {
|
|
61
|
-
this.rootElement.innerHTML = '';
|
|
62
|
-
this.rootElement.appendChild(this.renderAddButton());
|
|
63
|
-
this.rootElement.appendChild(this.barElement);
|
|
64
|
-
return this.rootElement;
|
|
73
|
+
var AddAgentButtons = /** @class */ (function () {
|
|
74
|
+
function AddAgentButtons(groupList) {
|
|
75
|
+
this.groupList = groupList;
|
|
76
|
+
this.isExpanded = false;
|
|
77
|
+
this.rootElement = groupList.controller.dom.createElement('div');
|
|
78
|
+
this.barElement = groupList.controller.dom.createElement('div');
|
|
65
79
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, {
|
|
78
|
-
key: "renderBar",
|
|
79
|
-
value: function renderBar() {
|
|
80
|
-
this.barElement.innerHTML = '';
|
|
81
|
-
|
|
82
|
-
if (!this.isExpanded) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
this.barElement.appendChild(this.renderPersonButton());
|
|
87
|
-
this.barElement.appendChild(this.renderGroupButton());
|
|
88
|
-
this.barElement.appendChild(this.renderPublicButton());
|
|
89
|
-
this.barElement.appendChild(this.renderAuthenticatedAgentButton());
|
|
90
|
-
this.barElement.appendChild(this.renderBotButton());
|
|
91
|
-
this.barElement.appendChild(this.renderAppsButton());
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
key: "renderSimplifiedBar",
|
|
95
|
-
value: function renderSimplifiedBar(button) {
|
|
96
|
-
var _this2 = this;
|
|
97
|
-
|
|
98
|
-
Array.from(this.barElement.children).filter(function (element) {
|
|
99
|
-
return element !== button;
|
|
100
|
-
}).forEach(function (element) {
|
|
101
|
-
return _this2.barElement.removeChild(element);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: "renderPersonButton",
|
|
106
|
-
value: function renderPersonButton() {
|
|
107
|
-
var _this3 = this;
|
|
108
|
-
|
|
109
|
-
return widgets.button(this.groupList.controller.dom, _iconBase.icons.iconBase + widgets.iconForClass['vcard:Individual'], 'Add Person', function (event) {
|
|
110
|
-
_this3.renderSimplifiedBar(event.target);
|
|
111
|
-
|
|
112
|
-
_this3.renderNameForm(ns.vcard('Individual'), 'person').then(function (name) {
|
|
113
|
-
return _this3.addPerson(name);
|
|
114
|
-
}).then(function () {
|
|
115
|
-
return _this3.renderCleanup();
|
|
116
|
-
})["catch"](function (error) {
|
|
117
|
-
return _this3.groupList.controller.renderStatus(error);
|
|
80
|
+
AddAgentButtons.prototype.render = function () {
|
|
81
|
+
this.rootElement.innerHTML = '';
|
|
82
|
+
this.rootElement.appendChild(this.renderAddButton());
|
|
83
|
+
this.rootElement.appendChild(this.barElement);
|
|
84
|
+
return this.rootElement;
|
|
85
|
+
};
|
|
86
|
+
AddAgentButtons.prototype.renderAddButton = function () {
|
|
87
|
+
var _this = this;
|
|
88
|
+
return widgets.button(this.groupList.controller.dom, "".concat(iconBase_1.icons.iconBase, "noun_34653_green.svg"), 'Add ...', function () {
|
|
89
|
+
_this.toggleBar();
|
|
90
|
+
_this.renderBar();
|
|
118
91
|
});
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
92
|
+
};
|
|
93
|
+
AddAgentButtons.prototype.renderBar = function () {
|
|
94
|
+
this.barElement.innerHTML = '';
|
|
95
|
+
if (!this.isExpanded) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.barElement.appendChild(this.renderPersonButton());
|
|
99
|
+
this.barElement.appendChild(this.renderGroupButton());
|
|
100
|
+
this.barElement.appendChild(this.renderPublicButton());
|
|
101
|
+
this.barElement.appendChild(this.renderAuthenticatedAgentButton());
|
|
102
|
+
this.barElement.appendChild(this.renderBotButton());
|
|
103
|
+
this.barElement.appendChild(this.renderAppsButton());
|
|
104
|
+
};
|
|
105
|
+
AddAgentButtons.prototype.renderSimplifiedBar = function (button) {
|
|
106
|
+
var _this = this;
|
|
107
|
+
Array.from(this.barElement.children)
|
|
108
|
+
.filter(function (element) { return element !== button; })
|
|
109
|
+
.forEach(function (element) { return _this.barElement.removeChild(element); });
|
|
110
|
+
};
|
|
111
|
+
AddAgentButtons.prototype.renderPersonButton = function () {
|
|
112
|
+
var _this = this;
|
|
113
|
+
return widgets.button(this.groupList.controller.dom, iconBase_1.icons.iconBase + widgets.iconForClass['vcard:Individual'], 'Add Person', function (event) {
|
|
114
|
+
_this.renderSimplifiedBar(event.target);
|
|
115
|
+
_this.renderNameForm(ns.vcard('Individual'), 'person')
|
|
116
|
+
.then(function (name) { return _this.addPerson(name); })
|
|
117
|
+
.then(function () { return _this.renderCleanup(); })
|
|
118
|
+
.catch(function (error) { return _this.groupList.controller.renderStatus(error); });
|
|
135
119
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
value: function renderPublicButton() {
|
|
146
|
-
var _this5 = this;
|
|
147
|
-
|
|
148
|
-
return widgets.button(this.groupList.controller.dom, _iconBase.icons.iconBase + widgets.iconForClass['foaf:Agent'], 'Add Everyone', function () {
|
|
149
|
-
return _this5.addAgent(ns.foaf('Agent').uri).then(function () {
|
|
150
|
-
return _this5.groupList.controller.renderTemporaryStatus('Adding the general public to those who can read. Drag the globe to a different level to give them more access.');
|
|
151
|
-
}).then(function () {
|
|
152
|
-
return _this5.renderCleanup();
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}, {
|
|
157
|
-
key: "renderAuthenticatedAgentButton",
|
|
158
|
-
value: function renderAuthenticatedAgentButton() {
|
|
159
|
-
var _this6 = this;
|
|
160
|
-
|
|
161
|
-
return widgets.button(this.groupList.controller.dom, "".concat(_iconBase.icons.iconBase, "noun_99101.svg"), 'Anyone logged In', function () {
|
|
162
|
-
return _this6.addAgent(ns.acl('AuthenticatedAgent').uri).then(function () {
|
|
163
|
-
return _this6.groupList.controller.renderTemporaryStatus('Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.');
|
|
164
|
-
}).then(function () {
|
|
165
|
-
return _this6.renderCleanup();
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "renderBotButton",
|
|
171
|
-
value: function renderBotButton() {
|
|
172
|
-
var _this7 = this;
|
|
173
|
-
|
|
174
|
-
return widgets.button(this.groupList.controller.dom, _iconBase.icons.iconBase + 'noun_Robot_849764.svg', 'A Software Agent (bot)', function (event) {
|
|
175
|
-
_this7.renderSimplifiedBar(event.target);
|
|
176
|
-
|
|
177
|
-
_this7.renderNameForm(ns.schema('Application'), 'bot').then(function (name) {
|
|
178
|
-
return _this7.addBot(name);
|
|
179
|
-
}).then(function () {
|
|
180
|
-
return _this7.renderCleanup();
|
|
120
|
+
};
|
|
121
|
+
AddAgentButtons.prototype.renderGroupButton = function () {
|
|
122
|
+
var _this = this;
|
|
123
|
+
return widgets.button(this.groupList.controller.dom, iconBase_1.icons.iconBase + widgets.iconForClass['vcard:Group'], 'Add Group', function (event) {
|
|
124
|
+
_this.renderSimplifiedBar(event.target);
|
|
125
|
+
_this.renderNameForm(ns.vcard('Group'), 'group')
|
|
126
|
+
.then(function (name) { return _this.addGroup(name); })
|
|
127
|
+
.then(function () { return _this.renderCleanup(); })
|
|
128
|
+
.catch(function (error) { return _this.groupList.controller.renderStatus(error); });
|
|
181
129
|
});
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
Promise.race([existingApps, newApp]).then(function (origin) {
|
|
208
|
-
if (origin) {
|
|
209
|
-
_this8.groupList.addNewURI(origin);
|
|
210
|
-
}
|
|
211
|
-
}).then(function () {
|
|
212
|
-
return _this8.renderCleanup();
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
key: "renderAppsView",
|
|
218
|
-
value: function renderAppsView() {
|
|
219
|
-
var _this9 = this;
|
|
220
|
-
|
|
221
|
-
var trustedApplications = this.groupList.controller.context.session.paneRegistry.byName('trustedApplications');
|
|
222
|
-
|
|
223
|
-
if (trustedApplications) {
|
|
224
|
-
var trustedApplicationsElement = trustedApplications.render(null, this.groupList.controller.context);
|
|
225
|
-
trustedApplicationsElement.classList.add(this.groupList.controller.classes.trustedAppController);
|
|
226
|
-
var cancelButton = widgets.cancelButton(this.groupList.controller.dom, function () {
|
|
227
|
-
return _this9.renderCleanup();
|
|
130
|
+
};
|
|
131
|
+
AddAgentButtons.prototype.renderNameForm = function (type, noun) {
|
|
132
|
+
return widgets.askName(this.groupList.controller.dom, this.groupList.store, this.barElement, ns.vcard('URI'), type, noun);
|
|
133
|
+
};
|
|
134
|
+
AddAgentButtons.prototype.renderPublicButton = function () {
|
|
135
|
+
var _this = this;
|
|
136
|
+
return widgets.button(this.groupList.controller.dom, iconBase_1.icons.iconBase + widgets.iconForClass['foaf:Agent'], 'Add Everyone', function () { return _this.addAgent(ns.foaf('Agent').uri)
|
|
137
|
+
.then(function () { return _this.groupList.controller.renderTemporaryStatus('Adding the general public to those who can read. Drag the globe to a different level to give them more access.'); })
|
|
138
|
+
.then(function () { return _this.renderCleanup(); }); });
|
|
139
|
+
};
|
|
140
|
+
AddAgentButtons.prototype.renderAuthenticatedAgentButton = function () {
|
|
141
|
+
var _this = this;
|
|
142
|
+
return widgets.button(this.groupList.controller.dom, "".concat(iconBase_1.icons.iconBase, "noun_99101.svg"), 'Anyone logged In', function () { return _this.addAgent(ns.acl('AuthenticatedAgent').uri)
|
|
143
|
+
.then(function () { return _this.groupList.controller.renderTemporaryStatus('Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.'); })
|
|
144
|
+
.then(function () { return _this.renderCleanup(); }); });
|
|
145
|
+
};
|
|
146
|
+
AddAgentButtons.prototype.renderBotButton = function () {
|
|
147
|
+
var _this = this;
|
|
148
|
+
return widgets.button(this.groupList.controller.dom, iconBase_1.icons.iconBase + 'noun_Robot_849764.svg', 'A Software Agent (bot)', function (event) {
|
|
149
|
+
_this.renderSimplifiedBar(event.target);
|
|
150
|
+
_this.renderNameForm(ns.schema('Application'), 'bot')
|
|
151
|
+
.then(function (name) { return _this.addBot(name); })
|
|
152
|
+
.then(function () { return _this.renderCleanup(); });
|
|
228
153
|
});
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
this
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
trustedOrigins = trustedApps.flatMap(function (app) {
|
|
252
|
-
return _this10.groupList.store.each(app, ns.acl('origin'));
|
|
253
|
-
}); // @@ TODO fix as
|
|
254
|
-
|
|
255
|
-
this.barElement.appendChild(this.groupList.controller.dom.createElement('p')).textContent = "You have ".concat(trustedOrigins.length, " selected web apps.");
|
|
256
|
-
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
257
|
-
var appsTable = _this10.barElement.appendChild(_this10.groupList.controller.dom.createElement('table'));
|
|
258
|
-
|
|
259
|
-
appsTable.classList.add(_this10.groupList.controller.classes.trustedAppAddApplicationsTable);
|
|
260
|
-
trustedApps.forEach(function (app) {
|
|
261
|
-
var origin = _this10.groupList.store.any(app, ns.acl('origin')); // @@ TODO fix as
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
// @@ TODO fix as
|
|
265
|
-
if (!origin) {
|
|
266
|
-
reject(new Error("Unable to pick app: ".concat(app.value)));
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
var thingTR = widgets.personTR(_this10.groupList.controller.dom, ns.acl('origin'), origin, {});
|
|
270
|
-
|
|
271
|
-
var innerTable = _this10.groupList.controller.dom.createElement('table');
|
|
272
|
-
|
|
273
|
-
var innerRow = innerTable.appendChild(_this10.groupList.controller.dom.createElement('tr'));
|
|
274
|
-
var innerLeftColumn = innerRow.appendChild(_this10.groupList.controller.dom.createElement('td'));
|
|
275
|
-
innerLeftColumn.appendChild(thingTR);
|
|
276
|
-
var innerMiddleColumn = innerRow.appendChild(_this10.groupList.controller.dom.createElement('td'));
|
|
277
|
-
innerMiddleColumn.textContent = "Give access to ".concat(_this10.groupList.controller.noun, " ").concat(utils.label(_this10.groupList.controller.subject), "?");
|
|
278
|
-
var innerRightColumn = innerRow.appendChild(_this10.groupList.controller.dom.createElement('td'));
|
|
279
|
-
innerRightColumn.appendChild(widgets.continueButton(_this10.groupList.controller.dom, function () {
|
|
280
|
-
return resolve(origin.value);
|
|
281
|
-
}));
|
|
282
|
-
appsTable.appendChild(innerTable);
|
|
283
|
-
});
|
|
284
|
-
}));
|
|
285
|
-
|
|
286
|
-
case 6:
|
|
287
|
-
case "end":
|
|
288
|
-
return _context.stop();
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}, _callee, this);
|
|
292
|
-
}));
|
|
293
|
-
|
|
294
|
-
function renderAppsTable(_x) {
|
|
295
|
-
return _renderAppsTable.apply(this, arguments);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
return renderAppsTable;
|
|
299
|
-
}()
|
|
300
|
-
}, {
|
|
301
|
-
key: "renderCleanup",
|
|
302
|
-
value: function renderCleanup() {
|
|
303
|
-
this.renderBar();
|
|
304
|
-
this.groupList.render();
|
|
305
|
-
}
|
|
306
|
-
}, {
|
|
307
|
-
key: "addPerson",
|
|
308
|
-
value: function () {
|
|
309
|
-
var _addPerson = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(name) {
|
|
310
|
-
var domainNameRegexp;
|
|
311
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
312
|
-
while (1) {
|
|
313
|
-
switch (_context2.prev = _context2.next) {
|
|
314
|
-
case 0:
|
|
315
|
-
if (name) {
|
|
316
|
-
_context2.next = 2;
|
|
317
|
-
break;
|
|
154
|
+
};
|
|
155
|
+
AddAgentButtons.prototype.renderAppsButton = function () {
|
|
156
|
+
var _this = this;
|
|
157
|
+
return widgets.button(this.groupList.controller.dom, "".concat(iconBase_1.icons.iconBase, "noun_15177.svg"), 'A Web App (origin)', function (event) {
|
|
158
|
+
_this.renderSimplifiedBar(event.target);
|
|
159
|
+
var eventContext = {
|
|
160
|
+
div: _this.barElement,
|
|
161
|
+
dom: _this.groupList.controller.dom
|
|
162
|
+
};
|
|
163
|
+
var existingApps = _this.renderAppsTable(eventContext)
|
|
164
|
+
.catch(function (error) { return _this.groupList.controller.renderStatus(error); });
|
|
165
|
+
_this.renderAppsView();
|
|
166
|
+
var newApp = _this.renderNameForm(ns.schema('WebApplication'), 'webapp domain')
|
|
167
|
+
.then(function (name) { return _this.getOriginFromName(name); });
|
|
168
|
+
Promise.race([
|
|
169
|
+
existingApps,
|
|
170
|
+
newApp
|
|
171
|
+
])
|
|
172
|
+
.then(function (origin) {
|
|
173
|
+
if (origin) {
|
|
174
|
+
_this.groupList.addNewURI(origin);
|
|
318
175
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
176
|
+
})
|
|
177
|
+
.then(function () { return _this.renderCleanup(); });
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
AddAgentButtons.prototype.renderAppsView = function () {
|
|
181
|
+
var _this = this;
|
|
182
|
+
var trustedApplications = this.groupList.controller.context.session.paneRegistry.byName('trustedApplications');
|
|
183
|
+
if (trustedApplications) {
|
|
184
|
+
var trustedApplicationsElement = trustedApplications.render(null, this.groupList.controller.context);
|
|
185
|
+
trustedApplicationsElement.classList.add(this.groupList.controller.classes.trustedAppController);
|
|
186
|
+
var cancelButton = widgets.cancelButton(this.groupList.controller.dom, function () { return _this.renderCleanup(); });
|
|
187
|
+
cancelButton.classList.add(this.groupList.controller.classes.trustedAppCancelButton);
|
|
188
|
+
trustedApplicationsElement.insertBefore(cancelButton, trustedApplicationsElement.firstChild);
|
|
189
|
+
this.barElement.appendChild(trustedApplicationsElement);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
AddAgentButtons.prototype.renderAppsTable = function (eventContext) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
+
var trustedApps, trustedOrigins;
|
|
195
|
+
var _this = this;
|
|
196
|
+
return __generator(this, function (_a) {
|
|
197
|
+
switch (_a.label) {
|
|
198
|
+
case 0: return [4 /*yield*/, (0, authn_1.logInLoadProfile)(eventContext)];
|
|
199
|
+
case 1:
|
|
200
|
+
_a.sent();
|
|
201
|
+
trustedApps = this.groupList.store.each(eventContext.me, ns.acl('trustedApp')) // @@ TODO fix as
|
|
202
|
+
;
|
|
203
|
+
trustedOrigins = trustedApps.flatMap(function (app) { return _this.groupList.store.each(app, ns.acl('origin')); }) // @@ TODO fix as
|
|
204
|
+
;
|
|
205
|
+
this.barElement.appendChild(this.groupList.controller.dom.createElement('p')).textContent = "You have ".concat(trustedOrigins.length, " selected web apps.");
|
|
206
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
207
|
+
var appsTable = _this.barElement.appendChild(_this.groupList.controller.dom.createElement('table'));
|
|
208
|
+
appsTable.classList.add(_this.groupList.controller.classes.trustedAppAddApplicationsTable);
|
|
209
|
+
trustedApps.forEach(function (app) {
|
|
210
|
+
var origin = _this.groupList.store.any(app, ns.acl('origin')); // @@ TODO fix as
|
|
211
|
+
if (!origin) {
|
|
212
|
+
reject(new Error("Unable to pick app: ".concat(app.value)));
|
|
213
|
+
}
|
|
214
|
+
var thingTR = widgets.personTR(_this.groupList.controller.dom, ns.acl('origin'), origin, {});
|
|
215
|
+
var innerTable = _this.groupList.controller.dom.createElement('table');
|
|
216
|
+
var innerRow = innerTable.appendChild(_this.groupList.controller.dom.createElement('tr'));
|
|
217
|
+
var innerLeftColumn = innerRow.appendChild(_this.groupList.controller.dom.createElement('td'));
|
|
218
|
+
innerLeftColumn.appendChild(thingTR);
|
|
219
|
+
var innerMiddleColumn = innerRow.appendChild(_this.groupList.controller.dom.createElement('td'));
|
|
220
|
+
innerMiddleColumn.textContent = "Give access to ".concat(_this.groupList.controller.noun, " ").concat(utils.label(_this.groupList.controller.subject), "?");
|
|
221
|
+
var innerRightColumn = innerRow.appendChild(_this.groupList.controller.dom.createElement('td'));
|
|
222
|
+
innerRightColumn.appendChild(widgets.continueButton(_this.groupList.controller.dom, function () { return resolve(origin.value); }));
|
|
223
|
+
appsTable.appendChild(innerTable);
|
|
224
|
+
});
|
|
225
|
+
})];
|
|
368
226
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
AddAgentButtons.prototype.renderCleanup = function () {
|
|
231
|
+
this.renderBar();
|
|
232
|
+
this.groupList.render();
|
|
233
|
+
};
|
|
234
|
+
AddAgentButtons.prototype.addPerson = function (name) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
236
|
+
var domainNameRegexp;
|
|
237
|
+
return __generator(this, function (_a) {
|
|
238
|
+
switch (_a.label) {
|
|
239
|
+
case 0:
|
|
240
|
+
if (!name)
|
|
241
|
+
return [2 /*return*/, this.toggleBar()]; // user cancelled
|
|
242
|
+
domainNameRegexp = /^https?:/i;
|
|
243
|
+
if (!name.match(domainNameRegexp)) {
|
|
244
|
+
// @@ enforce in user input live like a form element
|
|
245
|
+
return [2 /*return*/, Promise.reject(new Error('Not a http URI'))];
|
|
246
|
+
}
|
|
247
|
+
// @@ check it actually is a person and has an owner who agrees they own it
|
|
248
|
+
debug.log("Adding to ACL person: ".concat(name));
|
|
249
|
+
return [4 /*yield*/, this.groupList.addNewURI(name)];
|
|
250
|
+
case 1:
|
|
251
|
+
_a.sent();
|
|
252
|
+
this.toggleBar();
|
|
253
|
+
return [2 /*return*/];
|
|
379
254
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
return addGroup;
|
|
405
|
-
}()
|
|
406
|
-
}, {
|
|
407
|
-
key: "addAgent",
|
|
408
|
-
value: function () {
|
|
409
|
-
var _addAgent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(agentUri) {
|
|
410
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
411
|
-
while (1) {
|
|
412
|
-
switch (_context4.prev = _context4.next) {
|
|
413
|
-
case 0:
|
|
414
|
-
_context4.next = 2;
|
|
415
|
-
return this.groupList.addNewURI(agentUri);
|
|
416
|
-
|
|
417
|
-
case 2:
|
|
418
|
-
this.toggleBar();
|
|
419
|
-
|
|
420
|
-
case 3:
|
|
421
|
-
case "end":
|
|
422
|
-
return _context4.stop();
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}, _callee4, this);
|
|
426
|
-
}));
|
|
427
|
-
|
|
428
|
-
function addAgent(_x4) {
|
|
429
|
-
return _addAgent.apply(this, arguments);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
return addAgent;
|
|
433
|
-
}()
|
|
434
|
-
}, {
|
|
435
|
-
key: "addBot",
|
|
436
|
-
value: function () {
|
|
437
|
-
var _addBot = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(name) {
|
|
438
|
-
var domainNameRegexp;
|
|
439
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
440
|
-
while (1) {
|
|
441
|
-
switch (_context5.prev = _context5.next) {
|
|
442
|
-
case 0:
|
|
443
|
-
if (name) {
|
|
444
|
-
_context5.next = 2;
|
|
445
|
-
break;
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
AddAgentButtons.prototype.addGroup = function (name) {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
260
|
+
var domainNameRegexp;
|
|
261
|
+
return __generator(this, function (_a) {
|
|
262
|
+
switch (_a.label) {
|
|
263
|
+
case 0:
|
|
264
|
+
if (!name)
|
|
265
|
+
return [2 /*return*/, this.toggleBar()]; // user cancelled
|
|
266
|
+
domainNameRegexp = /^https?:/i;
|
|
267
|
+
if (!name.match(domainNameRegexp)) {
|
|
268
|
+
// @@ enforce in user input live like a form element
|
|
269
|
+
return [2 /*return*/, Promise.reject(new Error('Not a http URI'))];
|
|
270
|
+
}
|
|
271
|
+
// @@ check it actually is a group and has an owner who agrees they own it
|
|
272
|
+
debug.log('Adding to ACL group: ' + name);
|
|
273
|
+
return [4 /*yield*/, this.groupList.addNewURI(name)];
|
|
274
|
+
case 1:
|
|
275
|
+
_a.sent();
|
|
276
|
+
this.toggleBar();
|
|
277
|
+
return [2 /*return*/];
|
|
446
278
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
AddAgentButtons.prototype.addAgent = function (agentUri) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
284
|
+
return __generator(this, function (_a) {
|
|
285
|
+
switch (_a.label) {
|
|
286
|
+
case 0: return [4 /*yield*/, this.groupList.addNewURI(agentUri)];
|
|
287
|
+
case 1:
|
|
288
|
+
_a.sent();
|
|
289
|
+
this.toggleBar();
|
|
290
|
+
return [2 /*return*/];
|
|
457
291
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
return addBot;
|
|
483
|
-
}()
|
|
484
|
-
}, {
|
|
485
|
-
key: "getOriginFromName",
|
|
486
|
-
value: function () {
|
|
487
|
-
var _getOriginFromName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(name) {
|
|
488
|
-
var domainNameRegexp, origin;
|
|
489
|
-
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
490
|
-
while (1) {
|
|
491
|
-
switch (_context6.prev = _context6.next) {
|
|
492
|
-
case 0:
|
|
493
|
-
if (name) {
|
|
494
|
-
_context6.next = 2;
|
|
495
|
-
break;
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
AddAgentButtons.prototype.addBot = function (name) {
|
|
296
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
297
|
+
var domainNameRegexp;
|
|
298
|
+
return __generator(this, function (_a) {
|
|
299
|
+
switch (_a.label) {
|
|
300
|
+
case 0:
|
|
301
|
+
if (!name)
|
|
302
|
+
return [2 /*return*/, this.toggleBar()]; // user cancelled
|
|
303
|
+
domainNameRegexp = /^https?:/i;
|
|
304
|
+
if (!name.match(domainNameRegexp)) {
|
|
305
|
+
// @@ enforce in user input live like a form element
|
|
306
|
+
return [2 /*return*/, Promise.reject(new Error('Not a http URI'))];
|
|
307
|
+
}
|
|
308
|
+
// @@ check it actually is a bot and has an owner who agrees they own it
|
|
309
|
+
debug.log('Adding to ACL bot: ' + name);
|
|
310
|
+
return [4 /*yield*/, this.groupList.addNewURI(name)];
|
|
311
|
+
case 1:
|
|
312
|
+
_a.sent();
|
|
313
|
+
this.toggleBar();
|
|
314
|
+
return [2 /*return*/];
|
|
496
315
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if (name
|
|
505
|
-
|
|
506
|
-
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
AddAgentButtons.prototype.getOriginFromName = function (name) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
321
|
+
var domainNameRegexp, origin;
|
|
322
|
+
return __generator(this, function (_a) {
|
|
323
|
+
if (!name)
|
|
324
|
+
return [2 /*return*/, Promise.resolve()]; // user cancelled
|
|
325
|
+
domainNameRegexp = /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i;
|
|
326
|
+
// https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch08s15.html
|
|
327
|
+
if (!name.match(domainNameRegexp)) {
|
|
328
|
+
// @@ enforce in user input live like a form element
|
|
329
|
+
return [2 /*return*/, Promise.reject(new Error('Not a domain name'))];
|
|
507
330
|
}
|
|
508
|
-
|
|
509
|
-
return _context6.abrupt("return", Promise.reject(new Error('Not a domain name')));
|
|
510
|
-
|
|
511
|
-
case 5:
|
|
512
331
|
origin = 'https://' + name;
|
|
513
332
|
debug.log('Adding to ACL origin: ' + origin);
|
|
514
333
|
this.toggleBar();
|
|
515
|
-
return
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
function getOriginFromName(_x6) {
|
|
526
|
-
return _getOriginFromName.apply(this, arguments);
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
return getOriginFromName;
|
|
530
|
-
}()
|
|
531
|
-
}, {
|
|
532
|
-
key: "toggleBar",
|
|
533
|
-
value: function toggleBar() {
|
|
534
|
-
this.isExpanded = !this.isExpanded;
|
|
535
|
-
}
|
|
536
|
-
}]);
|
|
537
|
-
return AddAgentButtons;
|
|
538
|
-
}();
|
|
539
|
-
|
|
334
|
+
return [2 /*return*/, origin];
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
};
|
|
338
|
+
AddAgentButtons.prototype.toggleBar = function () {
|
|
339
|
+
this.isExpanded = !this.isExpanded;
|
|
340
|
+
};
|
|
341
|
+
return AddAgentButtons;
|
|
342
|
+
}());
|
|
540
343
|
exports.AddAgentButtons = AddAgentButtons;
|
|
541
344
|
//# sourceMappingURL=add-agent-buttons.js.map
|