@haiilo/catalyst 0.5.0 → 0.5.1
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/catalyst/app-globals-23d8c4a8.js +948 -0
- package/dist/catalyst/app-globals-23d8c4a8.js.map +1 -0
- package/dist/catalyst/app-globals-3dd6a26b.js +948 -0
- package/dist/catalyst/app-globals-3dd6a26b.js.map +1 -0
- package/dist/catalyst/app-globals-42ce39cc.js +948 -0
- package/dist/catalyst/app-globals-42ce39cc.js.map +1 -0
- package/dist/catalyst/app-globals-5cf43b57.js +949 -0
- package/dist/catalyst/app-globals-5cf43b57.js.map +1 -0
- package/dist/catalyst/app-globals-8598c768.js +948 -0
- package/dist/catalyst/app-globals-8598c768.js.map +1 -0
- package/dist/catalyst/app-globals-a41af143.js +948 -0
- package/dist/catalyst/app-globals-a41af143.js.map +1 -0
- package/dist/catalyst/app-globals-c6a8b994.js +949 -0
- package/dist/catalyst/app-globals-c6a8b994.js.map +1 -0
- package/dist/catalyst/cat-alert.entry.js +33 -0
- package/dist/catalyst/cat-alert.entry.js.map +1 -0
- package/dist/catalyst/cat-badge.entry.js +44 -0
- package/dist/catalyst/cat-badge.entry.js.map +1 -0
- package/dist/catalyst/cat-button.entry.js +298 -0
- package/dist/catalyst/cat-button.entry.js.map +1 -0
- package/dist/catalyst/cat-card.entry.js +17 -0
- package/dist/catalyst/cat-card.entry.js.map +1 -0
- package/dist/catalyst/cat-checkbox.entry.js +75 -0
- package/dist/catalyst/cat-checkbox.entry.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js +75 -0
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-330db605.js +74 -0
- package/dist/catalyst/cat-i18n-registry-330db605.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-83d20604.js +74 -0
- package/dist/catalyst/cat-i18n-registry-83d20604.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-dd55821d.js +73 -0
- package/dist/catalyst/cat-i18n-registry-dd55821d.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-f6560651.js +75 -0
- package/dist/catalyst/cat-i18n-registry-f6560651.js.map +1 -0
- package/dist/catalyst/cat-icon-registry-2dcfc9fb.js +59 -0
- package/dist/catalyst/cat-icon-registry-2dcfc9fb.js.map +1 -0
- package/dist/catalyst/cat-icon.entry.js +31 -0
- package/dist/catalyst/cat-icon.entry.js.map +1 -0
- package/dist/catalyst/cat-input.entry.js +111 -0
- package/dist/catalyst/cat-input.entry.js.map +1 -0
- package/dist/catalyst/cat-menu.entry.js +850 -0
- package/dist/catalyst/cat-menu.entry.js.map +1 -0
- package/dist/catalyst/cat-radio.entry.js +66 -0
- package/dist/catalyst/cat-radio.entry.js.map +1 -0
- package/dist/catalyst/cat-scrollable.entry.js +4522 -0
- package/dist/catalyst/cat-scrollable.entry.js.map +1 -0
- package/dist/catalyst/cat-skeleton.entry.js +55 -0
- package/dist/catalyst/cat-skeleton.entry.js.map +1 -0
- package/dist/catalyst/cat-spinner.entry.js +23 -0
- package/dist/catalyst/cat-spinner.entry.js.map +1 -0
- package/dist/catalyst/cat-textarea.entry.js +87 -0
- package/dist/catalyst/cat-textarea.entry.js.map +1 -0
- package/dist/catalyst/cat-toggle.entry.js +66 -0
- package/dist/catalyst/cat-toggle.entry.js.map +1 -0
- package/dist/catalyst/cat-tooltip.entry.js +129 -0
- package/dist/catalyst/cat-tooltip.entry.js.map +1 -0
- package/dist/catalyst/catalyst.css +2033 -1
- package/dist/catalyst/catalyst.esm.js +133 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/css-shim-e6dd2538.js +6 -0
- package/dist/catalyst/css-shim-e6dd2538.js.map +1 -0
- package/dist/catalyst/dom-7fc649b0.js +75 -0
- package/dist/catalyst/dom-7fc649b0.js.map +1 -0
- package/dist/catalyst/first-tabbable-2d9f9e9a.js +2123 -0
- package/dist/catalyst/first-tabbable-2d9f9e9a.js.map +1 -0
- package/dist/catalyst/index-471d4e05.js +3059 -0
- package/dist/catalyst/index-471d4e05.js.map +1 -0
- package/dist/catalyst/index-bbb694f5.js +3059 -0
- package/dist/catalyst/index-bbb694f5.js.map +1 -0
- package/dist/catalyst/index.esm.js +4 -1
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/{esm/cat-icon-registry-77963c26.js → catalyst/loglevel-7f0f71af.js} +35 -126
- package/dist/catalyst/loglevel-7f0f71af.js.map +1 -0
- package/dist/catalyst/shadow-css-4d56fa31.js +390 -0
- package/dist/catalyst/shadow-css-4d56fa31.js.map +1 -0
- package/dist/cjs/app-globals-aaefc070.js +950 -0
- package/dist/cjs/app-globals-aaefc070.js.map +1 -0
- package/dist/cjs/cat-alert.cjs.entry.js +37 -0
- package/dist/cjs/cat-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-badge.cjs.entry.js +48 -0
- package/dist/cjs/cat-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-button.cjs.entry.js +302 -0
- package/dist/cjs/cat-button.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-card.cjs.entry.js +21 -0
- package/dist/cjs/cat-card.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-checkbox.cjs.entry.js +79 -0
- package/dist/cjs/cat-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-i18n-registry-a1379d1e.js +76 -0
- package/dist/cjs/cat-i18n-registry-a1379d1e.js.map +1 -0
- package/dist/cjs/cat-icon-registry-74247389.js +61 -0
- package/dist/cjs/cat-icon-registry-74247389.js.map +1 -0
- package/dist/cjs/cat-icon.cjs.entry.js +35 -0
- package/dist/cjs/cat-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-input.cjs.entry.js +115 -0
- package/dist/cjs/cat-input.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-menu.cjs.entry.js +854 -0
- package/dist/cjs/cat-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-radio.cjs.entry.js +70 -0
- package/dist/cjs/cat-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-scrollable.cjs.entry.js +4526 -0
- package/dist/cjs/cat-scrollable.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-skeleton.cjs.entry.js +59 -0
- package/dist/cjs/cat-skeleton.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-spinner.cjs.entry.js +27 -0
- package/dist/cjs/cat-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-textarea.cjs.entry.js +91 -0
- package/dist/cjs/cat-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-toggle.cjs.entry.js +70 -0
- package/dist/cjs/cat-toggle.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-tooltip.cjs.entry.js +133 -0
- package/dist/cjs/cat-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +118 -6
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/css-shim-6ca600c2.js +8 -0
- package/dist/cjs/css-shim-6ca600c2.js.map +1 -0
- package/dist/cjs/dom-8d415461.js +77 -0
- package/dist/cjs/dom-8d415461.js.map +1 -0
- package/dist/cjs/first-tabbable-2068dcc6.js +2133 -0
- package/dist/cjs/first-tabbable-2068dcc6.js.map +1 -0
- package/dist/cjs/index-abcb3941.js +3094 -0
- package/dist/cjs/index-abcb3941.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +20 -4
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{cat-icon-registry-6895750f.js → loglevel-24040e9d.js} +34 -127
- package/dist/cjs/loglevel-24040e9d.js.map +1 -0
- package/dist/cjs/shadow-css-78860e39.js +392 -0
- package/dist/cjs/shadow-css-78860e39.js.map +1 -0
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +2 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +2 -1
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-scrollable.js +3209 -23
- package/dist/components/cat-scrollable.js.map +1 -1
- package/dist/components/first-tabbable.js +627 -0
- package/dist/components/first-tabbable.js.map +1 -1
- package/dist/components/index.js +769 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/loglevel.js +33 -2
- package/dist/components/loglevel.js.map +1 -1
- package/dist/esm/app-globals-3dd6a26b.js +948 -0
- package/dist/esm/app-globals-3dd6a26b.js.map +1 -0
- package/dist/esm/cat-alert.entry.js +33 -0
- package/dist/esm/cat-alert.entry.js.map +1 -0
- package/dist/esm/cat-badge.entry.js +44 -0
- package/dist/esm/cat-badge.entry.js.map +1 -0
- package/dist/esm/cat-button.entry.js +298 -0
- package/dist/esm/cat-button.entry.js.map +1 -0
- package/dist/esm/cat-card.entry.js +17 -0
- package/dist/esm/cat-card.entry.js.map +1 -0
- package/dist/esm/cat-checkbox.entry.js +75 -0
- package/dist/esm/cat-checkbox.entry.js.map +1 -0
- package/dist/esm/cat-i18n-registry-83d20604.js +74 -0
- package/dist/esm/cat-i18n-registry-83d20604.js.map +1 -0
- package/dist/esm/cat-icon-registry-2dcfc9fb.js +59 -0
- package/dist/esm/cat-icon-registry-2dcfc9fb.js.map +1 -0
- package/dist/esm/cat-icon.entry.js +31 -0
- package/dist/esm/cat-icon.entry.js.map +1 -0
- package/dist/esm/cat-input.entry.js +111 -0
- package/dist/esm/cat-input.entry.js.map +1 -0
- package/dist/esm/cat-menu.entry.js +850 -0
- package/dist/esm/cat-menu.entry.js.map +1 -0
- package/dist/esm/cat-radio.entry.js +66 -0
- package/dist/esm/cat-radio.entry.js.map +1 -0
- package/dist/esm/cat-scrollable.entry.js +4522 -0
- package/dist/esm/cat-scrollable.entry.js.map +1 -0
- package/dist/esm/cat-skeleton.entry.js +55 -0
- package/dist/esm/cat-skeleton.entry.js.map +1 -0
- package/dist/esm/cat-spinner.entry.js +23 -0
- package/dist/esm/cat-spinner.entry.js.map +1 -0
- package/dist/esm/cat-textarea.entry.js +87 -0
- package/dist/esm/cat-textarea.entry.js.map +1 -0
- package/dist/esm/cat-toggle.entry.js +66 -0
- package/dist/esm/cat-toggle.entry.js.map +1 -0
- package/dist/esm/cat-tooltip.entry.js +129 -0
- package/dist/esm/cat-tooltip.entry.js.map +1 -0
- package/dist/esm/catalyst.js +118 -6
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/css-shim-e6dd2538.js +6 -0
- package/dist/esm/css-shim-e6dd2538.js.map +1 -0
- package/dist/esm/dom-7fc649b0.js +75 -0
- package/dist/esm/dom-7fc649b0.js.map +1 -0
- package/dist/esm/first-tabbable-2d9f9e9a.js +2123 -0
- package/dist/esm/first-tabbable-2d9f9e9a.js.map +1 -0
- package/dist/esm/index-471d4e05.js +3059 -0
- package/dist/esm/index-471d4e05.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +20 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/loglevel-7f0f71af.js +346 -0
- package/dist/esm/loglevel-7f0f71af.js.map +1 -0
- package/dist/esm/shadow-css-4d56fa31.js +390 -0
- package/dist/esm/shadow-css-4d56fa31.js.map +1 -0
- package/dist/types/components/cat-alert/cat-alert.e2e.d.ts +1 -0
- package/dist/types/components/cat-alert/cat-alert.spec.d.ts +1 -0
- package/dist/types/components/cat-badge/cat-badge.e2e.d.ts +1 -0
- package/dist/types/components/cat-badge/cat-badge.spec.d.ts +1 -0
- package/dist/types/components/cat-button/cat-button.e2e.d.ts +1 -0
- package/dist/types/components/cat-button/cat-button.spec.d.ts +1 -0
- package/dist/types/components/cat-card/cat-card.e2e.d.ts +1 -0
- package/dist/types/components/cat-card/cat-card.spec.d.ts +1 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.e2e.d.ts +1 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.spec.d.ts +1 -0
- package/dist/types/components/cat-icon/cat-icon.e2e.d.ts +1 -0
- package/dist/types/components/cat-icon/cat-icon.spec.d.ts +1 -0
- package/dist/types/components/cat-input/cat-input.e2e.d.ts +1 -0
- package/dist/types/components/cat-input/cat-input.spec.d.ts +1 -0
- package/dist/types/components/cat-menu/cat-menu.e2e.d.ts +1 -0
- package/dist/types/components/cat-menu/cat-menu.spec.d.ts +1 -0
- package/dist/types/components/cat-radio/cat-radio.e2e.d.ts +1 -0
- package/dist/types/components/cat-radio/cat-radio.spec.d.ts +1 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.e2e.d.ts +1 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.spec.d.ts +1 -0
- package/dist/types/components/cat-skeleton/cat-skeleton.e2e.d.ts +1 -0
- package/dist/types/components/cat-skeleton/cat-skeleton.spec.d.ts +1 -0
- package/dist/types/components/cat-spinner/cat-spinner.e2e.d.ts +1 -0
- package/dist/types/components/cat-spinner/cat-spinner.spec.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.e2e.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.spec.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.e2e.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.spec.d.ts +1 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.e2e.d.ts +1 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.spec.d.ts +1 -0
- package/dist/types/utils/media-matcher.spec.d.ts +1 -0
- package/package.json +3 -3
- package/dist/catalyst/p-23d54bc6.js +0 -2
- package/dist/catalyst/p-23d54bc6.js.map +0 -1
- package/dist/catalyst/p-84693f87.entry.js +0 -24
- package/dist/catalyst/p-84693f87.entry.js.map +0 -1
- package/dist/catalyst/p-8f5cfa78.js +0 -2
- package/dist/catalyst/p-8f5cfa78.js.map +0 -1
- package/dist/catalyst/p-fa7da4c6.js +0 -2
- package/dist/catalyst/p-fa7da4c6.js.map +0 -1
- package/dist/cjs/app-globals-50e7504d.js +0 -180
- package/dist/cjs/app-globals-50e7504d.js.map +0 -1
- package/dist/cjs/cat-alert_15.cjs.entry.js +0 -4652
- package/dist/cjs/cat-alert_15.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-6895750f.js.map +0 -1
- package/dist/cjs/index-2db8e23d.js +0 -1347
- package/dist/cjs/index-2db8e23d.js.map +0 -1
- package/dist/esm/app-globals-6906ac5c.js +0 -178
- package/dist/esm/app-globals-6906ac5c.js.map +0 -1
- package/dist/esm/cat-alert_15.entry.js +0 -4634
- package/dist/esm/cat-alert_15.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-77963c26.js.map +0 -1
- package/dist/esm/index-1f3ca03b.js +0 -1320
- package/dist/esm/index-1f3ca03b.js.map +0 -1
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export { C as CatI18nRegistry } from './cat-i18n-registry-83d20604.js';
|
|
2
|
+
export { C as CatIconRegistry } from './cat-icon-registry-2dcfc9fb.js';
|
|
3
|
+
import './loglevel-7f0f71af.js';
|
|
4
|
+
|
|
2
5
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"file":"index.esm.js","mappings":";;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
2
|
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
function createCommonjsModule(fn, basedir, module) {
|
|
4
8
|
return module = {
|
|
5
9
|
path: basedir,
|
|
6
10
|
exports: {},
|
|
7
11
|
require: function (path, base) {
|
|
8
|
-
return commonjsRequire();
|
|
12
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
9
13
|
}
|
|
10
14
|
}, fn(module, module.exports), module.exports;
|
|
11
15
|
}
|
|
12
16
|
|
|
17
|
+
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
18
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
22
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getAugmentedNamespace(n) {
|
|
26
|
+
if (n.__esModule) return n;
|
|
27
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
28
|
+
Object.keys(n).forEach(function (k) {
|
|
29
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
30
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return n[k];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return a;
|
|
38
|
+
}
|
|
39
|
+
|
|
13
40
|
function commonjsRequire () {
|
|
14
41
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
15
42
|
}
|
|
@@ -22,12 +49,16 @@ var loglevel = createCommonjsModule(function (module) {
|
|
|
22
49
|
* Licensed under the MIT license.
|
|
23
50
|
*/
|
|
24
51
|
(function (root, definition) {
|
|
25
|
-
|
|
52
|
+
"use strict";
|
|
53
|
+
if (typeof undefined === 'function' && undefined.amd) {
|
|
54
|
+
undefined(definition);
|
|
55
|
+
} else if ('object' === 'object' && module.exports) {
|
|
26
56
|
module.exports = definition();
|
|
27
57
|
} else {
|
|
28
58
|
root.log = definition();
|
|
29
59
|
}
|
|
30
60
|
}(commonjsGlobal, function () {
|
|
61
|
+
"use strict";
|
|
31
62
|
|
|
32
63
|
// Slightly dubious tricks to cut down minimized file size
|
|
33
64
|
var noop = function() {};
|
|
@@ -310,128 +341,6 @@ var loglevel = createCommonjsModule(function (module) {
|
|
|
310
341
|
}));
|
|
311
342
|
});
|
|
312
343
|
|
|
313
|
-
|
|
314
|
-
constructor() {
|
|
315
|
-
this.lang = 'en';
|
|
316
|
-
this.messages = new Map();
|
|
317
|
-
// hide constructor
|
|
318
|
-
}
|
|
319
|
-
static getInstance() {
|
|
320
|
-
if (!CatI18nRegistry.instance) {
|
|
321
|
-
CatI18nRegistry.instance = new CatI18nRegistry();
|
|
322
|
-
}
|
|
323
|
-
return CatI18nRegistry.instance;
|
|
324
|
-
}
|
|
325
|
-
getLanguage() {
|
|
326
|
-
return this.lang;
|
|
327
|
-
}
|
|
328
|
-
setLanguage(lang) {
|
|
329
|
-
this.lang = lang;
|
|
330
|
-
}
|
|
331
|
-
getMessage(key) {
|
|
332
|
-
var _a;
|
|
333
|
-
const message = (_a = this.messages.get(this.lang)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
334
|
-
if (!message) {
|
|
335
|
-
loglevel.error(`[CatI18nRegistry] Unknown message for lang ${this.lang}: ${key}`);
|
|
336
|
-
}
|
|
337
|
-
return message;
|
|
338
|
-
}
|
|
339
|
-
addMessage(lang, key, message) {
|
|
340
|
-
this.getDict(lang).set(key, message);
|
|
341
|
-
loglevel.info(`[CatI18nRegistry] Added message for lang ${lang}: ${key}`);
|
|
342
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, key }));
|
|
343
|
-
return this;
|
|
344
|
-
}
|
|
345
|
-
addMessages(lang, i18n) {
|
|
346
|
-
this.messages.set(lang, Object.assign(Object.assign({}, this.getDict(lang)), i18n));
|
|
347
|
-
loglevel.info(`[CatI18nRegistry] Added message for lang ${lang}: ${Object.keys(i18n).concat(', ')}`);
|
|
348
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, keys: Object.keys(i18n) }));
|
|
349
|
-
return this;
|
|
350
|
-
}
|
|
351
|
-
removeMessage(lang, key) {
|
|
352
|
-
this.getDict(lang).delete(key);
|
|
353
|
-
loglevel.info(`[CatI18nRegistry] Removed message for lang ${lang}: ${key}`);
|
|
354
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-removed', { lang, key }));
|
|
355
|
-
return this;
|
|
356
|
-
}
|
|
357
|
-
removeMessages(lang, keys) {
|
|
358
|
-
const dict = this.getDict(lang);
|
|
359
|
-
keys.forEach(key => dict.delete(key));
|
|
360
|
-
loglevel.info(`[CatI18nRegistry] Removed messages for lang ${lang}: ${keys.concat(', ')}`);
|
|
361
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, keys }));
|
|
362
|
-
return this;
|
|
363
|
-
}
|
|
364
|
-
buildEvent(name, detail) {
|
|
365
|
-
return new CustomEvent(name, {
|
|
366
|
-
bubbles: true,
|
|
367
|
-
composed: true,
|
|
368
|
-
detail
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
getDict(lang) {
|
|
372
|
-
let messages = this.messages.get(lang);
|
|
373
|
-
if (!messages) {
|
|
374
|
-
messages = new Map();
|
|
375
|
-
this.messages.set(lang, messages);
|
|
376
|
-
}
|
|
377
|
-
return messages;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
class CatIconRegistry {
|
|
382
|
-
constructor() {
|
|
383
|
-
this.icons = new Map();
|
|
384
|
-
// hide constructor
|
|
385
|
-
}
|
|
386
|
-
static getInstance() {
|
|
387
|
-
if (!CatIconRegistry.instance) {
|
|
388
|
-
CatIconRegistry.instance = new CatIconRegistry();
|
|
389
|
-
}
|
|
390
|
-
return CatIconRegistry.instance;
|
|
391
|
-
}
|
|
392
|
-
getIcon(name, setName) {
|
|
393
|
-
const icon = this.icons.get(this.buildName(name, setName));
|
|
394
|
-
if (!icon) {
|
|
395
|
-
loglevel.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);
|
|
396
|
-
}
|
|
397
|
-
return icon;
|
|
398
|
-
}
|
|
399
|
-
addIcon(name, data, setName) {
|
|
400
|
-
this.icons.set(this.buildName(name, setName), data);
|
|
401
|
-
loglevel.info(`[CatIconRegistry] Added icon${setName ? ` to set ${setName}` : ''}: ${name}`);
|
|
402
|
-
window.dispatchEvent(this.buildEvent('cat-icon-added', { name, setName }));
|
|
403
|
-
return this;
|
|
404
|
-
}
|
|
405
|
-
addIcons(icons, setName) {
|
|
406
|
-
Object.entries(icons).forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));
|
|
407
|
-
loglevel.info(`[CatIconRegistry] Added icons${setName ? ` to set ${setName}` : ''}: ${Object.keys(icons).concat(', ')}`);
|
|
408
|
-
window.dispatchEvent(this.buildEvent('cat-icons-added', { names: Object.keys(icons), setName }));
|
|
409
|
-
return this;
|
|
410
|
-
}
|
|
411
|
-
removeIcon(name, setName) {
|
|
412
|
-
this.icons.delete(this.buildName(name, setName));
|
|
413
|
-
loglevel.info(`[CatIconRegistry] Removed icon${setName ? ` from set ${setName}` : ''}: ${name}`);
|
|
414
|
-
window.dispatchEvent(this.buildEvent('cat-icon-removed', { name, setName }));
|
|
415
|
-
return this;
|
|
416
|
-
}
|
|
417
|
-
removeIcons(names, setName) {
|
|
418
|
-
names.forEach(name => this.icons.delete(this.buildName(name, setName)));
|
|
419
|
-
loglevel.info(`[CatIconRegistry] Removed icons${setName ? ` from set ${setName}` : ''}: ${names.concat(', ')}`);
|
|
420
|
-
window.dispatchEvent(this.buildEvent('cat-icons-removed', { names, setName }));
|
|
421
|
-
return this;
|
|
422
|
-
}
|
|
423
|
-
buildName(name, setName) {
|
|
424
|
-
return setName ? `${setName}:name` : name;
|
|
425
|
-
}
|
|
426
|
-
buildEvent(name, detail) {
|
|
427
|
-
return new CustomEvent(name, {
|
|
428
|
-
bubbles: true,
|
|
429
|
-
composed: true,
|
|
430
|
-
detail
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
export { CatIconRegistry as C, CatI18nRegistry as a, loglevel as l };
|
|
344
|
+
export { loglevel as l };
|
|
436
345
|
|
|
437
|
-
//# sourceMappingURL=
|
|
346
|
+
//# sourceMappingURL=loglevel-7f0f71af.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"loglevel-7f0f71af.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE;AAC7B,IAAI,YAAY,CAAC;AACjB,IAAI,IAAI,OAAOA,SAAM,KAAK,UAAU,IAAIA,SAAM,CAAC,GAAG,EAAE;AACpD,QAAQA,SAAM,CAAC,UAAU,CAAC,CAAC;AAC3B,KAAK,MAAM,IAAI,QAAa,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE;AAC7D,QAAQ,cAAc,GAAG,UAAU,EAAE,CAAC;AACtC,KAAK,MAAM;AACX,QAAQ,IAAI,CAAC,GAAG,GAAG,UAAU,EAAE,CAAC;AAChC,KAAK;AACL,CAAC,CAACC,cAAI,EAAE,YAAY;AACpB,IAAI,YAAY,CAAC;AACjB;AACA;AACA,IAAI,IAAI,IAAI,GAAG,WAAW,EAAE,CAAC;AAC7B,IAAI,IAAI,aAAa,GAAG,WAAW,CAAC;AACpC,IAAI,IAAI,IAAI,GAAG,CAAC,OAAO,MAAM,KAAK,aAAa,MAAM,OAAO,MAAM,CAAC,SAAS,KAAK,aAAa,CAAC;AAC/F,QAAQ,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC;AAC1D,KAAK,CAAC;AACN;AACA,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO;AACf,QAAQ,OAAO;AACf,QAAQ,MAAM;AACd,QAAQ,MAAM;AACd,QAAQ,OAAO;AACf,KAAK,CAAC;AACN;AACA;AACA,IAAI,SAA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aAAa,CAAC,UAAU,GAAG,SAAS,UAAU,GAAG;AACrD,QAAQ,OAAO,cAAc,CAAC;AAC9B,KAAK,CAAC;AACN;AACA;AACA,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC;AAC7C;AACA,IAAI,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC;;;;;","names":["define","this"],"sources":["./node_modules/loglevel/lib/loglevel.js"],"sourcesContent":["/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n"],"version":3}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Stencil Client Platform v2.15.0 | MIT Licensed | https://stenciljs.com
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
9
|
+
* found in the LICENSE file at https://angular.io/license
|
|
10
|
+
*
|
|
11
|
+
* This file is a port of shadowCSS from webcomponents.js to TypeScript.
|
|
12
|
+
* https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
|
|
13
|
+
* https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
|
|
14
|
+
*/
|
|
15
|
+
const safeSelector = (selector) => {
|
|
16
|
+
const placeholders = [];
|
|
17
|
+
let index = 0;
|
|
18
|
+
let content;
|
|
19
|
+
// Replaces attribute selectors with placeholders.
|
|
20
|
+
// The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
|
|
21
|
+
selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
|
|
22
|
+
const replaceBy = `__ph-${index}__`;
|
|
23
|
+
placeholders.push(keep);
|
|
24
|
+
index++;
|
|
25
|
+
return replaceBy;
|
|
26
|
+
});
|
|
27
|
+
// Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
|
|
28
|
+
// WS and "+" would otherwise be interpreted as selector separators.
|
|
29
|
+
content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
|
|
30
|
+
const replaceBy = `__ph-${index}__`;
|
|
31
|
+
placeholders.push(exp);
|
|
32
|
+
index++;
|
|
33
|
+
return pseudo + replaceBy;
|
|
34
|
+
});
|
|
35
|
+
const ss = {
|
|
36
|
+
content,
|
|
37
|
+
placeholders,
|
|
38
|
+
};
|
|
39
|
+
return ss;
|
|
40
|
+
};
|
|
41
|
+
const restoreSafeSelector = (placeholders, content) => {
|
|
42
|
+
return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
|
|
43
|
+
};
|
|
44
|
+
const _polyfillHost = '-shadowcsshost';
|
|
45
|
+
const _polyfillSlotted = '-shadowcssslotted';
|
|
46
|
+
// note: :host-context pre-processed to -shadowcsshostcontext.
|
|
47
|
+
const _polyfillHostContext = '-shadowcsscontext';
|
|
48
|
+
const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
|
|
49
|
+
const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
|
|
50
|
+
const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
|
|
51
|
+
const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
|
|
52
|
+
const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
|
|
53
|
+
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
54
|
+
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
55
|
+
const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
|
|
56
|
+
const _polyfillHostRe = /-shadowcsshost/gim;
|
|
57
|
+
const _colonHostRe = /:host/gim;
|
|
58
|
+
const _colonSlottedRe = /::slotted/gim;
|
|
59
|
+
const _colonHostContextRe = /:host-context/gim;
|
|
60
|
+
const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
|
|
61
|
+
const stripComments = (input) => {
|
|
62
|
+
return input.replace(_commentRe, '');
|
|
63
|
+
};
|
|
64
|
+
const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
|
|
65
|
+
const extractCommentsWithHash = (input) => {
|
|
66
|
+
return input.match(_commentWithHashRe) || [];
|
|
67
|
+
};
|
|
68
|
+
const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
|
69
|
+
const _curlyRe = /([{}])/g;
|
|
70
|
+
const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
|
|
71
|
+
const OPEN_CURLY = '{';
|
|
72
|
+
const CLOSE_CURLY = '}';
|
|
73
|
+
const BLOCK_PLACEHOLDER = '%BLOCK%';
|
|
74
|
+
const processRules = (input, ruleCallback) => {
|
|
75
|
+
const inputWithEscapedBlocks = escapeBlocks(input);
|
|
76
|
+
let nextBlockIndex = 0;
|
|
77
|
+
return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
|
|
78
|
+
const selector = m[2];
|
|
79
|
+
let content = '';
|
|
80
|
+
let suffix = m[4];
|
|
81
|
+
let contentPrefix = '';
|
|
82
|
+
if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
|
|
83
|
+
content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
|
|
84
|
+
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
|
|
85
|
+
contentPrefix = '{';
|
|
86
|
+
}
|
|
87
|
+
const cssRule = {
|
|
88
|
+
selector,
|
|
89
|
+
content,
|
|
90
|
+
};
|
|
91
|
+
const rule = ruleCallback(cssRule);
|
|
92
|
+
return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const escapeBlocks = (input) => {
|
|
96
|
+
const inputParts = input.split(_curlyRe);
|
|
97
|
+
const resultParts = [];
|
|
98
|
+
const escapedBlocks = [];
|
|
99
|
+
let bracketCount = 0;
|
|
100
|
+
let currentBlockParts = [];
|
|
101
|
+
for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
|
|
102
|
+
const part = inputParts[partIndex];
|
|
103
|
+
if (part === CLOSE_CURLY) {
|
|
104
|
+
bracketCount--;
|
|
105
|
+
}
|
|
106
|
+
if (bracketCount > 0) {
|
|
107
|
+
currentBlockParts.push(part);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (currentBlockParts.length > 0) {
|
|
111
|
+
escapedBlocks.push(currentBlockParts.join(''));
|
|
112
|
+
resultParts.push(BLOCK_PLACEHOLDER);
|
|
113
|
+
currentBlockParts = [];
|
|
114
|
+
}
|
|
115
|
+
resultParts.push(part);
|
|
116
|
+
}
|
|
117
|
+
if (part === OPEN_CURLY) {
|
|
118
|
+
bracketCount++;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (currentBlockParts.length > 0) {
|
|
122
|
+
escapedBlocks.push(currentBlockParts.join(''));
|
|
123
|
+
resultParts.push(BLOCK_PLACEHOLDER);
|
|
124
|
+
}
|
|
125
|
+
const strEscapedBlocks = {
|
|
126
|
+
escapedString: resultParts.join(''),
|
|
127
|
+
blocks: escapedBlocks,
|
|
128
|
+
};
|
|
129
|
+
return strEscapedBlocks;
|
|
130
|
+
};
|
|
131
|
+
const insertPolyfillHostInCssText = (selector) => {
|
|
132
|
+
selector = selector
|
|
133
|
+
.replace(_colonHostContextRe, _polyfillHostContext)
|
|
134
|
+
.replace(_colonHostRe, _polyfillHost)
|
|
135
|
+
.replace(_colonSlottedRe, _polyfillSlotted);
|
|
136
|
+
return selector;
|
|
137
|
+
};
|
|
138
|
+
const convertColonRule = (cssText, regExp, partReplacer) => {
|
|
139
|
+
// m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
|
|
140
|
+
return cssText.replace(regExp, (...m) => {
|
|
141
|
+
if (m[2]) {
|
|
142
|
+
const parts = m[2].split(',');
|
|
143
|
+
const r = [];
|
|
144
|
+
for (let i = 0; i < parts.length; i++) {
|
|
145
|
+
const p = parts[i].trim();
|
|
146
|
+
if (!p)
|
|
147
|
+
break;
|
|
148
|
+
r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
|
|
149
|
+
}
|
|
150
|
+
return r.join(',');
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
return _polyfillHostNoCombinator + m[3];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
const colonHostPartReplacer = (host, part, suffix) => {
|
|
158
|
+
return host + part.replace(_polyfillHost, '') + suffix;
|
|
159
|
+
};
|
|
160
|
+
const convertColonHost = (cssText) => {
|
|
161
|
+
return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
|
|
162
|
+
};
|
|
163
|
+
const colonHostContextPartReplacer = (host, part, suffix) => {
|
|
164
|
+
if (part.indexOf(_polyfillHost) > -1) {
|
|
165
|
+
return colonHostPartReplacer(host, part, suffix);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return host + part + suffix + ', ' + part + ' ' + host + suffix;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const convertColonSlotted = (cssText, slotScopeId) => {
|
|
172
|
+
const slotClass = '.' + slotScopeId + ' > ';
|
|
173
|
+
const selectors = [];
|
|
174
|
+
cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
|
|
175
|
+
if (m[2]) {
|
|
176
|
+
const compound = m[2].trim();
|
|
177
|
+
const suffix = m[3];
|
|
178
|
+
const slottedSelector = slotClass + compound + suffix;
|
|
179
|
+
let prefixSelector = '';
|
|
180
|
+
for (let i = m[4] - 1; i >= 0; i--) {
|
|
181
|
+
const char = m[5][i];
|
|
182
|
+
if (char === '}' || char === ',') {
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
prefixSelector = char + prefixSelector;
|
|
186
|
+
}
|
|
187
|
+
const orgSelector = prefixSelector + slottedSelector;
|
|
188
|
+
const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
|
|
189
|
+
if (orgSelector.trim() !== addedSelector.trim()) {
|
|
190
|
+
const updatedSelector = `${addedSelector}, ${orgSelector}`;
|
|
191
|
+
selectors.push({
|
|
192
|
+
orgSelector,
|
|
193
|
+
updatedSelector,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return slottedSelector;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
return _polyfillHostNoCombinator + m[3];
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
return {
|
|
203
|
+
selectors,
|
|
204
|
+
cssText,
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
const convertColonHostContext = (cssText) => {
|
|
208
|
+
return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
|
|
209
|
+
};
|
|
210
|
+
const convertShadowDOMSelectors = (cssText) => {
|
|
211
|
+
return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
|
|
212
|
+
};
|
|
213
|
+
const makeScopeMatcher = (scopeSelector) => {
|
|
214
|
+
const lre = /\[/g;
|
|
215
|
+
const rre = /\]/g;
|
|
216
|
+
scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
|
|
217
|
+
return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
|
|
218
|
+
};
|
|
219
|
+
const selectorNeedsScoping = (selector, scopeSelector) => {
|
|
220
|
+
const re = makeScopeMatcher(scopeSelector);
|
|
221
|
+
return !re.test(selector);
|
|
222
|
+
};
|
|
223
|
+
const injectScopingSelector = (selector, scopingSelector) => {
|
|
224
|
+
return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
|
|
225
|
+
return before + scopingSelector + colon + after;
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
|
|
229
|
+
// In Android browser, the lastIndex is not reset when the regex is used in String.replace()
|
|
230
|
+
_polyfillHostRe.lastIndex = 0;
|
|
231
|
+
if (_polyfillHostRe.test(selector)) {
|
|
232
|
+
const replaceBy = `.${hostSelector}`;
|
|
233
|
+
return selector
|
|
234
|
+
.replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
|
|
235
|
+
.replace(_polyfillHostRe, replaceBy + ' ');
|
|
236
|
+
}
|
|
237
|
+
return scopeSelector + ' ' + selector;
|
|
238
|
+
};
|
|
239
|
+
const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
|
|
240
|
+
const isRe = /\[is=([^\]]*)\]/g;
|
|
241
|
+
scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
|
|
242
|
+
const className = '.' + scopeSelector;
|
|
243
|
+
const _scopeSelectorPart = (p) => {
|
|
244
|
+
let scopedP = p.trim();
|
|
245
|
+
if (!scopedP) {
|
|
246
|
+
return '';
|
|
247
|
+
}
|
|
248
|
+
if (p.indexOf(_polyfillHostNoCombinator) > -1) {
|
|
249
|
+
scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
// remove :host since it should be unnecessary
|
|
253
|
+
const t = p.replace(_polyfillHostRe, '');
|
|
254
|
+
if (t.length > 0) {
|
|
255
|
+
scopedP = injectScopingSelector(t, className);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return scopedP;
|
|
259
|
+
};
|
|
260
|
+
const safeContent = safeSelector(selector);
|
|
261
|
+
selector = safeContent.content;
|
|
262
|
+
let scopedSelector = '';
|
|
263
|
+
let startIndex = 0;
|
|
264
|
+
let res;
|
|
265
|
+
const sep = /( |>|\+|~(?!=))\s*/g;
|
|
266
|
+
// If a selector appears before :host it should not be shimmed as it
|
|
267
|
+
// matches on ancestor elements and not on elements in the host's shadow
|
|
268
|
+
// `:host-context(div)` is transformed to
|
|
269
|
+
// `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
|
|
270
|
+
// the `div` is not part of the component in the 2nd selectors and should not be scoped.
|
|
271
|
+
// Historically `component-tag:host` was matching the component so we also want to preserve
|
|
272
|
+
// this behavior to avoid breaking legacy apps (it should not match).
|
|
273
|
+
// The behavior should be:
|
|
274
|
+
// - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
|
|
275
|
+
// - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
|
|
276
|
+
// `:host-context(tag)`)
|
|
277
|
+
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
|
278
|
+
// Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
|
|
279
|
+
let shouldScope = !hasHost;
|
|
280
|
+
while ((res = sep.exec(selector)) !== null) {
|
|
281
|
+
const separator = res[1];
|
|
282
|
+
const part = selector.slice(startIndex, res.index).trim();
|
|
283
|
+
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
|
284
|
+
const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
|
|
285
|
+
scopedSelector += `${scopedPart} ${separator} `;
|
|
286
|
+
startIndex = sep.lastIndex;
|
|
287
|
+
}
|
|
288
|
+
const part = selector.substring(startIndex);
|
|
289
|
+
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
|
290
|
+
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
|
|
291
|
+
// replace the placeholders with their original values
|
|
292
|
+
return restoreSafeSelector(safeContent.placeholders, scopedSelector);
|
|
293
|
+
};
|
|
294
|
+
const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
|
|
295
|
+
return selector
|
|
296
|
+
.split(',')
|
|
297
|
+
.map((shallowPart) => {
|
|
298
|
+
if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
|
|
299
|
+
return shallowPart.trim();
|
|
300
|
+
}
|
|
301
|
+
if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
|
|
302
|
+
return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
return shallowPart.trim();
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
.join(', ');
|
|
309
|
+
};
|
|
310
|
+
const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
|
|
311
|
+
return processRules(cssText, (rule) => {
|
|
312
|
+
let selector = rule.selector;
|
|
313
|
+
let content = rule.content;
|
|
314
|
+
if (rule.selector[0] !== '@') {
|
|
315
|
+
selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
|
|
316
|
+
}
|
|
317
|
+
else if (rule.selector.startsWith('@media') ||
|
|
318
|
+
rule.selector.startsWith('@supports') ||
|
|
319
|
+
rule.selector.startsWith('@page') ||
|
|
320
|
+
rule.selector.startsWith('@document')) {
|
|
321
|
+
content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
|
|
322
|
+
}
|
|
323
|
+
const cssRule = {
|
|
324
|
+
selector: selector.replace(/\s{2,}/g, ' ').trim(),
|
|
325
|
+
content,
|
|
326
|
+
};
|
|
327
|
+
return cssRule;
|
|
328
|
+
});
|
|
329
|
+
};
|
|
330
|
+
const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
|
|
331
|
+
cssText = insertPolyfillHostInCssText(cssText);
|
|
332
|
+
cssText = convertColonHost(cssText);
|
|
333
|
+
cssText = convertColonHostContext(cssText);
|
|
334
|
+
const slotted = convertColonSlotted(cssText, slotScopeId);
|
|
335
|
+
cssText = slotted.cssText;
|
|
336
|
+
cssText = convertShadowDOMSelectors(cssText);
|
|
337
|
+
if (scopeId) {
|
|
338
|
+
cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
|
|
339
|
+
}
|
|
340
|
+
cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
|
|
341
|
+
cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
|
|
342
|
+
return {
|
|
343
|
+
cssText: cssText.trim(),
|
|
344
|
+
slottedSelectors: slotted.selectors,
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
|
348
|
+
const hostScopeId = scopeId + '-h';
|
|
349
|
+
const slotScopeId = scopeId + '-s';
|
|
350
|
+
const commentsWithHash = extractCommentsWithHash(cssText);
|
|
351
|
+
cssText = stripComments(cssText);
|
|
352
|
+
const orgSelectors = [];
|
|
353
|
+
if (commentOriginalSelector) {
|
|
354
|
+
const processCommentedSelector = (rule) => {
|
|
355
|
+
const placeholder = `/*!@___${orgSelectors.length}___*/`;
|
|
356
|
+
const comment = `/*!@${rule.selector}*/`;
|
|
357
|
+
orgSelectors.push({ placeholder, comment });
|
|
358
|
+
rule.selector = placeholder + rule.selector;
|
|
359
|
+
return rule;
|
|
360
|
+
};
|
|
361
|
+
cssText = processRules(cssText, (rule) => {
|
|
362
|
+
if (rule.selector[0] !== '@') {
|
|
363
|
+
return processCommentedSelector(rule);
|
|
364
|
+
}
|
|
365
|
+
else if (rule.selector.startsWith('@media') ||
|
|
366
|
+
rule.selector.startsWith('@supports') ||
|
|
367
|
+
rule.selector.startsWith('@page') ||
|
|
368
|
+
rule.selector.startsWith('@document')) {
|
|
369
|
+
rule.content = processRules(rule.content, processCommentedSelector);
|
|
370
|
+
return rule;
|
|
371
|
+
}
|
|
372
|
+
return rule;
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
|
|
376
|
+
cssText = [scoped.cssText, ...commentsWithHash].join('\n');
|
|
377
|
+
if (commentOriginalSelector) {
|
|
378
|
+
orgSelectors.forEach(({ placeholder, comment }) => {
|
|
379
|
+
cssText = cssText.replace(placeholder, comment);
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
scoped.slottedSelectors.forEach((slottedSelector) => {
|
|
383
|
+
cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
|
|
384
|
+
});
|
|
385
|
+
return cssText;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
export { scopeCss };
|
|
389
|
+
|
|
390
|
+
//# sourceMappingURL=shadow-css-4d56fa31.js.map
|