@haiilo/catalyst 2.4.7 → 2.4.9
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/catalyst.esm.js +1 -1
- package/dist/catalyst/index.esm.js +1 -1
- package/dist/catalyst/p-602c38be.entry.js +2 -0
- package/dist/catalyst/p-602c38be.entry.js.map +1 -0
- package/dist/catalyst/p-ccfebe33.js +2 -0
- package/dist/catalyst/p-ccfebe33.js.map +1 -0
- package/dist/cjs/cat-alert_23.cjs.entry.js +2 -3
- package/dist/cjs/cat-alert_23.cjs.entry.js.map +1 -1
- package/dist/cjs/{cat-icon-registry-32ed379a.js → cat-icon-registry-671af264.js} +60 -32
- package/dist/cjs/cat-icon-registry-671af264.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +28 -7
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +31 -24
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +2 -3
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +28 -7
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon2.js +32 -26
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/esm/cat-alert_23.entry.js +2 -3
- package/dist/esm/cat-alert_23.entry.js.map +1 -1
- package/dist/esm/{cat-icon-registry-7c4007ff.js → cat-icon-registry-d6b80490.js} +60 -32
- package/dist/esm/cat-icon-registry-d6b80490.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +3 -2
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +3 -5
- package/dist/types/components/cat-icon/cat-icon.d.ts +0 -1
- package/package.json +2 -2
- package/dist/catalyst/p-5362e648.js +0 -2
- package/dist/catalyst/p-5362e648.js.map +0 -1
- package/dist/catalyst/p-c2bf7e26.entry.js +0 -2
- package/dist/catalyst/p-c2bf7e26.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-32ed379a.js.map +0 -1
- package/dist/esm/cat-icon-registry-7c4007ff.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var n=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function e(n,e,i){return i={path:e,exports:{},require:function(n,e){return t()}},n(i,i.exports),i.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=e((function(e){(function(n,t){if(e.exports){e.exports=t()}else{n.log=t()}})(n,(function(){var n=function(){};var e="undefined";var t=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent);var i=["trace","debug","info","warn","error"];function o(n,e){var t=n[e];if(typeof t.bind==="function"){return t.bind(n)}else{try{return Function.prototype.bind.call(t,n)}catch(e){return function(){return Function.prototype.apply.apply(t,[n,arguments])}}}}function r(){if(console.log){if(console.log.apply){console.log.apply(console,arguments)}else{Function.prototype.apply.apply(console.log,[console,arguments])}}if(console.trace)console.trace()}function s(i){if(i==="debug"){i="log"}if(typeof console===e){return false}else if(i==="trace"&&t){return r}else if(console[i]!==undefined){return o(console,i)}else if(console.log!==undefined){return o(console,"log")}else{return n}}function c(e,t){for(var o=0;o<i.length;o++){var r=i[o];this[r]=o<e?n:this.methodFactory(r,e,t)}this.log=this.debug}function f(n,t,i){return function(){if(typeof console!==e){c.call(this,t,i);this[n].apply(this,arguments)}}}function u(n,e,t){return s(n)||f.apply(this,arguments)}function a(n,t,o){var r=this;var s;t=t==null?"WARN":t;var f="loglevel";if(typeof n==="string"){f+=":"+n}else if(typeof n==="symbol"){f=undefined}function a(n){var t=(i[n]||"silent").toUpperCase();if(typeof window===e||!f)return;try{window.localStorage[f]=t;return}catch(n){}try{window.document.cookie=encodeURIComponent(f)+"="+t+";"}catch(n){}}function d(){var n;if(typeof window===e||!f)return;try{n=window.localStorage[f]}catch(n){}if(typeof n===e){try{var t=window.document.cookie;var i=t.indexOf(encodeURIComponent(f)+"=");if(i!==-1){n=/^([^;]+)/.exec(t.slice(i))[1]}}catch(n){}}if(r.levels[n]===undefined){n=undefined}return n}function l(){if(typeof window===e||!f)return;try{window.localStorage.removeItem(f);return}catch(n){}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(n){}}r.name=n;r.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5};r.methodFactory=o||u;r.getLevel=function(){return s};r.setLevel=function(t,i){if(typeof t==="string"&&r.levels[t.toUpperCase()]!==undefined){t=r.levels[t.toUpperCase()]}if(typeof t==="number"&&t>=0&&t<=r.levels.SILENT){s=t;if(i!==false){a(t)}c.call(r,t,n);if(typeof console===e&&t<r.levels.SILENT){return"No console available for logging"}}else{throw"log.setLevel() called with invalid level: "+t}};r.setDefaultLevel=function(n){t=n;if(!d()){r.setLevel(n,false)}};r.resetLevel=function(){r.setLevel(t,false);l()};r.enableAll=function(n){r.setLevel(r.levels.TRACE,n)};r.disableAll=function(n){r.setLevel(r.levels.SILENT,n)};var w=d();if(w==null){w=t}r.setLevel(w,false)}var d=new a;var l={};d.getLogger=function n(e){if(typeof e!=="symbol"&&typeof e!=="string"||e===""){throw new TypeError("You must supply a name when creating a logger.")}var t=l[e];if(!t){t=l[e]=new a(e,d.getLevel(),d.methodFactory)}return t};var w=typeof window!==e?window.log:undefined;d.noConflict=function(){if(typeof window!==e&&window.log===d){window.log=w}return d};d.getLoggers=function n(){return l};d["default"]=d;return d}))}));class o{constructor(){this.id=(Math.random()+1).toString(36).substring(2);this.i18n=new Map;window.addEventListener("cat-i18n-set",(n=>{const{detail:e}=n||{};if(e&&e.id!==this.id){this.set(e.i18n,true)}}));window.addEventListener("cat-i18n-clear",(n=>{const{detail:e}=n||{};if(e&&e.id!==this.id){this.clear(true)}}))}static getInstance(){if(!o.instance){o.instance=new o}return o.instance}set(n,e=false){const t=Object.entries(n);t.forEach((([n,e])=>this.i18n.set(n,e)));i.info(`[CatI18nRegistry] Registered ${t.length!==1?"messages":"message"}`);!e&&window.dispatchEvent(this.buildEvent("cat-i18n-set",{i18n:n,id:this.id}))}clear(n=false){this.i18n.clear();i.info(`[CatI18nRegistry] Cleared messages`);!n&&window.dispatchEvent(this.buildEvent("cat-i18n-clear"))}t(n,e){const t=this.i18n.get(n);if(t===undefined){i.error(`[CatI18nRegistry] Unknown message key: ${n}`);return n}return t.replace(/{{\s*([-a-zA-Z._]+)\s*}}/g,((n,t)=>{var i;return`${(i=e===null||e===void 0?void 0:e[t])!==null&&i!==void 0?i:""}`}))}buildEvent(n,e){return new CustomEvent(n,{bubbles:true,composed:true,detail:e})}}const r=o.getInstance();class s{constructor(){this.id=(Math.random()+1).toString(36).substring(2);this.icons=new Map;window.addEventListener("cat-icons-added",(n=>{const{detail:e}=n||{};if(e&&e.id!==this.id){this.addIcons(e.icons,e.setName,true)}}));window.addEventListener("cat-icons-removed",(n=>{const{detail:e}=n||{};if(e&&e.id!==this.id){this.removeIcons(e.names,e.setName,true)}}))}static getInstance(){if(!s.instance){s.instance=new s}return s.instance}getIcon(n,e){const t=this.icons.get(this.buildName(n,e));if(!t){i.error(`[CatIconRegistry] Unknown icon${e?` in set ${e}`:""}: ${n}`)}return t}addIcons(n,e,t=false){const o=Object.entries(n);const r=o.length;o.forEach((([n,t])=>this.icons.set(this.buildName(n,e),t)));i.info(`[CatIconRegistry] Added ${r!==1?"icons":"icon"}${e?` to set ${e}`:""}`);!t&&window.dispatchEvent(this.buildEvent("cat-icons-added",{id:this.id,icons:n,setName:e}));return this}removeIcons(n,e,t=false){const o=n.length;n.forEach((n=>this.icons.delete(this.buildName(n,e))));i.info(`[CatIconRegistry] Removed ${o!==1?"icons":"icon"}${e?` from set ${e}`:""}`);!t&&window.dispatchEvent(this.buildEvent("cat-icons-removed",{id:this.id,names:n,setName:e}));return this}buildName(n,e){return e?`${e}:name`:n}buildEvent(n,e){return new CustomEvent(n,{bubbles:true,composed:true,detail:e})}}const c=s.getInstance();export{o as C,n as a,r as b,e as c,c as d,s as e,i as l};
|
|
2
|
+
//# sourceMappingURL=p-ccfebe33.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/loglevel/lib/loglevel.js","src/components/cat-i18n/cat-i18n-registry.ts","src/components/cat-icon/cat-icon-registry.ts"],"names":["root","definition","module","exports","log","this","noop","undefinedType","isIE","window","navigator","test","userAgent","logMethods","bindMethod","obj","methodName","method","bind","Function","prototype","call","e","apply","arguments","traceForIE","console","trace","realMethod","undefined","replaceLoggingMethods","level","loggerName","i","length","methodFactory","debug","enableLoggingWhenConsoleArrives","defaultMethodFactory","Logger","name","defaultLevel","factory","self","currentLevel","storageKey","persistLevelIfPossible","levelNum","levelName","toUpperCase","localStorage","ignore","document","cookie","encodeURIComponent","getPersistedLevel","storedLevel","location","indexOf","exec","slice","levels","clearPersistedLevel","removeItem","TRACE","DEBUG","INFO","WARN","ERROR","SILENT","getLevel","setLevel","persist","setDefaultLevel","resetLevel","enableAll","disableAll","initialLevel","defaultLogger","_loggersByName","getLogger","TypeError","logger","_log","noConflict","getLoggers","CatI18nRegistry","[object Object]","id","Math","random","toString","substring","i18n","Map","addEventListener","event","detail","set","clear","instance","silent","i18nEntries","Object","entries","forEach","key","message","info","dispatchEvent","buildEvent","params","get","error","replace","_match","_a","CustomEvent","bubbles","composed","catI18nRegistry","getInstance","CatIconRegistry","icons","addIcons","setName","removeIcons","names","icon","buildName","iconEntries","iconSize","data","delete","catIconRegistry"],"mappings":"iYAMC,SAAUA,EAAMC,GAIN,GAAkCC,EAAOC,QAAS,CACrDD,EAAAC,QAAiBF,QACd,CACHD,EAAKI,IAAMH,MAPnB,CASEI,GAAM,WAIJ,IAAIC,EAAO,aACX,IAAIC,E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AQmB,GACnC,MAAMQ,EAAWD,EAAYhG,OAC7BgG,EAAYzB,SAAQ,EAAEjE,EAAM4F,KAAU/H,KAAKsH,MAAMzB,IAAI7F,KAAK4H,UAAUzF,EAAMqF,GAAUO,KACpFhI,EAAIwG,KAAK,2BAA2BuB,IAAa,EAAI,QAAU,SAASN,EAAU,WAAWA,IAAY,OACxGxB,GAAU5F,OAAOoG,cAAcxG,KAAKyG,WAAW,kBAAmB,CAAEtB,GAAInF,KAAKmF,GAAImC,MAAAA,EAAOE,QAAAA,KACzF,OAAOxH,KAGTkF,YAAYwC,EAAiBF,EAAkBxB,EAAS,OACtD,MAAM8B,EAAWJ,EAAM7F,OACvB6F,EAAMtB,SAAQjE,GAAQnC,KAAKsH,MAAMU,OAAOhI,KAAK4H,UAAUzF,EAAMqF,MAC7DzH,EAAIwG,KAAK,6BAA6BuB,IAAa,EAAI,QAAU,SAASN,EAAU,aAAaA,IAAY,OAC5GxB,GAAU5F,OAAOoG,cAAcxG,KAAKyG,WAAW,oBAAqB,CAAEtB,GAAInF,KAAKmF,GAAIuC,MAAAA,EAAOF,QAAAA,KAC3F,OAAOxH,KAGDkF,UAAU/C,EAAcqF,GAC9B,OAAOA,EAAU,GAAGA,SAAiBrF,EAG/B+C,WAAc/C,EAAcyD,GAClC,OAAO,IAAIoB,YAAY7E,EAAM,CAC3B8E,QAAS,KACTC,SAAU,KACVtB,OAAAA,WAKOqC,EAAkBZ,EAAgBD","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","import log from 'loglevel';\n\nexport class CatI18nRegistry {\n private static instance: CatI18nRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly i18n: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when messages are added or removed in other\n // applications and add or remove messages if the event was not dispatched\n // by this registry.\n window.addEventListener('cat-i18n-set', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.set(detail.i18n, true);\n }\n });\n window.addEventListener('cat-i18n-clear', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.clear(true);\n }\n });\n }\n\n static getInstance(): CatI18nRegistry {\n if (!CatI18nRegistry.instance) {\n CatI18nRegistry.instance = new CatI18nRegistry();\n }\n return CatI18nRegistry.instance;\n }\n\n set(i18n: { [key: string]: string }, silent = false): void {\n const i18nEntries = Object.entries(i18n);\n i18nEntries.forEach(([key, message]) => this.i18n.set(key, message));\n log.info(`[CatI18nRegistry] Registered ${i18nEntries.length !== 1 ? 'messages' : 'message'}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-i18n-set', { i18n, id: this.id }));\n }\n\n clear(silent = false): void {\n this.i18n.clear();\n log.info(`[CatI18nRegistry] Cleared messages`);\n !silent && window.dispatchEvent(this.buildEvent('cat-i18n-clear'));\n }\n\n t(key: string, params?: { [key: string]: string | number }): string {\n const message = this.i18n.get(key);\n if (message === undefined) {\n log.error(`[CatI18nRegistry] Unknown message key: ${key}`);\n return key;\n }\n return message.replace(/{{\\s*([-a-zA-Z._]+)\\s*}}/g, (_match, key) => `${params?.[key] ?? ''}`);\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catI18nRegistry = CatI18nRegistry.getInstance();\n","import log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly icons: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when icons are added or removed in other\n // applications and add or remove icons if the event was not dispatched by\n // this registry.\n window.addEventListener('cat-icons-added', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.addIcons(detail.icons, detail.setName, true);\n }\n });\n window.addEventListener('cat-icons-removed', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.removeIcons(detail.names, detail.setName, true);\n }\n });\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string, silent = false): CatIconRegistry {\n const iconEntries = Object.entries(icons);\n const iconSize = iconEntries.length;\n iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(`[CatIconRegistry] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string, silent = false): CatIconRegistry {\n const iconSize = names.length;\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(`[CatIconRegistry] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` from set ${setName}` : ''}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:name` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catIconRegistry = CatIconRegistry.getInstance();\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e540e911.js');
|
|
6
|
-
const catIconRegistry = require('./cat-icon-registry-
|
|
6
|
+
const catIconRegistry = require('./cat-icon-registry-671af264.js');
|
|
7
7
|
const firstTabbable = require('./first-tabbable-7966cf1c.js');
|
|
8
8
|
|
|
9
9
|
function setAttributeDefault(host, attr, value) {
|
|
@@ -1892,7 +1892,6 @@ const catIconCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user
|
|
|
1892
1892
|
const CatIcon = class {
|
|
1893
1893
|
constructor(hostRef) {
|
|
1894
1894
|
index.registerInstance(this, hostRef);
|
|
1895
|
-
this.iconRegistry = catIconRegistry.CatIconRegistry.getInstance();
|
|
1896
1895
|
/**
|
|
1897
1896
|
* The name of the icon.
|
|
1898
1897
|
*/
|
|
@@ -1903,7 +1902,7 @@ const CatIcon = class {
|
|
|
1903
1902
|
this.size = 'm';
|
|
1904
1903
|
}
|
|
1905
1904
|
render() {
|
|
1906
|
-
return (index.h("span", { innerHTML:
|
|
1905
|
+
return (index.h("span", { innerHTML: catIconRegistry.catIconRegistry.getIcon(this.icon), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
1907
1906
|
icon: true,
|
|
1908
1907
|
[`icon-${this.size}`]: this.size !== 'inline'
|
|
1909
1908
|
} }));
|