solid-panes 3.5.14-bbf45639 → 3.5.16-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/lib/dashboard/basicPreferences.js +264 -193
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.js +79 -57
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.js +100 -98
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/home/homePane.js +103 -112
- package/lib/home/homePane.js.map +1 -1
- package/lib/index.js +97 -49
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.js +200 -180
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.js +15 -9
- package/lib/mainPage/footer.js.map +1 -1
- package/lib/mainPage/header.js +162 -114
- package/lib/mainPage/header.js.map +1 -1
- package/lib/mainPage/index.js +45 -57
- package/lib/mainPage/index.js.map +1 -1
- package/lib/outline/context.js +17 -13
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/manager.js +193 -162
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/propertyViews.js +46 -32
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/viewAsImage.js +19 -22
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.js +15 -5
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.js +451 -406
- package/lib/pad/padPane.js.map +1 -1
- package/lib/profile/editProfile.view.js +124 -101
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.js +17 -12
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/sharing/sharingPane.js +45 -33
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.js +77 -87
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.dom.js +182 -173
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.utils.js +36 -30
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.js +99 -91
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/types.js +4 -1
- package/lib/types.js.map +1 -1
- package/lib/versionInfo.js +28 -23
- package/lib/versionInfo.js.map +1 -1
- package/package.json +13 -13
- package/src/mainPage/index.ts +1 -1
- package/src/outline/manager.js +29 -13
- package/src/versionInfo.ts +3 -3
package/lib/mainPage/header.js
CHANGED
|
@@ -1,51 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
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;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.createHeader = void 0;
|
|
40
|
-
var solid_ui_1 = require("solid-ui");
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createHeader = createHeader;
|
|
7
|
+
|
|
8
|
+
var _solidUi = require("solid-ui");
|
|
9
|
+
|
|
10
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
11
|
+
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
|
|
41
14
|
/**
|
|
42
15
|
* menu icons
|
|
43
16
|
*/
|
|
44
|
-
var HELP_MENU_ICON =
|
|
17
|
+
var HELP_MENU_ICON = _solidUi.icons.iconBase + 'noun_help.svg';
|
|
45
18
|
var SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg';
|
|
46
19
|
/**
|
|
47
20
|
* menu elements
|
|
48
21
|
*/
|
|
22
|
+
|
|
49
23
|
var USER_GUIDE_MENU_ITEM = 'User guide';
|
|
50
24
|
var REPORT_A_PROBLEM_MENU_ITEM = 'Report a problem';
|
|
51
25
|
var SHOW_YOUR_PROFILE_MENU_ITEM = 'Show your profile';
|
|
@@ -53,90 +27,164 @@ var LOG_OUT_MENU_ITEM = 'Log out';
|
|
|
53
27
|
/**
|
|
54
28
|
* URLS
|
|
55
29
|
*/
|
|
30
|
+
|
|
56
31
|
var USER_GUIDE_MENU_URL = 'https://solid.github.io/userguide/';
|
|
57
32
|
var REPORT_A_PROBLEM_MENU_URL = 'https://github.com/solid/solidos/issues';
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return __generator(this, function (_c) {
|
|
62
|
-
switch (_c.label) {
|
|
63
|
-
case 0:
|
|
64
|
-
_a = solid_ui_1.initHeader;
|
|
65
|
-
_b = [store];
|
|
66
|
-
return [4 /*yield*/, setUserMenu(outliner)];
|
|
67
|
-
case 1:
|
|
68
|
-
_a.apply(void 0, _b.concat([_c.sent(), setHeaderOptions()]));
|
|
69
|
-
return [2 /*return*/];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
33
|
+
|
|
34
|
+
function createHeader(_x, _x2) {
|
|
35
|
+
return _createHeader.apply(this, arguments);
|
|
73
36
|
}
|
|
74
|
-
|
|
37
|
+
|
|
38
|
+
function _createHeader() {
|
|
39
|
+
_createHeader = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(store, outliner) {
|
|
40
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
41
|
+
while (1) {
|
|
42
|
+
switch (_context.prev = _context.next) {
|
|
43
|
+
case 0:
|
|
44
|
+
_context.t0 = _solidUi.initHeader;
|
|
45
|
+
_context.t1 = store;
|
|
46
|
+
_context.next = 4;
|
|
47
|
+
return setUserMenu(outliner);
|
|
48
|
+
|
|
49
|
+
case 4:
|
|
50
|
+
_context.t2 = _context.sent;
|
|
51
|
+
_context.t3 = setHeaderOptions();
|
|
52
|
+
(0, _context.t0)(_context.t1, _context.t2, _context.t3);
|
|
53
|
+
|
|
54
|
+
case 7:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, _callee);
|
|
60
|
+
}));
|
|
61
|
+
return _createHeader.apply(this, arguments);
|
|
62
|
+
}
|
|
63
|
+
|
|
75
64
|
function setHeaderOptions() {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
65
|
+
var helpMenuList = [{
|
|
66
|
+
label: USER_GUIDE_MENU_ITEM,
|
|
67
|
+
url: USER_GUIDE_MENU_URL,
|
|
68
|
+
target: '_blank'
|
|
69
|
+
}, {
|
|
70
|
+
label: REPORT_A_PROBLEM_MENU_ITEM,
|
|
71
|
+
url: REPORT_A_PROBLEM_MENU_URL,
|
|
72
|
+
target: '_blank'
|
|
73
|
+
}];
|
|
74
|
+
var headerOptions = {
|
|
75
|
+
logo: SOLID_ICON_URL,
|
|
76
|
+
helpIcon: HELP_MENU_ICON,
|
|
77
|
+
helpMenuList: helpMenuList
|
|
78
|
+
};
|
|
79
|
+
return headerOptions;
|
|
82
80
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return __generator(this, function (_c) {
|
|
87
|
-
switch (_c.label) {
|
|
88
|
-
case 0:
|
|
89
|
-
showProfile = {
|
|
90
|
-
label: SHOW_YOUR_PROFILE_MENU_ITEM,
|
|
91
|
-
onclick: function () { return openUserProfile(outliner); }
|
|
92
|
-
};
|
|
93
|
-
logOut = {
|
|
94
|
-
label: LOG_OUT_MENU_ITEM,
|
|
95
|
-
onclick: function () {
|
|
96
|
-
solid_ui_1.authn.authSession.logout();
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
userMenuList = [showProfile];
|
|
100
|
-
_b = (_a = userMenuList).concat;
|
|
101
|
-
return [4 /*yield*/, getMenuItems(outliner)];
|
|
102
|
-
case 1:
|
|
103
|
-
userMenuList = _b.apply(_a, [_c.sent()]);
|
|
104
|
-
userMenuList.push(logOut);
|
|
105
|
-
return [2 /*return*/, userMenuList];
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
});
|
|
81
|
+
|
|
82
|
+
function setUserMenu(_x3) {
|
|
83
|
+
return _setUserMenu.apply(this, arguments);
|
|
109
84
|
}
|
|
85
|
+
|
|
86
|
+
function _setUserMenu() {
|
|
87
|
+
_setUserMenu = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(outliner) {
|
|
88
|
+
var showProfile, logOut, userMenuList;
|
|
89
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
90
|
+
while (1) {
|
|
91
|
+
switch (_context2.prev = _context2.next) {
|
|
92
|
+
case 0:
|
|
93
|
+
showProfile = {
|
|
94
|
+
label: SHOW_YOUR_PROFILE_MENU_ITEM,
|
|
95
|
+
onclick: function onclick() {
|
|
96
|
+
return openUserProfile(outliner);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
logOut = {
|
|
100
|
+
label: LOG_OUT_MENU_ITEM,
|
|
101
|
+
onclick: function onclick() {
|
|
102
|
+
_solidUi.authn.authSession.logout();
|
|
103
|
+
}
|
|
104
|
+
}; // the order of the menu is important here, show profile first and logout last
|
|
105
|
+
|
|
106
|
+
userMenuList = [showProfile];
|
|
107
|
+
_context2.t0 = userMenuList;
|
|
108
|
+
_context2.next = 6;
|
|
109
|
+
return getMenuItems(outliner);
|
|
110
|
+
|
|
111
|
+
case 6:
|
|
112
|
+
_context2.t1 = _context2.sent;
|
|
113
|
+
userMenuList = _context2.t0.concat.call(_context2.t0, _context2.t1);
|
|
114
|
+
userMenuList.push(logOut);
|
|
115
|
+
return _context2.abrupt("return", userMenuList);
|
|
116
|
+
|
|
117
|
+
case 10:
|
|
118
|
+
case "end":
|
|
119
|
+
return _context2.stop();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, _callee2);
|
|
123
|
+
}));
|
|
124
|
+
return _setUserMenu.apply(this, arguments);
|
|
125
|
+
}
|
|
126
|
+
|
|
110
127
|
function openUserProfile(outliner) {
|
|
111
|
-
|
|
112
|
-
|
|
128
|
+
outliner.GotoSubject(_solidUi.authn.currentUser(), true, undefined, true, undefined);
|
|
129
|
+
location.reload();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function getMenuItems(_x4) {
|
|
133
|
+
return _getMenuItems.apply(this, arguments);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function _getMenuItems() {
|
|
137
|
+
_getMenuItems = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(outliner) {
|
|
138
|
+
var items;
|
|
139
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
140
|
+
while (1) {
|
|
141
|
+
switch (_context3.prev = _context3.next) {
|
|
142
|
+
case 0:
|
|
143
|
+
_context3.next = 2;
|
|
144
|
+
return outliner.getDashboardItems();
|
|
145
|
+
|
|
146
|
+
case 2:
|
|
147
|
+
items = _context3.sent;
|
|
148
|
+
return _context3.abrupt("return", items.map(function (element) {
|
|
149
|
+
return {
|
|
150
|
+
label: element.label,
|
|
151
|
+
onclick: function onclick() {
|
|
152
|
+
return openDashboardPane(outliner, element.tabName || element.paneName);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}));
|
|
156
|
+
|
|
157
|
+
case 4:
|
|
158
|
+
case "end":
|
|
159
|
+
return _context3.stop();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}, _callee3);
|
|
163
|
+
}));
|
|
164
|
+
return _getMenuItems.apply(this, arguments);
|
|
113
165
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return __generator(this, function (_a) {
|
|
118
|
-
switch (_a.label) {
|
|
119
|
-
case 0: return [4 /*yield*/, outliner.getDashboardItems()];
|
|
120
|
-
case 1:
|
|
121
|
-
items = _a.sent();
|
|
122
|
-
return [2 /*return*/, items.map(function (element) {
|
|
123
|
-
return {
|
|
124
|
-
label: element.label,
|
|
125
|
-
onclick: function () { return openDashboardPane(outliner, element.tabName || element.paneName); }
|
|
126
|
-
};
|
|
127
|
-
})];
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
});
|
|
166
|
+
|
|
167
|
+
function openDashboardPane(_x5, _x6) {
|
|
168
|
+
return _openDashboardPane.apply(this, arguments);
|
|
131
169
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
170
|
+
|
|
171
|
+
function _openDashboardPane() {
|
|
172
|
+
_openDashboardPane = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(outliner, pane) {
|
|
173
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
174
|
+
while (1) {
|
|
175
|
+
switch (_context4.prev = _context4.next) {
|
|
176
|
+
case 0:
|
|
135
177
|
outliner.showDashboard({
|
|
136
|
-
|
|
178
|
+
pane: pane
|
|
137
179
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
180
|
+
|
|
181
|
+
case 1:
|
|
182
|
+
case "end":
|
|
183
|
+
return _context4.stop();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}, _callee4);
|
|
187
|
+
}));
|
|
188
|
+
return _openDashboardPane.apply(this, arguments);
|
|
141
189
|
}
|
|
142
190
|
//# sourceMappingURL=header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/mainPage/header.ts"],"names":["HELP_MENU_ICON","icons","iconBase","SOLID_ICON_URL","USER_GUIDE_MENU_ITEM","REPORT_A_PROBLEM_MENU_ITEM","SHOW_YOUR_PROFILE_MENU_ITEM","LOG_OUT_MENU_ITEM","USER_GUIDE_MENU_URL","REPORT_A_PROBLEM_MENU_URL","createHeader","store","outliner","initHeader","setUserMenu","setHeaderOptions","helpMenuList","label","url","target","headerOptions","logo","helpIcon","showProfile","onclick","openUserProfile","logOut","authn","authSession","logout","userMenuList","getMenuItems","concat","push","GotoSubject","currentUser","undefined","location","reload","getDashboardItems","items","map","element","openDashboardPane","tabName","paneName","pane","showDashboard"],"mappings":"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","sourcesContent":["import { icons, authn, initHeader } from 'solid-ui'\n/**\n * menu icons\n*/\nconst HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\n/**\n * menu elements\n*/\nconst USER_GUIDE_MENU_ITEM = 'User guide'\nconst REPORT_A_PROBLEM_MENU_ITEM = 'Report a problem'\nconst SHOW_YOUR_PROFILE_MENU_ITEM = 'Show your profile'\nconst LOG_OUT_MENU_ITEM = 'Log out'\n/**\n * URLS\n */\nconst USER_GUIDE_MENU_URL = 'https://solid.github.io/userguide/'\nconst REPORT_A_PROBLEM_MENU_URL = 'https://github.com/solid/solidos/issues'\n\nexport async function createHeader (store, outliner) {\n initHeader(store, await setUserMenu(outliner), setHeaderOptions())\n}\n\nfunction setHeaderOptions () {\n const helpMenuList = [\n { label: USER_GUIDE_MENU_ITEM, url: USER_GUIDE_MENU_URL, target: '_blank' },\n { label: REPORT_A_PROBLEM_MENU_ITEM, url: REPORT_A_PROBLEM_MENU_URL, target: '_blank' }\n ]\n const headerOptions = { logo: SOLID_ICON_URL, helpIcon: HELP_MENU_ICON, helpMenuList: helpMenuList }\n\n return headerOptions\n}\n\nasync function setUserMenu (outliner: any) {\n const showProfile = {\n label: SHOW_YOUR_PROFILE_MENU_ITEM,\n onclick: () => openUserProfile(outliner)\n }\n\n const logOut = {\n label: LOG_OUT_MENU_ITEM,\n onclick: () => {\n authn.authSession.logout()\n }\n }\n\n // the order of the menu is important here, show profile first and logout last\n let userMenuList = [showProfile]\n userMenuList = userMenuList.concat(await getMenuItems(outliner))\n userMenuList.push(logOut)\n\n return userMenuList\n}\n\nfunction openUserProfile (outliner: any) {\n outliner.GotoSubject(authn.currentUser(), true, undefined, true, undefined)\n location.reload()\n}\n\nasync function getMenuItems (outliner: any) {\n const items = await outliner.getDashboardItems()\n return items.map((element) => {\n return {\n label: element.label,\n onclick: () => openDashboardPane(outliner, element.tabName || element.paneName)\n }\n })\n}\n\nasync function openDashboardPane (outliner: any, pane: string): Promise<void> {\n outliner.showDashboard({\n pane\n })\n}\n"],"file":"header.js"}
|
package/lib/mainPage/index.js
CHANGED
|
@@ -1,63 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
31
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
32
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
34
|
-
if (t[2]) _.ops.pop();
|
|
35
|
-
_.trys.pop(); continue;
|
|
36
|
-
}
|
|
37
|
-
op = body.call(thisArg, _);
|
|
38
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
39
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
var index_1 = require("../index");
|
|
44
|
-
var header_1 = require("./header");
|
|
45
|
-
var footer_1 = require("./footer");
|
|
46
|
-
function initMainPage(store, uri) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
-
var outliner, subject, header, footer;
|
|
49
|
-
return __generator(this, function (_a) {
|
|
50
|
-
outliner = (0, index_1.getOutliner)(document);
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = initMainPage;
|
|
7
|
+
|
|
8
|
+
var _index = require("../index");
|
|
9
|
+
|
|
10
|
+
var _header = require("./header");
|
|
11
|
+
|
|
12
|
+
var _footer = require("./footer");
|
|
13
|
+
|
|
14
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15
|
+
|
|
16
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
+
|
|
18
|
+
function initMainPage(_x, _x2) {
|
|
19
|
+
return _initMainPage.apply(this, arguments);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _initMainPage() {
|
|
23
|
+
_initMainPage = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(store, uri) {
|
|
24
|
+
var outliner, subject, header, footer;
|
|
25
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
26
|
+
while (1) {
|
|
27
|
+
switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
outliner = (0, _index.getOutliner)(document);
|
|
51
30
|
uri = uri || window.location.href;
|
|
52
31
|
subject = uri;
|
|
53
|
-
if (typeof uri === 'string')
|
|
54
|
-
subject = store.sym(uri);
|
|
32
|
+
if (typeof uri === 'string') subject = store.sym(uri);
|
|
55
33
|
outliner.GotoSubject(subject, true, undefined, true, undefined);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
_context.next = 7;
|
|
35
|
+
return (0, _header.createHeader)(store, outliner);
|
|
36
|
+
|
|
37
|
+
case 7:
|
|
38
|
+
header = _context.sent;
|
|
39
|
+
footer = (0, _footer.createFooter)(store);
|
|
40
|
+
return _context.abrupt("return", Promise.all([header, footer]));
|
|
41
|
+
|
|
42
|
+
case 10:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, _callee);
|
|
48
|
+
}));
|
|
49
|
+
return _initMainPage.apply(this, arguments);
|
|
61
50
|
}
|
|
62
|
-
exports.default = initMainPage;
|
|
63
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/mainPage/index.ts"],"names":["initMainPage","store","uri","outliner","document","window","location","href","subject","sym","GotoSubject","undefined","header","footer","Promise","all"],"mappings":";;;;;;;AAMA;;AACA;;AACA;;;;;;SAE8BA,Y;;;;;0EAAf,iBAA6BC,KAA7B,EAAoDC,GAApD;AAAA;AAAA;AAAA;AAAA;AAAA;AACPC,YAAAA,QADO,GACI,wBAAYC,QAAZ,CADJ;AAEbF,YAAAA,GAAG,GAAGA,GAAG,IAAIG,MAAM,CAACC,QAAP,CAAgBC,IAA7B;AACIC,YAAAA,OAHS,GAGCN,GAHD;AAIb,gBAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6BM,OAAO,GAAGP,KAAK,CAACQ,GAAN,CAAUP,GAAV,CAAV;AAC7BC,YAAAA,QAAQ,CAACO,WAAT,CAAqBF,OAArB,EAA8B,IAA9B,EAAoCG,SAApC,EAA+C,IAA/C,EAAqDA,SAArD;AALa;AAAA,mBAMQ,0BAAaV,KAAb,EAAoBE,QAApB,CANR;;AAAA;AAMPS,YAAAA,MANO;AAOPC,YAAAA,MAPO,GAOE,0BAAaZ,KAAb,CAPF;AAAA,6CAQNa,OAAO,CAACC,GAAR,CAAY,CAACH,MAAD,EAASC,MAAT,CAAZ,CARM;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and footer of the Databrowser.\n */\n\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { getOutliner } from '../index'\nimport { createHeader } from './header'\nimport { createFooter } from './footer'\n\nexport default async function initMainPage (store: IndexedFormula, uri?: string|NamedNode|null) {\n const outliner = getOutliner(document)\n uri = uri || window.location.href\n let subject = uri\n if (typeof uri === 'string') subject = store.sym(uri)\n outliner.GotoSubject(subject, true, undefined, true, undefined)\n const header = await createHeader(store, outliner)\n const footer = createFooter(store)\n return Promise.all([header, footer])\n}\n"],"file":"index.js"}
|
package/lib/outline/context.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createContext = createContext;
|
|
7
|
+
|
|
8
|
+
var _index = require("../index");
|
|
9
|
+
|
|
5
10
|
function createContext(dom, paneRegistry, store, logic) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
return {
|
|
12
|
+
dom: dom,
|
|
13
|
+
getOutliner: _index.getOutliner,
|
|
14
|
+
session: {
|
|
15
|
+
paneRegistry: paneRegistry,
|
|
16
|
+
store: store,
|
|
17
|
+
logic: logic
|
|
18
|
+
}
|
|
19
|
+
};
|
|
15
20
|
}
|
|
16
|
-
exports.createContext = createContext;
|
|
17
21
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/outline/context.ts"],"names":["createContext","dom","paneRegistry","store","logic","getOutliner","session"],"mappings":";;;;;;;AACA;;AAIO,SAASA,aAAT,CACLC,GADK,EAELC,YAFK,EAGLC,KAHK,EAILC,KAJK,EAKe;AACpB,SAAO;AACLH,IAAAA,GAAG,EAAHA,GADK;AAELI,IAAAA,WAAW,EAAXA,kBAFK;AAGLC,IAAAA,OAAO,EAAE;AACPJ,MAAAA,YAAY,EAAZA,YADO;AAEPC,MAAAA,KAAK,EAALA,KAFO;AAGPC,MAAAA,KAAK,EAALA;AAHO;AAHJ,GAAP;AASD","sourcesContent":["import { DataBrowserContext, PaneRegistry } from 'pane-registry'\nimport { getOutliner } from '../index'\nimport { SolidLogic } from 'solid-logic'\nimport { LiveStore } from 'rdflib'\n\nexport function createContext (\n dom: HTMLDocument,\n paneRegistry: PaneRegistry,\n store: LiveStore,\n logic: SolidLogic\n): DataBrowserContext {\n return {\n dom,\n getOutliner,\n session: {\n paneRegistry,\n store,\n logic\n }\n }\n}\n"],"file":"context.js"}
|