solid-ui 2.4.13 → 2.4.14-6a9e81a9
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/acl/access-groups.d.ts +1 -1
- package/lib/acl/access-groups.d.ts.map +1 -1
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl.d.ts +1 -1
- package/lib/acl/acl.d.ts.map +1 -1
- package/lib/acl/acl.js.map +1 -1
- package/lib/footer/index.d.ts +20 -0
- package/lib/footer/index.d.ts.map +1 -0
- package/lib/footer/index.js +147 -0
- package/lib/footer/index.js.map +1 -0
- package/lib/footer/styleMap.d.ts +8 -0
- package/lib/footer/styleMap.d.ts.map +1 -0
- package/lib/footer/styleMap.js +15 -0
- package/lib/footer/styleMap.js.map +1 -0
- package/lib/header/index.d.ts +11 -8
- package/lib/header/index.d.ts.map +1 -1
- package/lib/header/index.js +78 -66
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.d.ts +0 -2
- package/lib/header/styleMap.d.ts.map +1 -1
- package/lib/header/styleMap.js +1 -5
- package/lib/header/styleMap.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -1
- package/lib/index.js.map +1 -1
- package/lib/{header/headerHelpers.d.ts → utils/headerFooterHelpers.d.ts} +11 -3
- package/lib/utils/headerFooterHelpers.d.ts.map +1 -0
- package/lib/utils/headerFooterHelpers.js +189 -0
- package/lib/utils/headerFooterHelpers.js.map +1 -0
- package/lib/versionInfo.js +3 -3
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +3456 -174
- package/lib/webpack-bundle.js.map +1 -1
- package/package.json +6 -5
- package/lib/header/headerHelpers.d.ts.map +0 -1
- package/lib/header/headerHelpers.js +0 -96
- package/lib/header/headerHelpers.js.map +0 -1
package/lib/index.js
CHANGED
|
@@ -81,6 +81,12 @@ Object.defineProperty(exports, "infiniteMessageArea", {
|
|
|
81
81
|
return _infinite.infiniteMessageArea;
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "initFooter", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _footer.initFooter;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
84
90
|
Object.defineProperty(exports, "initHeader", {
|
|
85
91
|
enumerable: true,
|
|
86
92
|
get: function get() {
|
|
@@ -197,6 +203,8 @@ var _versionInfo = _interopRequireDefault(require("./versionInfo"));
|
|
|
197
203
|
|
|
198
204
|
var _header = require("./header");
|
|
199
205
|
|
|
206
|
+
var _footer = require("./footer");
|
|
207
|
+
|
|
200
208
|
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); }
|
|
201
209
|
|
|
202
210
|
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; }
|
|
@@ -249,7 +257,8 @@ if (typeof window !== 'undefined') {
|
|
|
249
257
|
utils: utils,
|
|
250
258
|
widgets: widgets,
|
|
251
259
|
versionInfo: _versionInfo["default"],
|
|
252
|
-
initHeader: _header.initHeader
|
|
260
|
+
initHeader: _header.initHeader,
|
|
261
|
+
initFooter: _footer.initFooter
|
|
253
262
|
}; // Simpler access by non-node scripts
|
|
254
263
|
}
|
|
255
264
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["dom","window","document","store","solidLogicSingleton","UI","ns","rdf","acl","aclControl","authn","create","icons","language","log","matrix","media","messageArea","infiniteMessageArea","pad","participation","preferences","style","table","tabs","utils","widgets","versionInfo","initHeader"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["dom","window","document","store","solidLogicSingleton","UI","ns","rdf","acl","aclControl","authn","create","icons","language","log","matrix","media","messageArea","infiniteMessageArea","pad","participation","preferences","style","table","tabs","utils","widgets","versionInfo","initHeader","initFooter"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;;AAEA;;;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;;;AAEA;;;;AAEA;;;;AAEA;;AAEA;;;;AAEA;;AACA;;;;AAEA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;AApC8B;AAC9B;AAKA;AACA;AACA;AAMA;AAEA;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,IAAAA,UAAU,EAAVA;AA3BkB,GAAnB,CADgC,CA6B/B;AACH","sourcesContent":["/*\nThe MIT License (MIT)\n\nCopyright (c) 2015-2016 Solid\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nIf you would like to know more about the solid Solid project, please see\nhttps://github.com/solid/solid\n*/\n'use strict'\n/**\n * Provides a Solid client helper object (which exposes various static modules).\n * @module solidUi.js\n * @main solidUi.js\n */\n\n/**\n * @class SolidUi\n * @static\n */\n\n// REMOVE @ts-ignore as you migrate files to TypeScript\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\n// @ts-ignore\nimport * as ns from './ns'\nimport { acl, aclControl } from './acl/index'\nimport { authn } from './authn/index'\nimport { create } from './create/index'\n// @ts-ignore\n// import * as debug from '../debug'\n// @ts-ignore\nimport { icons } from './iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './pad'\n// @ts-ignore\nimport * as participation from './participation'\n// @ts-ignore\nimport * as preferences from './preferences'\n// @ts-ignore\nimport { solidLogicSingleton } from './logic'\n// @ts-ignore\nimport * as style from './style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './table'\nimport * as tabs from './tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as widgets from './widgets/index'\nimport versionInfo from './versionInfo'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\n\nconst dom = window ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\nconst store = solidLogicSingleton.store\n\nif (typeof window !== 'undefined') {\n ;(<any>window).UI = {\n ns,\n rdf,\n acl,\n aclControl,\n authn,\n create,\n dom,\n icons,\n language,\n log,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n solidLogicSingleton,\n store,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n } // Simpler access by non-node scripts\n}\n\nexport {\n ns,\n rdf,\n acl,\n aclControl,\n authn,\n create,\n dom,\n icons,\n language,\n log,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n solidLogicSingleton,\n store,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n}\n"],"file":"index.js"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NamedNode } from 'rdflib';
|
|
1
|
+
import { IndexedFormula, NamedNode } from 'rdflib';
|
|
2
2
|
declare type ThrottleOptions = {
|
|
3
3
|
leading?: boolean;
|
|
4
4
|
throttling?: boolean;
|
|
@@ -7,14 +7,22 @@ declare type ThrottleOptions = {
|
|
|
7
7
|
/**
|
|
8
8
|
* @ignore exporting this only for the unit test
|
|
9
9
|
*/
|
|
10
|
-
export declare function addStyleClassToElement(element: any, styleClasses: string[]): void;
|
|
10
|
+
export declare function addStyleClassToElement(element: any, styleClasses: string[], type?: string): void;
|
|
11
11
|
/**
|
|
12
12
|
* @ignore exporting this only for the unit test
|
|
13
13
|
*/
|
|
14
14
|
export declare function getPod(): NamedNode;
|
|
15
|
+
/**
|
|
16
|
+
* @ignore exporting this only for the unit test
|
|
17
|
+
*/
|
|
18
|
+
export declare function getPodOwner(pod: NamedNode, store: IndexedFormula): Promise<NamedNode | null>;
|
|
19
|
+
/**
|
|
20
|
+
* @ignore exporting this only for the unit test
|
|
21
|
+
*/
|
|
22
|
+
export declare function getName(store: IndexedFormula, user: NamedNode): string;
|
|
15
23
|
/**
|
|
16
24
|
* @ignore exporting this only for the unit test
|
|
17
25
|
*/
|
|
18
26
|
export declare function throttle(func: Function, wait: number, options?: ThrottleOptions): (...args: any[]) => any;
|
|
19
27
|
export {};
|
|
20
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=headerFooterHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headerFooterHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/headerFooterHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAMvD,aAAK,eAAe,GAAG;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAYD;;GAEG;AACH,wBAAgB,sBAAsB,CAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,QAM1F;AACD;;GAEG;AACH,wBAAgB,MAAM,IAAK,SAAS,CAGnC;AACD;;GAEG;AACH,wBAAsB,WAAW,CAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAqBnG;AACD;;GAEG;AACH,wBAAgB,OAAO,CAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAIvE;AACD;;GAEG;AACH,wBAAgB,QAAQ,CAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAgC9G"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.addStyleClassToElement = addStyleClassToElement;
|
|
9
|
+
exports.getName = getName;
|
|
10
|
+
exports.getPod = getPod;
|
|
11
|
+
exports.getPodOwner = getPodOwner;
|
|
12
|
+
exports.throttle = throttle;
|
|
13
|
+
|
|
14
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
|
+
|
|
16
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
+
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
|
|
20
|
+
var _rdflib = require("rdflib");
|
|
21
|
+
|
|
22
|
+
var _ = require("..");
|
|
23
|
+
|
|
24
|
+
var _styleMap = require("../header/styleMap");
|
|
25
|
+
|
|
26
|
+
var _styleMap2 = require("../footer/styleMap");
|
|
27
|
+
|
|
28
|
+
var _jss = require("../jss");
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
Copied from mashlib/src/global/metadata.ts
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
function getStyle(styleClass, type) {
|
|
38
|
+
if (type && type === 'footer') {
|
|
39
|
+
return _styleMap2.styleMap[styleClass];
|
|
40
|
+
} else {
|
|
41
|
+
return _styleMap.styleMap[styleClass];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @ignore exporting this only for the unit test
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
function addStyleClassToElement(element, styleClasses, type) {
|
|
50
|
+
styleClasses.forEach(function (styleClass) {
|
|
51
|
+
var style = getStyle(styleClass, type);
|
|
52
|
+
|
|
53
|
+
var _getClasses = (0, _jss.getClasses)(document.head, (0, _defineProperty2["default"])({}, styleClass, style)),
|
|
54
|
+
classes = _getClasses.classes;
|
|
55
|
+
|
|
56
|
+
element.classList.add(classes[styleClass]);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @ignore exporting this only for the unit test
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
function getPod() {
|
|
65
|
+
// @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers
|
|
66
|
+
return (0, _rdflib.sym)(document.location.origin).site();
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @ignore exporting this only for the unit test
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
function getPodOwner(_x, _x2) {
|
|
74
|
+
return _getPodOwner.apply(this, arguments);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @ignore exporting this only for the unit test
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
function _getPodOwner() {
|
|
82
|
+
_getPodOwner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(pod, store) {
|
|
83
|
+
var podOwner, storageIsListedInPodOwnersProfile;
|
|
84
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
85
|
+
while (1) {
|
|
86
|
+
switch (_context.prev = _context.next) {
|
|
87
|
+
case 0:
|
|
88
|
+
// @@ TODO: This is given the structure that NSS provides - might need to change for other Pod servers
|
|
89
|
+
podOwner = (0, _rdflib.sym)("".concat(pod.uri, "profile/card#me"));
|
|
90
|
+
_context.prev = 1;
|
|
91
|
+
|
|
92
|
+
if (!store.fetcher) {
|
|
93
|
+
_context.next = 7;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_context.next = 5;
|
|
98
|
+
return store.fetcher.load(podOwner.doc());
|
|
99
|
+
|
|
100
|
+
case 5:
|
|
101
|
+
_context.next = 8;
|
|
102
|
+
break;
|
|
103
|
+
|
|
104
|
+
case 7:
|
|
105
|
+
throw new Error('There was a problem loading the Fetcher');
|
|
106
|
+
|
|
107
|
+
case 8:
|
|
108
|
+
_context.next = 13;
|
|
109
|
+
break;
|
|
110
|
+
|
|
111
|
+
case 10:
|
|
112
|
+
_context.prev = 10;
|
|
113
|
+
_context.t0 = _context["catch"](1);
|
|
114
|
+
throw new Error('Did NOT find pod owners profile at ' + podOwner);
|
|
115
|
+
|
|
116
|
+
case 13:
|
|
117
|
+
if (!podOwner) {
|
|
118
|
+
_context.next = 17;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
storageIsListedInPodOwnersProfile = store.holds(podOwner, _.ns.space('storage'), pod, podOwner.doc());
|
|
123
|
+
|
|
124
|
+
if (storageIsListedInPodOwnersProfile) {
|
|
125
|
+
_context.next = 17;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
throw new Error("** Pod owner ".concat(podOwner, " does NOT list pod ").concat(pod, " as storage"));
|
|
130
|
+
|
|
131
|
+
case 17:
|
|
132
|
+
return _context.abrupt("return", podOwner);
|
|
133
|
+
|
|
134
|
+
case 18:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context.stop();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}, _callee, null, [[1, 10]]);
|
|
140
|
+
}));
|
|
141
|
+
return _getPodOwner.apply(this, arguments);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function getName(store, user) {
|
|
145
|
+
return store.anyValue(user, _.ns.vcard('fn'), null, user.doc()) || store.anyValue(user, _.ns.foaf('name'), null, user.doc()) || user.uri;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @ignore exporting this only for the unit test
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
function throttle(func, wait) {
|
|
153
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
154
|
+
var context, args, result;
|
|
155
|
+
var timeout = null;
|
|
156
|
+
var previous = 0;
|
|
157
|
+
|
|
158
|
+
var later = function later() {
|
|
159
|
+
previous = !options.leading ? 0 : Date.now();
|
|
160
|
+
timeout = null;
|
|
161
|
+
result = func.apply(context, args);
|
|
162
|
+
if (!timeout) context = args = null;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
return function () {
|
|
166
|
+
var now = Date.now();
|
|
167
|
+
if (!previous && !options.leading) previous = now;
|
|
168
|
+
var remaining = wait - (now - previous); // @ts-ignore
|
|
169
|
+
|
|
170
|
+
context = this;
|
|
171
|
+
args = arguments;
|
|
172
|
+
|
|
173
|
+
if (remaining <= 0 || remaining > wait) {
|
|
174
|
+
if (timeout) {
|
|
175
|
+
clearTimeout(timeout);
|
|
176
|
+
timeout = null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
previous = now;
|
|
180
|
+
result = func.apply(context, args);
|
|
181
|
+
if (!timeout) context = args = null;
|
|
182
|
+
} else if (!timeout && options.trailing !== false) {
|
|
183
|
+
timeout = setTimeout(later, remaining);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return result;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=headerFooterHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/headerFooterHelpers.ts"],"names":["getStyle","styleClass","type","footerStyleMap","headerStyleMap","addStyleClassToElement","element","styleClasses","forEach","style","document","head","classes","classList","add","getPod","location","origin","site","getPodOwner","pod","store","podOwner","uri","fetcher","load","doc","Error","storageIsListedInPodOwnersProfile","holds","ns","space","getName","user","anyValue","vcard","foaf","throttle","func","wait","options","context","args","result","timeout","previous","later","leading","Date","now","apply","remaining","arguments","clearTimeout","trailing","setTimeout"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;;AAYA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,UAAnB,EAA+BC,IAA/B,EAAsC;AACpC,MAAIA,IAAI,IAAIA,IAAI,KAAK,QAArB,EAA+B;AAC7B,WAAOC,oBAAeF,UAAf,CAAP;AACD,GAFD,MAEO;AACL,WAAOG,mBAAeH,UAAf,CAAP;AACD;AACF;AAED;AACA;AACA;;;AACO,SAASI,sBAAT,CAAiCC,OAAjC,EAA+CC,YAA/C,EAAuEL,IAAvE,EAAsF;AAC3FK,EAAAA,YAAY,CAACC,OAAb,CAAqB,UAACP,UAAD,EAAgB;AACnC,QAAMQ,KAAK,GAAGT,QAAQ,CAACC,UAAD,EAAaC,IAAb,CAAtB;;AACA,sBAAoB,qBAAWQ,QAAQ,CAACC,IAApB,uCAA6BV,UAA7B,EAA0CQ,KAA1C,EAApB;AAAA,QAAQG,OAAR,eAAQA,OAAR;;AACAN,IAAAA,OAAO,CAACO,SAAR,CAAkBC,GAAlB,CAAsBF,OAAO,CAACX,UAAD,CAA7B;AACD,GAJD;AAKD;AACD;AACA;AACA;;;AACO,SAASc,MAAT,GAA8B;AACnC;AACA,SAAO,iBAAIL,QAAQ,CAACM,QAAT,CAAkBC,MAAtB,EAA8BC,IAA9B,EAAP;AACD;AACD;AACA;AACA;;;SACsBC,W;;;AAsBtB;AACA;AACA;;;;+FAxBO,iBAA4BC,GAA5B,EAA4CC,KAA5C;AAAA;AAAA;AAAA;AAAA;AAAA;AACL;AACMC,YAAAA,QAFD,GAEY,2BAAOF,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GAnBD;AAoBD","sourcesContent":["/*\n Copied from mashlib/src/global/metadata.ts\n */\nimport { IndexedFormula, NamedNode, sym } from 'rdflib'\nimport { ns } from '..'\nimport { styleMap as headerStyleMap } from '../header/styleMap'\nimport { styleMap as footerStyleMap } from '../footer/styleMap'\nimport { getClasses } from '../jss'\n\ntype ThrottleOptions = {\n leading?: boolean;\n throttling?: boolean;\n trailing?: boolean;\n}\n/**\n * @internal\n */\nfunction getStyle (styleClass, type?) {\n if (type && type === 'footer') {\n return footerStyleMap[styleClass]\n } else {\n return headerStyleMap[styleClass]\n }\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function addStyleClassToElement (element: any, styleClasses: string[], type?: string) {\n styleClasses.forEach((styleClass) => {\n const style = getStyle(styleClass, type)\n const { classes } = getClasses(document.head, { [styleClass]: style })\n element.classList.add(classes[styleClass])\n })\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getPod (): NamedNode {\n // @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers\n return sym(document.location.origin).site()\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function getPodOwner (pod: NamedNode, store: IndexedFormula): Promise<NamedNode | null> {\n // @@ TODO: This is given the structure that NSS provides - might need to change for other Pod servers\n const podOwner = sym(`${pod.uri}profile/card#me`)\n\n try {\n if (store.fetcher) {\n await store.fetcher.load(podOwner.doc())\n } else {\n throw new Error('There was a problem loading the Fetcher')\n }\n // @@ TODO: check back links to storage\n } catch (err) {\n throw new Error('Did NOT find pod owners profile at ' + podOwner)\n }\n if (podOwner) {\n const storageIsListedInPodOwnersProfile = store.holds(podOwner, ns.space('storage'), pod, podOwner.doc())\n if (!storageIsListedInPodOwnersProfile) {\n throw new Error(`** Pod owner ${podOwner} does NOT list pod ${pod} as storage`)\n }\n }\n return podOwner\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getName (store: IndexedFormula, user: NamedNode): string {\n return store.anyValue(user, ns.vcard('fn'), null, user.doc()) ||\n store.anyValue(user, ns.foaf('name'), null, user.doc()) ||\n user.uri\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function throttle (func: Function, wait: number, options: ThrottleOptions = {}): (...args: any[]) => any {\n let context: any,\n args: any,\n result: any\n let timeout: any = null\n let previous = 0\n const later = function () {\n previous = !options.leading ? 0 : Date.now()\n timeout = null\n result = func.apply(context, args)\n if (!timeout) context = args = null\n }\n return function () {\n const now = Date.now()\n if (!previous && !options.leading) previous = now\n const remaining = wait - (now - previous)\n // @ts-ignore\n context = this\n args = arguments\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout)\n timeout = null\n }\n previous = now\n result = func.apply(context, args)\n if (!timeout) context = args = null\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining)\n }\n return result\n }\n}\n"],"file":"headerFooterHelpers.js"}
|
package/lib/versionInfo.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _default = {
|
|
8
|
-
buildTime: '
|
|
9
|
-
commit: '
|
|
8
|
+
buildTime: '2022-01-04T09:49:10Z',
|
|
9
|
+
commit: '6a9e81a980072cb7f7b8e8098346bd1acac55269',
|
|
10
10
|
npmInfo: {
|
|
11
|
-
'solid-ui': '2.4.
|
|
11
|
+
'solid-ui': '2.4.14',
|
|
12
12
|
npm: '6.14.15',
|
|
13
13
|
ares: '1.18.1',
|
|
14
14
|
brotli: '1.0.9',
|
package/lib/versionInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/versionInfo.ts"],"names":["buildTime","commit","npmInfo","npm","ares","brotli","cldr","icu","llhttp","modules","napi","nghttp2","node","openssl","tz","unicode","uv","v8","zlib"],"mappings":";;;;;;eAAe;AACbA,EAAAA,SAAS,EAAE,sBADE;AAEbC,EAAAA,MAAM,EAAE,0CAFK;AAGbC,EAAAA,OAAO,EACT;AACE,gBAAY,QADd;AAEEC,IAAAA,GAAG,EAAE,SAFP;AAGEC,IAAAA,IAAI,EAAE,QAHR;AAIEC,IAAAA,MAAM,EAAE,OAJV;AAKEC,IAAAA,IAAI,EAAE,MALR;AAMEC,IAAAA,GAAG,EAAE,MANP;AAOEC,IAAAA,MAAM,EAAE,OAPV;AAQEC,IAAAA,OAAO,EAAE,IARX;AASEC,IAAAA,IAAI,EAAE,GATR;AAUEC,IAAAA,OAAO,EAAE,QAVX;AAWEC,IAAAA,IAAI,EAAE,SAXR;AAYEC,IAAAA,OAAO,EAAE,QAZX;AAaEC,IAAAA,EAAE,EAAE,OAbN;AAcEC,IAAAA,OAAO,EAAE,MAdX;AAeEC,IAAAA,EAAE,EAAE,QAfN;AAgBEC,IAAAA,EAAE,EAAE,oBAhBN;AAiBEC,IAAAA,IAAI,EAAE;AAjBR;AAJe,C","sourcesContent":["export default {\n buildTime: '
|
|
1
|
+
{"version":3,"sources":["../src/versionInfo.ts"],"names":["buildTime","commit","npmInfo","npm","ares","brotli","cldr","icu","llhttp","modules","napi","nghttp2","node","openssl","tz","unicode","uv","v8","zlib"],"mappings":";;;;;;eAAe;AACbA,EAAAA,SAAS,EAAE,sBADE;AAEbC,EAAAA,MAAM,EAAE,0CAFK;AAGbC,EAAAA,OAAO,EACT;AACE,gBAAY,QADd;AAEEC,IAAAA,GAAG,EAAE,SAFP;AAGEC,IAAAA,IAAI,EAAE,QAHR;AAIEC,IAAAA,MAAM,EAAE,OAJV;AAKEC,IAAAA,IAAI,EAAE,MALR;AAMEC,IAAAA,GAAG,EAAE,MANP;AAOEC,IAAAA,MAAM,EAAE,OAPV;AAQEC,IAAAA,OAAO,EAAE,IARX;AASEC,IAAAA,IAAI,EAAE,GATR;AAUEC,IAAAA,OAAO,EAAE,QAVX;AAWEC,IAAAA,IAAI,EAAE,SAXR;AAYEC,IAAAA,OAAO,EAAE,QAZX;AAaEC,IAAAA,EAAE,EAAE,OAbN;AAcEC,IAAAA,OAAO,EAAE,MAdX;AAeEC,IAAAA,EAAE,EAAE,QAfN;AAgBEC,IAAAA,EAAE,EAAE,oBAhBN;AAiBEC,IAAAA,IAAI,EAAE;AAjBR;AAJe,C","sourcesContent":["export default {\n buildTime: '2022-01-04T09:49:10Z',\n commit: '6a9e81a980072cb7f7b8e8098346bd1acac55269',\n npmInfo:\n{\n 'solid-ui': '2.4.14',\n npm: '6.14.15',\n ares: '1.18.1',\n brotli: '1.0.9',\n cldr: '39.0',\n icu: '69.1',\n llhttp: '2.1.4',\n modules: '83',\n napi: '8',\n nghttp2: '1.42.0',\n node: '14.18.2',\n openssl: '1.1.1l',\n tz: '2021a',\n unicode: '13.0',\n uv: '1.42.0',\n v8: '8.4.371.23-node.85',\n zlib: '1.2.11'\n}\n}\n"],"file":"versionInfo.js"}
|