Archived
Template
1
Fork 0
This repository has been archived on 2024-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
Contour/public/@shoelace-style/shoelace/cdn/chunks/chunk.ZL53POKZ.js
2024-01-30 10:59:28 -05:00

44 lines
1,004 B
JavaScript

import {
library_default_default
} from "./chunk.P7ZG6EMR.js";
import {
library_system_default
} from "./chunk.3TFKS637.js";
// src/components/icon/library.ts
var registry = [library_default_default, library_system_default];
var watchedIcons = [];
function watchIcon(icon) {
watchedIcons.push(icon);
}
function unwatchIcon(icon) {
watchedIcons = watchedIcons.filter((el) => el !== icon);
}
function getIconLibrary(name) {
return registry.find((lib) => lib.name === name);
}
function registerIconLibrary(name, options) {
unregisterIconLibrary(name);
registry.push({
name,
resolver: options.resolver,
mutator: options.mutator,
spriteSheet: options.spriteSheet
});
watchedIcons.forEach((icon) => {
if (icon.library === name) {
icon.setIcon();
}
});
}
function unregisterIconLibrary(name) {
registry = registry.filter((lib) => lib.name !== name);
}
export {
watchIcon,
unwatchIcon,
getIconLibrary,
registerIconLibrary,
unregisterIconLibrary
};