solid-ui 2.4.14-alpha → 2.4.14-bbf45639-aade069c
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 +441 -334
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.d.ts +1 -2
- package/lib/acl/access-groups.d.ts.map +1 -1
- package/lib/acl/access-groups.js +495 -347
- 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 +198 -168
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.d.ts +1 -2
- package/lib/acl/acl.d.ts.map +1 -1
- package/lib/acl/acl.js +463 -444
- 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 +515 -318
- 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 +35 -27
- 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 +90 -84
- 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 +4 -5
- 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 +21 -14
- 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 +1935 -1391
- 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 +37 -26
- 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 +4 -1
- 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 +214 -209
- 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 +10 -4
- 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 +4 -1
- 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 +28 -30
- 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 +126 -109
- 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 +11 -7
- 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 +6 -2
- 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 +361 -285
- 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 +132 -116
- 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 +30 -23
- 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 +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +207 -103
- 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 +30 -21
- 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 +131 -83
- package/lib/log.js.map +1 -1
- package/lib/logic.d.ts +2 -2
- package/lib/logic.d.ts.map +1 -1
- package/lib/logic.js +73 -82
- 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 +10 -4
- 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 +237 -210
- 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 +4 -1
- 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 +11 -5
- 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 +181 -187
- 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 +954 -794
- 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 +199 -170
- 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 +342 -235
- 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 +155 -130
- 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 +113 -121
- 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 +28 -23
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +264 -175
- 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 +30 -19
- 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 +1113 -935
- 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 +24 -18
- 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 +325 -234
- 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 +280 -246
- 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 +497 -317
- 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 +214 -159
- 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 +725 -485
- 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 +239 -208
- 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 +50 -31
- 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 +81 -102
- 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 +50 -52
- 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 +30 -18
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,344 +1,541 @@
|
|
|
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
|
+
|
|
2
38
|
/**
|
|
3
39
|
* Contains the [[AddAgentButtons]] class
|
|
4
40
|
* @packageDocumentation
|
|
5
41
|
*/
|
|
6
|
-
|
|
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"));
|
|
42
|
+
|
|
69
43
|
/**
|
|
70
44
|
* Renders the Sharing pane's "+" button and the menus behind it,
|
|
71
45
|
* see https://github.com/solid/userguide/blob/main/views/sharing/userguide.md#add
|
|
72
46
|
*/
|
|
73
|
-
var AddAgentButtons =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
47
|
+
var AddAgentButtons = /*#__PURE__*/function () {
|
|
48
|
+
function AddAgentButtons(groupList) {
|
|
49
|
+
(0, _classCallCheck2["default"])(this, AddAgentButtons);
|
|
50
|
+
this.groupList = groupList;
|
|
51
|
+
(0, _defineProperty2["default"])(this, "rootElement", void 0);
|
|
52
|
+
(0, _defineProperty2["default"])(this, "barElement", void 0);
|
|
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;
|
|
79
65
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
66
|
+
}, {
|
|
67
|
+
key: "renderAddButton",
|
|
68
|
+
value: function renderAddButton() {
|
|
69
|
+
var _this = this;
|
|
70
|
+
|
|
71
|
+
return widgets.button(this.groupList.controller.dom, "".concat(_iconBase.icons.iconBase, "noun_34653_green.svg"), 'Add ...', function () {
|
|
72
|
+
_this.toggleBar();
|
|
73
|
+
|
|
74
|
+
_this.renderBar();
|
|
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);
|
|
91
118
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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); });
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "renderGroupButton",
|
|
123
|
+
value: function renderGroupButton() {
|
|
124
|
+
var _this4 = this;
|
|
125
|
+
|
|
126
|
+
return widgets.button(this.groupList.controller.dom, _iconBase.icons.iconBase + widgets.iconForClass['vcard:Group'], 'Add Group', function (event) {
|
|
127
|
+
_this4.renderSimplifiedBar(event.target);
|
|
128
|
+
|
|
129
|
+
_this4.renderNameForm(ns.vcard('Group'), 'group').then(function (name) {
|
|
130
|
+
return _this4.addGroup(name);
|
|
131
|
+
}).then(function () {
|
|
132
|
+
return _this4.renderCleanup();
|
|
133
|
+
})["catch"](function (error) {
|
|
134
|
+
return _this4.groupList.controller.renderStatus(error);
|
|
119
135
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
key: "renderNameForm",
|
|
140
|
+
value: function renderNameForm(type, noun) {
|
|
141
|
+
return widgets.askName(this.groupList.controller.dom, this.groupList.store, this.barElement, ns.vcard('URI'), type, noun);
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "renderPublicButton",
|
|
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();
|
|
129
153
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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(); });
|
|
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();
|
|
153
166
|
});
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
Promise.race([
|
|
169
|
-
existingApps,
|
|
170
|
-
newApp
|
|
171
|
-
])
|
|
172
|
-
.then(function (origin) {
|
|
173
|
-
if (origin) {
|
|
174
|
-
_this.groupList.addNewURI(origin);
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
.then(function () { return _this.renderCleanup(); });
|
|
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();
|
|
178
181
|
});
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
})];
|
|
226
|
-
}
|
|
227
|
-
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
key: "renderAppsButton",
|
|
186
|
+
value: function renderAppsButton() {
|
|
187
|
+
var _this8 = this;
|
|
188
|
+
|
|
189
|
+
return widgets.button(this.groupList.controller.dom, "".concat(_iconBase.icons.iconBase, "noun_15177.svg"), 'A Web App (origin)', function (event) {
|
|
190
|
+
_this8.renderSimplifiedBar(event.target);
|
|
191
|
+
|
|
192
|
+
var eventContext = {
|
|
193
|
+
div: _this8.barElement,
|
|
194
|
+
dom: _this8.groupList.controller.dom
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var existingApps = _this8.renderAppsTable(eventContext)["catch"](function (error) {
|
|
198
|
+
return _this8.groupList.controller.renderStatus(error);
|
|
228
199
|
});
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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*/];
|
|
254
|
-
}
|
|
255
|
-
});
|
|
200
|
+
|
|
201
|
+
_this8.renderAppsView();
|
|
202
|
+
|
|
203
|
+
var newApp = _this8.renderNameForm(ns.schema('WebApplication'), 'webapp domain').then(function (name) {
|
|
204
|
+
return _this8.getOriginFromName(name);
|
|
256
205
|
});
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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*/];
|
|
278
|
-
}
|
|
279
|
-
});
|
|
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();
|
|
280
213
|
});
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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();
|
|
293
228
|
});
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
229
|
+
cancelButton.classList.add(this.groupList.controller.classes.trustedAppCancelButton);
|
|
230
|
+
trustedApplicationsElement.insertBefore(cancelButton, trustedApplicationsElement.firstChild);
|
|
231
|
+
this.barElement.appendChild(trustedApplicationsElement);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
key: "renderAppsTable",
|
|
236
|
+
value: function () {
|
|
237
|
+
var _renderAppsTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(eventContext) {
|
|
238
|
+
var _this10 = this;
|
|
239
|
+
|
|
240
|
+
var trustedApps, trustedOrigins;
|
|
241
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
242
|
+
while (1) {
|
|
243
|
+
switch (_context.prev = _context.next) {
|
|
244
|
+
case 0:
|
|
245
|
+
_context.next = 2;
|
|
246
|
+
return (0, _authn.logInLoadProfile)(eventContext);
|
|
247
|
+
|
|
248
|
+
case 2:
|
|
249
|
+
trustedApps = this.groupList.store.each(eventContext.me, ns.acl('trustedApp')); // @@ TODO fix as
|
|
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;
|
|
315
318
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
|
|
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'))];
|
|
319
|
+
|
|
320
|
+
return _context2.abrupt("return", this.toggleBar());
|
|
321
|
+
|
|
322
|
+
case 2:
|
|
323
|
+
// user cancelled
|
|
324
|
+
domainNameRegexp = /^https?:/i;
|
|
325
|
+
|
|
326
|
+
if (name.match(domainNameRegexp)) {
|
|
327
|
+
_context2.next = 5;
|
|
328
|
+
break;
|
|
330
329
|
}
|
|
330
|
+
|
|
331
|
+
return _context2.abrupt("return", Promise.reject(new Error('Not a http URI')));
|
|
332
|
+
|
|
333
|
+
case 5:
|
|
334
|
+
// @@ check it actually is a person and has an owner who agrees they own it
|
|
335
|
+
debug.log("Adding to ACL person: ".concat(name));
|
|
336
|
+
_context2.next = 8;
|
|
337
|
+
return this.groupList.addNewURI(name);
|
|
338
|
+
|
|
339
|
+
case 8:
|
|
340
|
+
this.toggleBar();
|
|
341
|
+
|
|
342
|
+
case 9:
|
|
343
|
+
case "end":
|
|
344
|
+
return _context2.stop();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}, _callee2, this);
|
|
348
|
+
}));
|
|
349
|
+
|
|
350
|
+
function addPerson(_x2) {
|
|
351
|
+
return _addPerson.apply(this, arguments);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return addPerson;
|
|
355
|
+
}()
|
|
356
|
+
}, {
|
|
357
|
+
key: "addGroup",
|
|
358
|
+
value: function () {
|
|
359
|
+
var _addGroup = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(name) {
|
|
360
|
+
var domainNameRegexp;
|
|
361
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
362
|
+
while (1) {
|
|
363
|
+
switch (_context3.prev = _context3.next) {
|
|
364
|
+
case 0:
|
|
365
|
+
if (name) {
|
|
366
|
+
_context3.next = 2;
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return _context3.abrupt("return", this.toggleBar());
|
|
371
|
+
|
|
372
|
+
case 2:
|
|
373
|
+
// user cancelled
|
|
374
|
+
domainNameRegexp = /^https?:/i;
|
|
375
|
+
|
|
376
|
+
if (name.match(domainNameRegexp)) {
|
|
377
|
+
_context3.next = 5;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return _context3.abrupt("return", Promise.reject(new Error('Not a http URI')));
|
|
382
|
+
|
|
383
|
+
case 5:
|
|
384
|
+
// @@ check it actually is a group and has an owner who agrees they own it
|
|
385
|
+
debug.log('Adding to ACL group: ' + name);
|
|
386
|
+
_context3.next = 8;
|
|
387
|
+
return this.groupList.addNewURI(name);
|
|
388
|
+
|
|
389
|
+
case 8:
|
|
390
|
+
this.toggleBar();
|
|
391
|
+
|
|
392
|
+
case 9:
|
|
393
|
+
case "end":
|
|
394
|
+
return _context3.stop();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}, _callee3, this);
|
|
398
|
+
}));
|
|
399
|
+
|
|
400
|
+
function addGroup(_x3) {
|
|
401
|
+
return _addGroup.apply(this, arguments);
|
|
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;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
return _context5.abrupt("return", this.toggleBar());
|
|
449
|
+
|
|
450
|
+
case 2:
|
|
451
|
+
// user cancelled
|
|
452
|
+
domainNameRegexp = /^https?:/i;
|
|
453
|
+
|
|
454
|
+
if (name.match(domainNameRegexp)) {
|
|
455
|
+
_context5.next = 5;
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return _context5.abrupt("return", Promise.reject(new Error('Not a http URI')));
|
|
460
|
+
|
|
461
|
+
case 5:
|
|
462
|
+
// @@ check it actually is a bot and has an owner who agrees they own it
|
|
463
|
+
debug.log('Adding to ACL bot: ' + name);
|
|
464
|
+
_context5.next = 8;
|
|
465
|
+
return this.groupList.addNewURI(name);
|
|
466
|
+
|
|
467
|
+
case 8:
|
|
468
|
+
this.toggleBar();
|
|
469
|
+
|
|
470
|
+
case 9:
|
|
471
|
+
case "end":
|
|
472
|
+
return _context5.stop();
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}, _callee5, this);
|
|
476
|
+
}));
|
|
477
|
+
|
|
478
|
+
function addBot(_x5) {
|
|
479
|
+
return _addBot.apply(this, arguments);
|
|
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;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
return _context6.abrupt("return", Promise.resolve());
|
|
499
|
+
|
|
500
|
+
case 2:
|
|
501
|
+
// user cancelled
|
|
502
|
+
domainNameRegexp = /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i; // https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch08s15.html
|
|
503
|
+
|
|
504
|
+
if (name.match(domainNameRegexp)) {
|
|
505
|
+
_context6.next = 5;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
return _context6.abrupt("return", Promise.reject(new Error('Not a domain name')));
|
|
510
|
+
|
|
511
|
+
case 5:
|
|
331
512
|
origin = 'https://' + name;
|
|
332
513
|
debug.log('Adding to ACL origin: ' + origin);
|
|
333
514
|
this.toggleBar();
|
|
334
|
-
return
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
515
|
+
return _context6.abrupt("return", origin);
|
|
516
|
+
|
|
517
|
+
case 9:
|
|
518
|
+
case "end":
|
|
519
|
+
return _context6.stop();
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}, _callee6, this);
|
|
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
|
+
|
|
343
540
|
exports.AddAgentButtons = AddAgentButtons;
|
|
344
541
|
//# sourceMappingURL=add-agent-buttons.js.map
|