solid-ui 2.4.24-686a5c1c → 2.4.24-c08b6691
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/dist/main.js +7067 -4795
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +90 -98
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +82 -90
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +50 -54
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.d.ts +3 -3
- package/lib/acl/acl.d.ts.map +1 -1
- package/lib/acl/acl.js +13 -15
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +142 -154
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/types.d.ts +6 -6
- package/lib/acl/types.d.ts.map +1 -1
- package/lib/chat/bookmarks.js +181 -191
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +96 -104
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +232 -242
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +634 -658
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +119 -131
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +106 -114
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +16 -18
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/types.d.ts +1 -1
- package/lib/create/types.d.ts.map +1 -1
- package/lib/footer/index.d.ts +1 -1
- package/lib/footer/index.d.ts.map +1 -1
- package/lib/footer/index.js +33 -37
- package/lib/footer/index.js.map +1 -1
- package/lib/header/index.d.ts +4 -4
- package/lib/header/index.d.ts.map +1 -1
- package/lib/header/index.js +126 -134
- package/lib/header/index.js.map +1 -1
- package/lib/login/login.js +470 -470
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/types.d.ts +1 -1
- package/lib/matrix/types.d.ts.map +1 -1
- package/lib/media/media-capture.js +8 -10
- package/lib/media/media-capture.js.map +1 -1
- package/lib/pad.d.ts +1 -1
- package/lib/pad.d.ts.map +1 -1
- package/lib/participation.d.ts +1 -1
- package/lib/participation.d.ts.map +1 -1
- package/lib/participation.js +1 -1
- package/lib/tabs.d.ts +1 -1
- package/lib/tabs.d.ts.map +1 -1
- package/lib/utils/headerFooterHelpers.d.ts +1 -1
- package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
- package/lib/utils/headerFooterHelpers.js +78 -80
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +2 -6
- package/lib/utils/index.js.map +1 -1
- package/lib/versionInfo.js +6 -6
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons.d.ts +5 -5
- package/lib/widgets/buttons.d.ts.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +217 -229
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +70 -74
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts +2 -2
- package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +363 -379
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +79 -83
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.d.ts +2 -2
- package/lib/widgets/forms/autocomplete/publicData.d.ts.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +263 -281
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.d.ts +1 -1
- package/lib/widgets/forms/fieldFunction.d.ts.map +1 -1
- package/lib/widgets/forms/fieldFunction.js +1 -3
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.d.ts +1 -1
- package/lib/widgets/forms/fieldParams.d.ts.map +1 -1
- package/lib/widgets/forms.js +197 -225
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/multiSelect.js +4 -4
- package/lib/widgets/multiSelect.js.map +1 -1
- package/package.json +7 -5
|
@@ -18,7 +18,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
18
18
|
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; }
|
|
19
19
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
20
20
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
21
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
22
22
|
var WEBID_NOUN = 'Solid ID';
|
|
23
23
|
var GREEN_PLUS = _iconBase.icons.iconBase + 'noun_34653_green.svg';
|
|
24
24
|
var SEARCH_ICON = _iconBase.icons.iconBase + 'noun_Search_875351.svg';
|
|
@@ -32,243 +32,231 @@ function _renderAutocompleteControl() {
|
|
|
32
32
|
_renderAutocompleteControl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(dom, person, barOptions, acOptions, addOneIdAndRefresh, deleteOne) {
|
|
33
33
|
var autoCompleteDone, _autoCompleteDone, greenButtonHandler, _greenButtonHandler, removeDecorated, displayAutocomplete, _displayAutocomplete, searchButtonHandler, _searchButtonHandler, droppedURIHandler, _droppedURIHandler, acceptButton, cancelButton, deleteButtonContainer, noun, deleteButton, editButton, editing, syncEditingStatus, decoration, decoratedAutocomplete, creationArea, plus;
|
|
34
34
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
35
|
-
while (1) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_droppedURIHandler = function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
_context5.next = 9;
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
webid = _step.value;
|
|
65
|
-
_context5.next = 7;
|
|
66
|
-
return addOneIdAndRefresh(person, webid);
|
|
67
|
-
case 7:
|
|
68
|
-
_context5.next = 3;
|
|
69
|
-
break;
|
|
70
|
-
case 9:
|
|
71
|
-
_context5.next = 14;
|
|
72
|
-
break;
|
|
73
|
-
case 11:
|
|
74
|
-
_context5.prev = 11;
|
|
75
|
-
_context5.t0 = _context5["catch"](1);
|
|
76
|
-
_iterator.e(_context5.t0);
|
|
77
|
-
case 14:
|
|
78
|
-
_context5.prev = 14;
|
|
79
|
-
_iterator.f();
|
|
80
|
-
return _context5.finish(14);
|
|
81
|
-
case 17:
|
|
82
|
-
case "end":
|
|
83
|
-
return _context5.stop();
|
|
35
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
36
|
+
case 0:
|
|
37
|
+
syncEditingStatus = function _syncEditingStatus() {
|
|
38
|
+
if (editing) {
|
|
39
|
+
(0, _autocompletePicker.setVisible)(editButton, false);
|
|
40
|
+
(0, _autocompletePicker.setVisible)(acceptButton, false); // not till got it
|
|
41
|
+
(0, _autocompletePicker.setVisible)(cancelButton, false);
|
|
42
|
+
} else {
|
|
43
|
+
(0, _autocompletePicker.setVisible)(editButton, true);
|
|
44
|
+
(0, _autocompletePicker.setVisible)(acceptButton, false);
|
|
45
|
+
(0, _autocompletePicker.setVisible)(cancelButton, false);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
_droppedURIHandler = function _droppedURIHandler3() {
|
|
49
|
+
_droppedURIHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(uris) {
|
|
50
|
+
var _iterator, _step, webid;
|
|
51
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
52
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
53
|
+
case 0:
|
|
54
|
+
_iterator = _createForOfIteratorHelper(uris);
|
|
55
|
+
_context5.prev = 1;
|
|
56
|
+
_iterator.s();
|
|
57
|
+
case 3:
|
|
58
|
+
if ((_step = _iterator.n()).done) {
|
|
59
|
+
_context5.next = 9;
|
|
60
|
+
break;
|
|
84
61
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
62
|
+
webid = _step.value;
|
|
63
|
+
_context5.next = 7;
|
|
64
|
+
return addOneIdAndRefresh(person, webid);
|
|
65
|
+
case 7:
|
|
66
|
+
_context5.next = 3;
|
|
67
|
+
break;
|
|
68
|
+
case 9:
|
|
69
|
+
_context5.next = 14;
|
|
70
|
+
break;
|
|
71
|
+
case 11:
|
|
72
|
+
_context5.prev = 11;
|
|
73
|
+
_context5.t0 = _context5["catch"](1);
|
|
74
|
+
_iterator.e(_context5.t0);
|
|
75
|
+
case 14:
|
|
76
|
+
_context5.prev = 14;
|
|
77
|
+
_iterator.f();
|
|
78
|
+
return _context5.finish(14);
|
|
79
|
+
case 17:
|
|
80
|
+
case "end":
|
|
81
|
+
return _context5.stop();
|
|
82
|
+
}
|
|
83
|
+
}, _callee5, null, [[1, 11, 14, 17]]);
|
|
84
|
+
}));
|
|
85
|
+
return _droppedURIHandler.apply(this, arguments);
|
|
86
|
+
};
|
|
87
|
+
droppedURIHandler = function _droppedURIHandler2(_x11) {
|
|
88
|
+
return _droppedURIHandler.apply(this, arguments);
|
|
89
|
+
};
|
|
90
|
+
_searchButtonHandler = function _searchButtonHandler3() {
|
|
91
|
+
_searchButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
92
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
93
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
94
|
+
case 0:
|
|
95
|
+
if (!decoratedAutocomplete) {
|
|
96
|
+
_context4.next = 5;
|
|
97
|
+
break;
|
|
113
98
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
99
|
+
creationArea.removeChild(decoratedAutocomplete);
|
|
100
|
+
decoratedAutocomplete = undefined;
|
|
101
|
+
_context4.next = 7;
|
|
102
|
+
break;
|
|
103
|
+
case 5:
|
|
104
|
+
_context4.next = 7;
|
|
105
|
+
return displayAutocomplete();
|
|
106
|
+
case 7:
|
|
107
|
+
case "end":
|
|
108
|
+
return _context4.stop();
|
|
109
|
+
}
|
|
110
|
+
}, _callee4);
|
|
111
|
+
}));
|
|
112
|
+
return _searchButtonHandler.apply(this, arguments);
|
|
113
|
+
};
|
|
114
|
+
searchButtonHandler = function _searchButtonHandler2(_x10) {
|
|
115
|
+
return _searchButtonHandler.apply(this, arguments);
|
|
116
|
+
};
|
|
117
|
+
_displayAutocomplete = function _displayAutocomplete3() {
|
|
118
|
+
_displayAutocomplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
119
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
120
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
decoratedAutocomplete = dom.createElement('div');
|
|
123
|
+
decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;');
|
|
124
|
+
_context3.t0 = decoratedAutocomplete;
|
|
125
|
+
_context3.next = 5;
|
|
126
|
+
return (0, _autocompletePicker.renderAutoComplete)(dom, acOptions, decoration, autoCompleteDone);
|
|
127
|
+
case 5:
|
|
128
|
+
_context3.t1 = _context3.sent;
|
|
129
|
+
_context3.t0.appendChild.call(_context3.t0, _context3.t1);
|
|
130
|
+
// console.log('@@ acceptButton', acceptButton)
|
|
131
|
+
decoratedAutocomplete.appendChild(acceptButton);
|
|
132
|
+
// console.log('@@ cancelButton', cancelButton)
|
|
139
133
|
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
decoratedAutocomplete.appendChild(cancelButton);
|
|
135
|
+
// console.log('@@ editButton', editButton)
|
|
142
136
|
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
decoratedAutocomplete.appendChild(editButton);
|
|
138
|
+
// console.log('@@ deleteButtonContainer', deleteButtonContainer)
|
|
145
139
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
_greenButtonHandler = function
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
_context2.next = 5;
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
return _context2.abrupt("return");
|
|
182
|
-
case 5:
|
|
183
|
-
return _context2.abrupt("return", addOneIdAndRefresh(person, webid));
|
|
184
|
-
case 6:
|
|
185
|
-
case "end":
|
|
186
|
-
return _context2.stop();
|
|
140
|
+
decoratedAutocomplete.appendChild(deleteButtonContainer);
|
|
141
|
+
creationArea.appendChild(decoratedAutocomplete);
|
|
142
|
+
case 12:
|
|
143
|
+
case "end":
|
|
144
|
+
return _context3.stop();
|
|
145
|
+
}
|
|
146
|
+
}, _callee3);
|
|
147
|
+
}));
|
|
148
|
+
return _displayAutocomplete.apply(this, arguments);
|
|
149
|
+
};
|
|
150
|
+
displayAutocomplete = function _displayAutocomplete2() {
|
|
151
|
+
return _displayAutocomplete.apply(this, arguments);
|
|
152
|
+
};
|
|
153
|
+
removeDecorated = function _removeDecorated() {
|
|
154
|
+
if (decoratedAutocomplete) {
|
|
155
|
+
creationArea.removeChild(decoratedAutocomplete);
|
|
156
|
+
decoratedAutocomplete = undefined;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
_greenButtonHandler = function _greenButtonHandler3() {
|
|
160
|
+
_greenButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
161
|
+
var webid;
|
|
162
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
163
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
164
|
+
case 0:
|
|
165
|
+
_context2.next = 2;
|
|
166
|
+
return widgets.askName(dom, _solidLogic.store, creationArea, ns.vcard('url'), undefined, WEBID_NOUN);
|
|
167
|
+
case 2:
|
|
168
|
+
webid = _context2.sent;
|
|
169
|
+
if (webid) {
|
|
170
|
+
_context2.next = 5;
|
|
171
|
+
break;
|
|
187
172
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
173
|
+
return _context2.abrupt("return");
|
|
174
|
+
case 5:
|
|
175
|
+
return _context2.abrupt("return", addOneIdAndRefresh(person, webid));
|
|
176
|
+
case 6:
|
|
177
|
+
case "end":
|
|
178
|
+
return _context2.stop();
|
|
179
|
+
}
|
|
180
|
+
}, _callee2);
|
|
181
|
+
}));
|
|
182
|
+
return _greenButtonHandler.apply(this, arguments);
|
|
183
|
+
};
|
|
184
|
+
greenButtonHandler = function _greenButtonHandler2(_x9) {
|
|
185
|
+
return _greenButtonHandler.apply(this, arguments);
|
|
186
|
+
};
|
|
187
|
+
_autoCompleteDone = function _autoCompleteDone3() {
|
|
188
|
+
_autoCompleteDone = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(object, name) {
|
|
189
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
190
|
+
while (1) switch (_context.prev = _context.next) {
|
|
191
|
+
case 0:
|
|
192
|
+
if (acOptions.permanent) {
|
|
193
|
+
// remember to set this in publicid panel
|
|
194
|
+
(0, _autocompletePicker.setVisible)(editButton, true);
|
|
195
|
+
(0, _autocompletePicker.setVisible)(acceptButton, false);
|
|
196
|
+
(0, _autocompletePicker.setVisible)(cancelButton, false);
|
|
197
|
+
} else {
|
|
198
|
+
// console.log('temporary - removed decoratiion')
|
|
199
|
+
removeDecorated();
|
|
215
200
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
editing =
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
201
|
+
return _context.abrupt("return", addOneIdAndRefresh(object, name));
|
|
202
|
+
case 2:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context.stop();
|
|
205
|
+
}
|
|
206
|
+
}, _callee);
|
|
207
|
+
}));
|
|
208
|
+
return _autoCompleteDone.apply(this, arguments);
|
|
209
|
+
};
|
|
210
|
+
autoCompleteDone = function _autoCompleteDone2(_x7, _x8) {
|
|
211
|
+
return _autoCompleteDone.apply(this, arguments);
|
|
212
|
+
};
|
|
213
|
+
acceptButton = widgets.continueButton(dom);
|
|
214
|
+
acceptButton.setAttribute('data-testid', 'accept-button');
|
|
215
|
+
cancelButton = widgets.cancelButton(dom);
|
|
216
|
+
cancelButton.setAttribute('data-testid', 'cancel-button');
|
|
217
|
+
deleteButtonContainer = dom.createElement('div');
|
|
218
|
+
noun = acOptions.targetClass ? utils.label(acOptions.targetClass) : 'item';
|
|
219
|
+
deleteButton = widgets.deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne); // need to knock out this UI or caller does that
|
|
220
|
+
deleteButton.setAttribute('data-testid', 'delete-button');
|
|
221
|
+
editButton = widgets.button(dom, EDIT_ICON, 'Edit', function (_event) {
|
|
222
|
+
editing = !editing;
|
|
223
|
+
syncEditingStatus();
|
|
224
|
+
});
|
|
225
|
+
editButton.setAttribute('data-testid', 'edit-button');
|
|
226
|
+
editing = true;
|
|
227
|
+
decoration = {
|
|
228
|
+
acceptButton: acceptButton,
|
|
229
|
+
cancelButton: cancelButton,
|
|
230
|
+
editButton: editButton,
|
|
231
|
+
deleteButton: deleteButton
|
|
232
|
+
};
|
|
233
|
+
decoratedAutocomplete = undefined;
|
|
234
|
+
creationArea = dom.createElement('div');
|
|
235
|
+
creationArea.style.display = 'flex';
|
|
236
|
+
creationArea.style.flexDirection = 'row';
|
|
237
|
+
if (!(acOptions.permanent || acOptions.currentObject)) {
|
|
252
238
|
_context6.next = 31;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
_context6.next = 31;
|
|
242
|
+
return displayAutocomplete();
|
|
243
|
+
case 31:
|
|
244
|
+
if (barOptions.editable) {
|
|
245
|
+
// creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton
|
|
246
|
+
creationArea.style.width = '100%';
|
|
247
|
+
if (barOptions.manualURIEntry) {
|
|
248
|
+
plus = creationArea.appendChild(widgets.button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler));
|
|
249
|
+
widgets.makeDropTarget(plus, droppedURIHandler, undefined);
|
|
265
250
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
251
|
+
if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) {
|
|
252
|
+
creationArea.appendChild(widgets.button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
syncEditingStatus();
|
|
256
|
+
return _context6.abrupt("return", creationArea);
|
|
257
|
+
case 34:
|
|
258
|
+
case "end":
|
|
259
|
+
return _context6.stop();
|
|
272
260
|
}
|
|
273
261
|
}, _callee6);
|
|
274
262
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocompleteBar.js","names":["WEBID_NOUN","GREEN_PLUS","icons","iconBase","SEARCH_ICON","EDIT_ICON","renderAutocompleteControl","dom","person","barOptions","acOptions","addOneIdAndRefresh","deleteOne","autoCompleteDone","greenButtonHandler","removeDecorated","displayAutocomplete","searchButtonHandler","droppedURIHandler","syncEditingStatus","editing","setVisible","editButton","acceptButton","cancelButton","uris","webid","_event","decoratedAutocomplete","creationArea","removeChild","undefined","createElement","setAttribute","renderAutoComplete","decoration","appendChild","deleteButtonContainer","widgets","askName","store","ns","vcard","object","name","permanent","continueButton","noun","targetClass","utils","label","deleteButton","deleteButtonWithCheck","button","style","display","flexDirection","currentObject","editable","width","manualURIEntry","plus","idNoun","makeDropTarget","dbLookup"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteBar.ts"],"sourcesContent":["/* The Autocomplete Control with decorations\n\nThis control has the buttons which control the state between editing, viewing, searching, accepting\nand so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work.\n\n*/\nimport * as ns from '../../../ns'\nimport { icons } from '../../../iconBase'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as utils from '../../../utils'\n\nimport { renderAutoComplete, AutocompleteDecoration, setVisible } from './autocompletePicker' // dbpediaParameters\n\nimport { NamedNode } from 'rdflib'\n\nconst WEBID_NOUN = 'Solid ID'\n\nconst GREEN_PLUS = icons.iconBase + 'noun_34653_green.svg'\nconst SEARCH_ICON = icons.iconBase + 'noun_Search_875351.svg'\nconst EDIT_ICON = icons.iconBase + 'noun_253504.svg'\n// const DELETE_ICON = icons.iconBase + 'noun_2188_red.svg'\n\nexport async function renderAutocompleteControl (dom:HTMLDocument,\n person:NamedNode,\n barOptions,\n acOptions,\n addOneIdAndRefresh,\n deleteOne): Promise<HTMLElement> {\n async function autoCompleteDone (object, name) {\n if (acOptions.permanent) { // remember to set this in publicid panel\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n } else {\n // console.log('temporary - removed decoratiion')\n removeDecorated()\n }\n return addOneIdAndRefresh(object, name)\n }\n\n async function greenButtonHandler (_event) {\n const webid = await widgets.askName(dom, store, creationArea, ns.vcard('url'), undefined, WEBID_NOUN)\n if (!webid) {\n return // cancelled by user\n }\n return addOneIdAndRefresh(person, webid)\n }\n\n function removeDecorated () {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n }\n }\n\n async function displayAutocomplete () {\n decoratedAutocomplete = dom.createElement('div') as HTMLElement\n decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;')\n decoratedAutocomplete.appendChild(await renderAutoComplete(dom, acOptions, decoration, autoCompleteDone))\n // console.log('@@ acceptButton', acceptButton)\n decoratedAutocomplete.appendChild(acceptButton)\n // console.log('@@ cancelButton', cancelButton)\n\n decoratedAutocomplete.appendChild(cancelButton)\n // console.log('@@ editButton', editButton)\n\n decoratedAutocomplete.appendChild(editButton)\n // console.log('@@ deleteButtonContainer', deleteButtonContainer)\n\n decoratedAutocomplete.appendChild(deleteButtonContainer)\n creationArea.appendChild(decoratedAutocomplete)\n }\n\n async function searchButtonHandler (_event) {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n } else {\n await displayAutocomplete()\n }\n }\n\n async function droppedURIHandler (uris) {\n for (const webid of uris) { // normally one but can be more than one\n await addOneIdAndRefresh(person, webid)\n }\n }\n\n const acceptButton = widgets.continueButton(dom)\n acceptButton.setAttribute('data-testid', 'accept-button')\n\n const cancelButton = widgets.cancelButton(dom)\n cancelButton.setAttribute('data-testid', 'cancel-button')\n const deleteButtonContainer = dom.createElement('div')\n const noun = acOptions.targetClass ? utils.label(acOptions.targetClass) : 'item'\n const deleteButton = widgets.deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne) // need to knock out this UI or caller does that\n deleteButton.setAttribute('data-testid', 'delete-button')\n const editButton = widgets.button(dom, EDIT_ICON, 'Edit', _event => {\n editing = !editing\n syncEditingStatus()\n })\n editButton.setAttribute('data-testid', 'edit-button')\n let editing = true\n\n function syncEditingStatus () {\n if (editing) {\n setVisible(editButton, false)\n setVisible(acceptButton, false) // not till got it\n setVisible(cancelButton, false)\n } else {\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n }\n }\n\n const decoration:AutocompleteDecoration = {\n acceptButton, cancelButton, editButton, deleteButton\n }\n\n let decoratedAutocomplete = undefined as HTMLElement | undefined\n\n const creationArea = dom.createElement('div')\n creationArea.style.display = 'flex'\n creationArea.style.flexDirection = 'row'\n\n if (acOptions.permanent || acOptions.currentObject) {\n await displayAutocomplete()\n }\n if (barOptions.editable) {\n // creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton\n creationArea.style.width = '100%'\n if (barOptions.manualURIEntry) {\n const plus = creationArea.appendChild(widgets.button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler))\n widgets.makeDropTarget(plus, droppedURIHandler, undefined)\n }\n if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) {\n creationArea.appendChild(widgets.button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler))\n }\n }\n syncEditingStatus()\n return creationArea\n} // renderAutocompleteControl\n\n// ends\n"],"mappings":";;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AAEA;AAA6F;AAAA;AAAA;AAAA;AAAA;AAI7F,IAAMA,UAAU,GAAG,UAAU;AAE7B,IAAMC,UAAU,GAAGC,eAAK,CAACC,QAAQ,GAAG,sBAAsB;AAC1D,IAAMC,WAAW,GAAGF,eAAK,CAACC,QAAQ,GAAG,wBAAwB;AAC7D,IAAME,SAAS,GAAGH,eAAK,CAACC,QAAQ,GAAG,iBAAiB;AACpD;AAAA,SAEsBG,yBAAyB;EAAA;AAAA,EAwH7C;AAEF;AAAA;EAAA,2GA1HO,kBAA0CC,GAAgB,EAC/DC,MAAgB,EAChBC,UAAU,EACVC,SAAS,EACTC,kBAAkB,EAClBC,SAAS;IAAA,IACMC,g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AM,CAAC9C,GAAG,EAAEH,WAAW,EAAEK,UAAU,CAACqD,MAAM,EAAE7C,mBAAmB,CAAC,CAAC;cACpG;YACF;YACAE,iBAAiB,EAAE;YAAA,kCACZU,YAAY;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACpB;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"autocompleteBar.js","names":["WEBID_NOUN","GREEN_PLUS","icons","iconBase","SEARCH_ICON","EDIT_ICON","renderAutocompleteControl","dom","person","barOptions","acOptions","addOneIdAndRefresh","deleteOne","autoCompleteDone","greenButtonHandler","removeDecorated","displayAutocomplete","searchButtonHandler","droppedURIHandler","syncEditingStatus","editing","setVisible","editButton","acceptButton","cancelButton","uris","webid","_event","decoratedAutocomplete","creationArea","removeChild","undefined","createElement","setAttribute","renderAutoComplete","decoration","appendChild","deleteButtonContainer","widgets","askName","store","ns","vcard","object","name","permanent","continueButton","noun","targetClass","utils","label","deleteButton","deleteButtonWithCheck","button","style","display","flexDirection","currentObject","editable","width","manualURIEntry","plus","idNoun","makeDropTarget","dbLookup"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteBar.ts"],"sourcesContent":["/* The Autocomplete Control with decorations\n\nThis control has the buttons which control the state between editing, viewing, searching, accepting\nand so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work.\n\n*/\nimport * as ns from '../../../ns'\nimport { icons } from '../../../iconBase'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as utils from '../../../utils'\n\nimport { renderAutoComplete, AutocompleteDecoration, setVisible } from './autocompletePicker' // dbpediaParameters\n\nimport { NamedNode } from 'rdflib'\n\nconst WEBID_NOUN = 'Solid ID'\n\nconst GREEN_PLUS = icons.iconBase + 'noun_34653_green.svg'\nconst SEARCH_ICON = icons.iconBase + 'noun_Search_875351.svg'\nconst EDIT_ICON = icons.iconBase + 'noun_253504.svg'\n// const DELETE_ICON = icons.iconBase + 'noun_2188_red.svg'\n\nexport async function renderAutocompleteControl (dom:HTMLDocument,\n person:NamedNode,\n barOptions,\n acOptions,\n addOneIdAndRefresh,\n deleteOne): Promise<HTMLElement> {\n async function autoCompleteDone (object, name) {\n if (acOptions.permanent) { // remember to set this in publicid panel\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n } else {\n // console.log('temporary - removed decoratiion')\n removeDecorated()\n }\n return addOneIdAndRefresh(object, name)\n }\n\n async function greenButtonHandler (_event) {\n const webid = await widgets.askName(dom, store, creationArea, ns.vcard('url'), undefined, WEBID_NOUN)\n if (!webid) {\n return // cancelled by user\n }\n return addOneIdAndRefresh(person, webid)\n }\n\n function removeDecorated () {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n }\n }\n\n async function displayAutocomplete () {\n decoratedAutocomplete = dom.createElement('div') as HTMLElement\n decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;')\n decoratedAutocomplete.appendChild(await renderAutoComplete(dom, acOptions, decoration, autoCompleteDone))\n // console.log('@@ acceptButton', acceptButton)\n decoratedAutocomplete.appendChild(acceptButton)\n // console.log('@@ cancelButton', cancelButton)\n\n decoratedAutocomplete.appendChild(cancelButton)\n // console.log('@@ editButton', editButton)\n\n decoratedAutocomplete.appendChild(editButton)\n // console.log('@@ deleteButtonContainer', deleteButtonContainer)\n\n decoratedAutocomplete.appendChild(deleteButtonContainer)\n creationArea.appendChild(decoratedAutocomplete)\n }\n\n async function searchButtonHandler (_event) {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n } else {\n await displayAutocomplete()\n }\n }\n\n async function droppedURIHandler (uris) {\n for (const webid of uris) { // normally one but can be more than one\n await addOneIdAndRefresh(person, webid)\n }\n }\n\n const acceptButton = widgets.continueButton(dom)\n acceptButton.setAttribute('data-testid', 'accept-button')\n\n const cancelButton = widgets.cancelButton(dom)\n cancelButton.setAttribute('data-testid', 'cancel-button')\n const deleteButtonContainer = dom.createElement('div')\n const noun = acOptions.targetClass ? utils.label(acOptions.targetClass) : 'item'\n const deleteButton = widgets.deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne) // need to knock out this UI or caller does that\n deleteButton.setAttribute('data-testid', 'delete-button')\n const editButton = widgets.button(dom, EDIT_ICON, 'Edit', _event => {\n editing = !editing\n syncEditingStatus()\n })\n editButton.setAttribute('data-testid', 'edit-button')\n let editing = true\n\n function syncEditingStatus () {\n if (editing) {\n setVisible(editButton, false)\n setVisible(acceptButton, false) // not till got it\n setVisible(cancelButton, false)\n } else {\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n }\n }\n\n const decoration:AutocompleteDecoration = {\n acceptButton, cancelButton, editButton, deleteButton\n }\n\n let decoratedAutocomplete = undefined as HTMLElement | undefined\n\n const creationArea = dom.createElement('div')\n creationArea.style.display = 'flex'\n creationArea.style.flexDirection = 'row'\n\n if (acOptions.permanent || acOptions.currentObject) {\n await displayAutocomplete()\n }\n if (barOptions.editable) {\n // creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton\n creationArea.style.width = '100%'\n if (barOptions.manualURIEntry) {\n const plus = creationArea.appendChild(widgets.button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler))\n widgets.makeDropTarget(plus, droppedURIHandler, undefined)\n }\n if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) {\n creationArea.appendChild(widgets.button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler))\n }\n }\n syncEditingStatus()\n return creationArea\n} // renderAutocompleteControl\n\n// ends\n"],"mappings":";;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AAEA;AAA6F;AAAA;AAAA;AAAA;AAAA;AAI7F,IAAMA,UAAU,GAAG,UAAU;AAE7B,IAAMC,UAAU,GAAGC,eAAK,CAACC,QAAQ,GAAG,sBAAsB;AAC1D,IAAMC,WAAW,GAAGF,eAAK,CAACC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