solid-ui 2.4.23 → 2.4.24
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 +2159 -5039
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +4 -67
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +59 -137
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +14 -54
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +32 -107
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +0 -92
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.js +1 -3
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/styles.js +1 -2
- package/lib/acl/styles.js.map +1 -1
- package/lib/chat/bookmarks.js +8 -80
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +109 -180
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +6 -91
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +33 -185
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +37 -150
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +23 -96
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +33 -91
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js +19 -51
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.js +0 -2
- package/lib/create/index.js.map +1 -1
- package/lib/debug.js +0 -8
- package/lib/debug.js.map +1 -1
- package/lib/folders.js +4 -27
- package/lib/folders.js.map +1 -1
- package/lib/footer/index.js +2 -24
- package/lib/footer/index.js.map +1 -1
- package/lib/footer/styleMap.js.map +1 -1
- package/lib/header/empty-profile.js.map +1 -1
- package/lib/header/index.js +3 -72
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.js +4 -3
- package/lib/header/styleMap.js.map +1 -1
- package/lib/iconBase.js +3 -4
- package/lib/iconBase.js.map +1 -1
- package/lib/index.js +5 -46
- package/lib/index.js.map +1 -1
- package/lib/jss/index.js +3 -9
- package/lib/jss/index.js.map +1 -1
- package/lib/log.js +15 -51
- package/lib/log.js.map +1 -1
- package/lib/login/login.js +74 -303
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/index.js +0 -2
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.js +7 -55
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/media/index.js +0 -2
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.js +13 -33
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js +23 -64
- package/lib/messageArea.js.map +1 -1
- package/lib/noun_Camera_1618446_000000.js.map +1 -1
- package/lib/ns.js +5 -7
- package/lib/ns.js.map +1 -1
- package/lib/pad.js +48 -234
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +10 -65
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +21 -42
- package/lib/preferences.js.map +1 -1
- package/lib/signup/config-default.js +1 -8
- package/lib/signup/config-default.js.map +1 -1
- package/lib/signup/signup.js +6 -13
- package/lib/signup/signup.js.map +1 -1
- package/lib/stories/decorators.js +0 -2
- package/lib/stories/decorators.js.map +1 -1
- package/lib/style.js +8 -5
- package/lib/style.js.map +1 -1
- package/lib/style_multiSelect.js +1 -5
- package/lib/style_multiSelect.js.map +1 -1
- package/lib/table.js +309 -322
- package/lib/table.js.map +1 -1
- package/lib/tabs.js +20 -100
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +4 -52
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +41 -135
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/label.js +13 -34
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.js +4 -4
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.js +0 -8
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.js +115 -291
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js +12 -41
- package/lib/widgets/dragAndDrop.js.map +1 -1
- package/lib/widgets/error.js +3 -9
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +8 -71
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +13 -65
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +15 -107
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +6 -55
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +12 -131
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.js +12 -55
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.js +1 -15
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.js +3 -16
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.js +0 -12
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.js +1 -14
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +70 -474
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/index.js +0 -21
- package/lib/widgets/index.js.map +1 -1
- package/lib/widgets/multiSelect.js +48 -171
- package/lib/widgets/multiSelect.js.map +1 -1
- package/lib/widgets/peoplePicker.js +20 -90
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/lib/widgets/widgetHelpers.js +2 -9
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +28 -28
package/lib/index.js
CHANGED
|
@@ -25,6 +25,7 @@ If you would like to know more about the solid Solid project, please see
|
|
|
25
25
|
https://github.com/solidos/solid
|
|
26
26
|
*/
|
|
27
27
|
'use strict';
|
|
28
|
+
|
|
28
29
|
/**
|
|
29
30
|
* Provides a Solid client helper object (which exposes various static modules).
|
|
30
31
|
* @module solidUi.js
|
|
@@ -35,10 +36,9 @@ https://github.com/solidos/solid
|
|
|
35
36
|
* @class SolidUi
|
|
36
37
|
* @static
|
|
37
38
|
*/
|
|
38
|
-
// REMOVE @ts-ignore as you migrate files to TypeScript
|
|
39
39
|
|
|
40
|
+
// REMOVE @ts-ignore as you migrate files to TypeScript
|
|
40
41
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
41
|
-
|
|
42
42
|
Object.defineProperty(exports, "__esModule", {
|
|
43
43
|
value: true
|
|
44
44
|
});
|
|
@@ -132,87 +132,46 @@ Object.defineProperty(exports, "versionInfo", {
|
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
exports.widgets = void 0;
|
|
135
|
-
|
|
136
135
|
var rdf = _interopRequireWildcard(require("rdflib"));
|
|
137
|
-
|
|
138
136
|
exports.rdf = rdf;
|
|
139
|
-
|
|
140
137
|
var ns = _interopRequireWildcard(require("./ns"));
|
|
141
|
-
|
|
142
138
|
exports.ns = ns;
|
|
143
|
-
|
|
144
139
|
var _index = require("./acl/index");
|
|
145
|
-
|
|
146
140
|
var _index2 = require("./create/index");
|
|
147
|
-
|
|
148
141
|
var _iconBase = require("./iconBase");
|
|
149
|
-
|
|
150
142
|
var language = _interopRequireWildcard(require("./widgets/forms/autocomplete/language"));
|
|
151
|
-
|
|
152
143
|
exports.language = language;
|
|
153
|
-
|
|
154
144
|
var log = _interopRequireWildcard(require("./log"));
|
|
155
|
-
|
|
156
145
|
exports.log = log;
|
|
157
|
-
|
|
158
146
|
var _index3 = require("./matrix/index");
|
|
159
|
-
|
|
160
147
|
var _index4 = require("./media/index");
|
|
161
|
-
|
|
162
148
|
var _messageArea = require("./messageArea");
|
|
163
|
-
|
|
164
149
|
var _infinite = require("./chat/infinite");
|
|
165
|
-
|
|
166
150
|
var pad = _interopRequireWildcard(require("./pad"));
|
|
167
|
-
|
|
168
151
|
exports.pad = pad;
|
|
169
|
-
|
|
170
152
|
var participation = _interopRequireWildcard(require("./participation"));
|
|
171
|
-
|
|
172
153
|
exports.participation = participation;
|
|
173
|
-
|
|
174
154
|
var preferences = _interopRequireWildcard(require("./preferences"));
|
|
175
|
-
|
|
176
155
|
exports.preferences = preferences;
|
|
177
|
-
|
|
178
156
|
var style = _interopRequireWildcard(require("./style"));
|
|
179
|
-
|
|
180
157
|
exports.style = style;
|
|
181
|
-
|
|
182
158
|
var _table = require("./table");
|
|
183
|
-
|
|
184
159
|
var tabs = _interopRequireWildcard(require("./tabs"));
|
|
185
|
-
|
|
186
160
|
exports.tabs = tabs;
|
|
187
|
-
|
|
188
161
|
var utils = _interopRequireWildcard(require("./utils"));
|
|
189
|
-
|
|
190
162
|
exports.utils = utils;
|
|
191
|
-
|
|
192
163
|
var login = _interopRequireWildcard(require("./login/login"));
|
|
193
|
-
|
|
194
164
|
exports.login = login;
|
|
195
|
-
|
|
196
165
|
var widgets = _interopRequireWildcard(require("./widgets/index"));
|
|
197
|
-
|
|
198
166
|
exports.widgets = widgets;
|
|
199
|
-
|
|
200
167
|
var _versionInfo = require("./versionInfo");
|
|
201
|
-
|
|
202
168
|
var _header = require("./header");
|
|
203
|
-
|
|
204
169
|
var _footer = require("./footer");
|
|
205
|
-
|
|
206
170
|
var createTypes = _interopRequireWildcard(require("./create/types"));
|
|
207
|
-
|
|
208
171
|
exports.createTypes = createTypes;
|
|
209
|
-
|
|
210
172
|
var _solidLogic = require("solid-logic");
|
|
211
|
-
|
|
212
173
|
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); }
|
|
213
|
-
|
|
214
174
|
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; }
|
|
215
|
-
|
|
216
175
|
// pull in first avoid cross-refs
|
|
217
176
|
// @ts-ignore
|
|
218
177
|
// @ts-ignore
|
|
@@ -225,9 +184,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
225
184
|
// @ts-ignore
|
|
226
185
|
// @ts-ignore
|
|
227
186
|
var dom = window ? window.document : null; // Idea that UI.dom can be adapted in non-browser environments
|
|
228
|
-
|
|
229
187
|
exports.dom = dom;
|
|
230
|
-
|
|
231
188
|
if (typeof window !== 'undefined') {
|
|
232
189
|
;
|
|
233
190
|
window.UI = {
|
|
@@ -260,5 +217,7 @@ if (typeof window !== 'undefined') {
|
|
|
260
217
|
initHeader: _header.initHeader,
|
|
261
218
|
initFooter: _footer.initFooter
|
|
262
219
|
}; // Simpler access by non-node scripts
|
|
263
|
-
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// this variables are directly used in the storybook
|
|
264
223
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["dom","window","document","UI","authn","store","ns","rdf","acl","aclControl","create","createTypes","icons","language","log","login","matrix","media","messageArea","infiniteMessageArea","pad","participation","preferences","style","table","tabs","utils","widgets","versionInfo","initHeader","initFooter"],"sources":["../src/index.ts"],"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/solidos/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 { create } from './create/index'\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 * 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 login from './login/login'\nimport * as widgets from './widgets/index'\nimport { versionInfo } from './versionInfo'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\nimport { authn, store } from 'solid-logic'\n\nconst dom = window ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\nif (typeof window !== 'undefined') {\n ;(<any>window).UI = {\n authn,\n store,\n ns,\n rdf,\n acl,\n aclControl,\n create,\n createTypes,\n dom,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\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\n// this variables are directly used in the storybook\nexport {\n authn,\n store,\n ns,\n rdf,\n acl,\n aclControl,\n create,\n createTypes,\n dom,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n}\n"],"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
|
|
1
|
+
{"version":3,"file":"index.js","names":["dom","window","document","UI","authn","store","ns","rdf","acl","aclControl","create","createTypes","icons","language","log","login","matrix","media","messageArea","infiniteMessageArea","pad","participation","preferences","style","table","tabs","utils","widgets","versionInfo","initHeader","initFooter"],"sources":["../src/index.ts"],"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/solidos/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 { create } from './create/index'\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 * 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 login from './login/login'\nimport * as widgets from './widgets/index'\nimport { versionInfo } from './versionInfo'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\nimport { authn, store } from 'solid-logic'\n\nconst dom = window ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\nif (typeof window !== 'undefined') {\n ;(<any>window).UI = {\n authn,\n store,\n ns,\n rdf,\n acl,\n aclControl,\n create,\n createTypes,\n dom,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\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\n// this variables are directly used in the storybook\nexport {\n authn,\n store,\n ns,\n rdf,\n acl,\n aclControl,\n create,\n createTypes,\n dom,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n}\n"],"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,YAAY;;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AAAA;AAAA;EAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;EAAA;EAAA;IAAA;EAAA;AAAA;AAAA;AAAA;EA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,WAAW;IACXC,KAAK,EAALA,KAAK;IACLC,KAAK,EAALA,0BAAK;IACLC,IAAI,EAAJA,IAAI;IACJC,KAAK,EAALA,KAAK;IACLC,OAAO,EAAPA,OAAO;IACPC,WAAW,EAAXA,wBAAW;IACXC,UAAU,EAAVA,kBAAU;IACVC,UAAU,EAAVA;EACF,CAAC,EAAC;AACJ;;AAEA"}
|
package/lib/jss/index.js
CHANGED
|
@@ -1,48 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getClasses = getClasses;
|
|
9
8
|
exports.getStylesheet = getStylesheet;
|
|
10
|
-
|
|
11
9
|
var _jss = require("jss");
|
|
12
|
-
|
|
13
10
|
var _jssPresetDefault = _interopRequireDefault(require("jss-preset-default"));
|
|
14
|
-
|
|
15
11
|
/**
|
|
16
12
|
* Contains [[getClasses]] and [[getStylesheet]] functions,
|
|
17
13
|
* usable as wrappers around JSS (A CSS authoring tool).
|
|
18
14
|
* See https://cssinjs.org/
|
|
19
15
|
* @packageDocumentation
|
|
20
16
|
*/
|
|
17
|
+
|
|
21
18
|
var stylesheetsMap = new Map();
|
|
19
|
+
|
|
22
20
|
/**
|
|
23
21
|
* returns a StyleSheet object.
|
|
24
22
|
* See https://cssinjs.org/ for more info about JSS.
|
|
25
23
|
* (despite the name, see https://github.com/solidos/solid-ui/issues/199)
|
|
26
24
|
*/
|
|
27
|
-
|
|
28
25
|
function getClasses(insertionPoint, styles) {
|
|
29
26
|
var stylesheet = getStylesheet(insertionPoint);
|
|
30
27
|
return stylesheet.createStyleSheet(styles).attach();
|
|
31
28
|
}
|
|
29
|
+
|
|
32
30
|
/**
|
|
33
31
|
* returns a JSS object.
|
|
34
32
|
* See https://cssinjs.org/ for more info about JSS.
|
|
35
33
|
* (despite the name, see https://github.com/solidos/solid-ui/issues/199)
|
|
36
34
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
35
|
function getStylesheet(insertionPoint) {
|
|
40
36
|
var cachedStylesheet = stylesheetsMap.get(insertionPoint);
|
|
41
|
-
|
|
42
37
|
if (cachedStylesheet) {
|
|
43
38
|
return cachedStylesheet;
|
|
44
39
|
}
|
|
45
|
-
|
|
46
40
|
var stylesheet = (0, _jss.create)({
|
|
47
41
|
insertionPoint: insertionPoint,
|
|
48
42
|
plugins: (0, _jssPresetDefault["default"])().plugins
|
package/lib/jss/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["stylesheetsMap","Map","getClasses","insertionPoint","styles","stylesheet","getStylesheet","createStyleSheet","attach","cachedStylesheet","get","create","plugins","preset","set"],"sources":["../../src/jss/index.ts"],"sourcesContent":["/**\n * Contains [[getClasses]] and [[getStylesheet]] functions,\n * usable as wrappers around JSS (A CSS authoring tool).\n * See https://cssinjs.org/\n * @packageDocumentation\n */\n\nimport { create, Jss, Styles, StyleSheet } from 'jss'\nimport preset from 'jss-preset-default'\n\nconst stylesheetsMap = new Map<HTMLElement, Jss>()\n\n/**\n * returns a StyleSheet object.\n * See https://cssinjs.org/ for more info about JSS.\n * (despite the name, see https://github.com/solidos/solid-ui/issues/199)\n */\nexport function getClasses (insertionPoint: HTMLElement, styles: Partial<Styles>): StyleSheet {\n const stylesheet = getStylesheet(insertionPoint)\n return stylesheet.createStyleSheet(styles).attach()\n}\n\n/**\n * returns a JSS object.\n * See https://cssinjs.org/ for more info about JSS.\n * (despite the name, see https://github.com/solidos/solid-ui/issues/199)\n */\nexport function getStylesheet (insertionPoint: HTMLElement): Jss {\n const cachedStylesheet = stylesheetsMap.get(insertionPoint)\n if (cachedStylesheet) {\n return cachedStylesheet\n }\n const stylesheet = create({\n insertionPoint,\n plugins: preset().plugins\n })\n stylesheetsMap.set(insertionPoint, stylesheet)\n return stylesheet\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["stylesheetsMap","Map","getClasses","insertionPoint","styles","stylesheet","getStylesheet","createStyleSheet","attach","cachedStylesheet","get","create","plugins","preset","set"],"sources":["../../src/jss/index.ts"],"sourcesContent":["/**\n * Contains [[getClasses]] and [[getStylesheet]] functions,\n * usable as wrappers around JSS (A CSS authoring tool).\n * See https://cssinjs.org/\n * @packageDocumentation\n */\n\nimport { create, Jss, Styles, StyleSheet } from 'jss'\nimport preset from 'jss-preset-default'\n\nconst stylesheetsMap = new Map<HTMLElement, Jss>()\n\n/**\n * returns a StyleSheet object.\n * See https://cssinjs.org/ for more info about JSS.\n * (despite the name, see https://github.com/solidos/solid-ui/issues/199)\n */\nexport function getClasses (insertionPoint: HTMLElement, styles: Partial<Styles>): StyleSheet {\n const stylesheet = getStylesheet(insertionPoint)\n return stylesheet.createStyleSheet(styles).attach()\n}\n\n/**\n * returns a JSS object.\n * See https://cssinjs.org/ for more info about JSS.\n * (despite the name, see https://github.com/solidos/solid-ui/issues/199)\n */\nexport function getStylesheet (insertionPoint: HTMLElement): Jss {\n const cachedStylesheet = stylesheetsMap.get(insertionPoint)\n if (cachedStylesheet) {\n return cachedStylesheet\n }\n const stylesheet = create({\n insertionPoint,\n plugins: preset().plugins\n })\n stylesheetsMap.set(insertionPoint, stylesheet)\n return stylesheet\n}\n"],"mappings":";;;;;;;;AAOA;AACA;AARA;AACA;AACA;AACA;AACA;AACA;;AAKA,IAAMA,cAAc,GAAG,IAAIC,GAAG,EAAoB;;AAElD;AACA;AACA;AACA;AACA;AACO,SAASC,UAAU,CAAEC,cAA2B,EAAEC,MAAuB,EAAc;EAC5F,IAAMC,UAAU,GAAGC,aAAa,CAACH,cAAc,CAAC;EAChD,OAAOE,UAAU,CAACE,gBAAgB,CAACH,MAAM,CAAC,CAACI,MAAM,EAAE;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASF,aAAa,CAAEH,cAA2B,EAAO;EAC/D,IAAMM,gBAAgB,GAAGT,cAAc,CAACU,GAAG,CAACP,cAAc,CAAC;EAC3D,IAAIM,gBAAgB,EAAE;IACpB,OAAOA,gBAAgB;EACzB;EACA,IAAMJ,UAAU,GAAG,IAAAM,WAAM,EAAC;IACxBR,cAAc,EAAdA,cAAc;IACdS,OAAO,EAAE,IAAAC,4BAAM,GAAE,CAACD;EACpB,CAAC,CAAC;EACFZ,cAAc,CAACc,GAAG,CAACX,cAAc,EAAEE,UAAU,CAAC;EAC9C,OAAOA,UAAU;AACnB"}
|
package/lib/log.js
CHANGED
|
@@ -22,34 +22,25 @@ exports.warn = warn;
|
|
|
22
22
|
//
|
|
23
23
|
// bitmask levels
|
|
24
24
|
// const TNONE = 0
|
|
25
|
-
|
|
26
25
|
/** @internal */
|
|
27
26
|
var TERROR = 1;
|
|
28
27
|
/** @internal */
|
|
29
|
-
|
|
30
28
|
var TWARN = 2;
|
|
31
29
|
/** @internal */
|
|
32
|
-
|
|
33
30
|
var TMESG = 4;
|
|
34
31
|
/** @internal */
|
|
35
|
-
|
|
36
32
|
var TSUCCESS = 8;
|
|
37
33
|
/** @internal */
|
|
38
|
-
|
|
39
34
|
var TINFO = 16;
|
|
40
35
|
/** @internal */
|
|
41
|
-
|
|
42
36
|
var TDEBUG = 32;
|
|
43
37
|
/** @internal */
|
|
44
|
-
|
|
45
38
|
var TALL = 63;
|
|
46
|
-
/** @internal */
|
|
47
39
|
|
|
40
|
+
/** @internal */
|
|
48
41
|
var LogLevel;
|
|
49
42
|
/** @internal */
|
|
50
|
-
|
|
51
43
|
exports.LogLevel = LogLevel;
|
|
52
|
-
|
|
53
44
|
(function (LogLevel) {
|
|
54
45
|
LogLevel[LogLevel["Error"] = TERROR] = "Error";
|
|
55
46
|
LogLevel[LogLevel["Warning"] = TWARN] = "Warning";
|
|
@@ -59,22 +50,15 @@ exports.LogLevel = LogLevel;
|
|
|
59
50
|
LogLevel[LogLevel["Debug"] = TDEBUG] = "Debug";
|
|
60
51
|
LogLevel[LogLevel["All"] = TALL] = "All";
|
|
61
52
|
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
62
|
-
|
|
63
53
|
var _level = TERROR + TWARN + TMESG;
|
|
64
54
|
/** @internal */
|
|
65
|
-
|
|
66
|
-
|
|
67
55
|
var _ascending = false;
|
|
68
56
|
/** @internal */
|
|
69
|
-
|
|
70
57
|
var _dom = document; // must be able to override for tests
|
|
71
|
-
|
|
72
58
|
/** @internal */
|
|
73
|
-
|
|
74
59
|
var _window = window; // must be able to override for tests
|
|
75
60
|
|
|
76
61
|
/** @internal */
|
|
77
|
-
|
|
78
62
|
function log(str) {
|
|
79
63
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TMESG;
|
|
80
64
|
var typestr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'mesg';
|
|
@@ -82,15 +66,11 @@ function log(str) {
|
|
|
82
66
|
|
|
83
67
|
if (typeof _dom !== 'undefined') {
|
|
84
68
|
var logArea = _dom.getElementById('status');
|
|
85
|
-
|
|
86
69
|
if (!logArea) return;
|
|
87
|
-
|
|
88
70
|
var addendum = _dom.createElement('span');
|
|
89
|
-
|
|
90
71
|
addendum.setAttribute('class', typestr);
|
|
91
72
|
var now = new Date();
|
|
92
73
|
addendum.innerHTML = "".concat(now.getHours(), ":").concat(now.getMinutes(), ":").concat(now.getSeconds(), " [").concat(typestr, "] ").concat(escapeForXML(str), "<br/>");
|
|
93
|
-
|
|
94
74
|
if (_ascending) {
|
|
95
75
|
logArea.insertBefore(addendum, logArea.firstChild);
|
|
96
76
|
} else {
|
|
@@ -101,66 +81,59 @@ function log(str) {
|
|
|
101
81
|
console.log(str);
|
|
102
82
|
}
|
|
103
83
|
}
|
|
84
|
+
|
|
104
85
|
/**
|
|
105
86
|
* Adds a message to the element with id "status". The messages are prepended with
|
|
106
87
|
* time and type of message, in this case [mesg].
|
|
107
88
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
89
|
function msg(message) {
|
|
111
90
|
log(message);
|
|
112
91
|
}
|
|
92
|
+
|
|
113
93
|
/**
|
|
114
94
|
* Adds a warning message to the element with id "status". The messages are
|
|
115
95
|
* prepended with time and type of message, in this case [warn].
|
|
116
96
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
97
|
function warn(message) {
|
|
120
98
|
log(message, TWARN, 'warn');
|
|
121
99
|
}
|
|
100
|
+
|
|
122
101
|
/**
|
|
123
102
|
* Adds a debugging message to the element with id "status". The messages are
|
|
124
103
|
* prepended with time and type of message, in this case [dbug].
|
|
125
104
|
*/
|
|
126
|
-
|
|
127
|
-
|
|
128
105
|
function debug(message) {
|
|
129
106
|
log(message, TDEBUG, 'dbug');
|
|
130
107
|
}
|
|
108
|
+
|
|
131
109
|
/**
|
|
132
110
|
* Adds a info message to the element with id "status". The messages are
|
|
133
111
|
* prepended with time and type of message, in this case [info].
|
|
134
112
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
113
|
function info(message) {
|
|
138
114
|
log(message, TINFO, 'info');
|
|
139
115
|
}
|
|
116
|
+
|
|
140
117
|
/**
|
|
141
118
|
* Adds a error to the element with id "status". The messages are
|
|
142
119
|
* prepended with time and type of message, in this case [eror].
|
|
143
120
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
121
|
function error(message) {
|
|
147
122
|
log(message, TERROR, 'eror');
|
|
148
123
|
}
|
|
124
|
+
|
|
149
125
|
/**
|
|
150
126
|
* Adds a success message to the element with id "status". The messages are
|
|
151
127
|
* prepended with time and type of message, in this case [good].
|
|
152
128
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
129
|
function success(message) {
|
|
156
130
|
log(message, TSUCCESS, 'good');
|
|
157
131
|
}
|
|
132
|
+
|
|
158
133
|
/**
|
|
159
134
|
* Uses the global alert to send an alert. If global alert is not available, it
|
|
160
135
|
* will output the message using the method [[warning]]s.
|
|
161
136
|
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
137
|
function alert(message) {
|
|
165
138
|
if (_window && typeof _window.alert !== 'undefined') {
|
|
166
139
|
_window.alert(message);
|
|
@@ -168,18 +141,17 @@ function alert(message) {
|
|
|
168
141
|
warn(message);
|
|
169
142
|
}
|
|
170
143
|
}
|
|
144
|
+
|
|
171
145
|
/**
|
|
172
146
|
* Will clear the content of the element with id "status".
|
|
173
147
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
148
|
function clear() {
|
|
177
149
|
var _dom2;
|
|
178
|
-
|
|
179
150
|
var logArea = (_dom2 = _dom) === null || _dom2 === void 0 ? void 0 : _dom2.getElementById('status');
|
|
180
151
|
if (!logArea) return;
|
|
181
152
|
logArea.innerHTML = '';
|
|
182
153
|
}
|
|
154
|
+
|
|
183
155
|
/**
|
|
184
156
|
* Lets you configure which types of messages will be shown. The module uses
|
|
185
157
|
* [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which
|
|
@@ -195,54 +167,46 @@ function clear() {
|
|
|
195
167
|
* - Info: 16
|
|
196
168
|
* - Debug: 32
|
|
197
169
|
*/
|
|
198
|
-
|
|
199
|
-
|
|
200
170
|
function setLevel(level) {
|
|
201
171
|
_level = TALL;
|
|
202
172
|
debug('Log level is now ' + level);
|
|
203
173
|
_level = level;
|
|
204
174
|
}
|
|
175
|
+
|
|
205
176
|
/**
|
|
206
177
|
* Will dump the current HTML using the [[debug]] method.
|
|
207
178
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
179
|
function dumpHTML() {
|
|
211
180
|
var _dom3, _dom3$body;
|
|
212
|
-
|
|
213
181
|
if (!_dom) return;
|
|
214
182
|
var level = _level;
|
|
215
183
|
_level = TALL;
|
|
216
184
|
debug(((_dom3 = _dom) === null || _dom3 === void 0 ? void 0 : (_dom3$body = _dom3.body) === null || _dom3$body === void 0 ? void 0 : _dom3$body.innerHTML) || '');
|
|
217
185
|
_level = level;
|
|
218
186
|
}
|
|
187
|
+
|
|
219
188
|
/**
|
|
220
189
|
* Will start prepending messages the list of log messages.
|
|
221
190
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
224
191
|
function logAscending() {
|
|
225
192
|
_ascending = true;
|
|
226
193
|
}
|
|
194
|
+
|
|
227
195
|
/**
|
|
228
196
|
* Will start appending messages the list of log messages. (This is default
|
|
229
197
|
* behavior.)
|
|
230
198
|
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
199
|
function logDescending() {
|
|
234
200
|
_ascending = false;
|
|
235
201
|
}
|
|
236
|
-
/** @internal */
|
|
237
|
-
|
|
238
202
|
|
|
203
|
+
/** @internal */
|
|
239
204
|
function escapeForXML(str) {
|
|
240
205
|
// can be replaced with function utils module when migrating
|
|
241
206
|
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
242
207
|
}
|
|
243
|
-
/** @internal */
|
|
244
|
-
|
|
245
208
|
|
|
209
|
+
/** @internal */
|
|
246
210
|
function setInternals(window, document) {
|
|
247
211
|
_window = window;
|
|
248
212
|
_dom = document;
|
package/lib/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","names":["TERROR","TWARN","TMESG","TSUCCESS","TINFO","TDEBUG","TALL","LogLevel","_level","_ascending","_dom","document","_window","window","log","str","type","typestr","logArea","getElementById","addendum","createElement","setAttribute","now","Date","innerHTML","getHours","getMinutes","getSeconds","escapeForXML","insertBefore","firstChild","appendChild","console","msg","message","warn","debug","info","error","success","alert","clear","setLevel","level","dumpHTML","body","logAscending","logDescending","replace","setInternals"],"sources":["../src/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n}\n\n/** @internal */\nexport function setInternals (window, document) {\n _window = window\n _dom = document\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"log.js","names":["TERROR","TWARN","TMESG","TSUCCESS","TINFO","TDEBUG","TALL","LogLevel","_level","_ascending","_dom","document","_window","window","log","str","type","typestr","logArea","getElementById","addendum","createElement","setAttribute","now","Date","innerHTML","getHours","getMinutes","getSeconds","escapeForXML","insertBefore","firstChild","appendChild","console","msg","message","warn","debug","info","error","success","alert","clear","setLevel","level","dumpHTML","body","logAscending","logDescending","replace","setInternals"],"sources":["../src/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n}\n\n/** @internal */\nexport function setInternals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