2021-04-23 20:50:17 +00:00
|
|
|
import React from 'react';
|
2021-05-24 10:25:02 +00:00
|
|
|
import type { IconifyJSON, IconifyIcon } from '@iconify/types';
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
// Core
|
2021-09-27 14:28:42 +00:00
|
|
|
import type { IconifyIconName } from '@iconify/utils/lib/icon/name';
|
|
|
|
import { stringToIcon } from '@iconify/utils/lib/icon/name';
|
2021-04-23 20:50:17 +00:00
|
|
|
import type {
|
2021-04-24 11:49:37 +00:00
|
|
|
IconifyIconSize,
|
2021-04-23 20:50:17 +00:00
|
|
|
IconifyHorizontalIconAlignment,
|
|
|
|
IconifyVerticalIconAlignment,
|
2021-05-24 10:25:02 +00:00
|
|
|
} from '@iconify/utils/lib/customisations';
|
2021-09-25 08:43:00 +00:00
|
|
|
import type { IconifyStorageFunctions } from '@iconify/core/lib/storage/functions';
|
2021-04-24 11:49:37 +00:00
|
|
|
import {
|
2021-09-25 08:43:00 +00:00
|
|
|
iconExists,
|
|
|
|
getIcon,
|
|
|
|
addIcon,
|
|
|
|
addCollection,
|
2021-04-24 11:49:37 +00:00
|
|
|
getIconData,
|
|
|
|
allowSimpleNames,
|
|
|
|
} from '@iconify/core/lib/storage/functions';
|
2022-01-09 08:21:53 +00:00
|
|
|
import { listIcons, shareStorage } from '@iconify/core/lib/storage/storage';
|
2021-09-25 08:43:00 +00:00
|
|
|
import type { IconifyBuilderFunctions } from '@iconify/core/lib/builder/functions';
|
|
|
|
import { buildIcon } from '@iconify/core/lib/builder/functions';
|
|
|
|
import { replaceIDs } from '@iconify/utils/lib/svg/id';
|
|
|
|
import { calculateSize } from '@iconify/utils/lib/svg/size';
|
2021-05-24 14:02:00 +00:00
|
|
|
import type { IconifyIconBuildResult } from '@iconify/utils/lib/svg/build';
|
2021-05-24 10:25:02 +00:00
|
|
|
import { fullIcon } from '@iconify/utils/lib/icon';
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
// API
|
2021-09-25 08:43:00 +00:00
|
|
|
import type {
|
2021-04-24 11:49:37 +00:00
|
|
|
IconifyAPIFunctions,
|
|
|
|
IconifyAPIInternalFunctions,
|
2021-09-01 08:34:58 +00:00
|
|
|
IconifyAPIQueryParams,
|
|
|
|
IconifyAPICustomQueryParams,
|
|
|
|
IconifyAPIMergeQueryParams,
|
2021-04-24 11:49:37 +00:00
|
|
|
} from '@iconify/core/lib/api/functions';
|
2021-09-25 08:43:00 +00:00
|
|
|
import type {
|
2021-04-24 11:49:37 +00:00
|
|
|
IconifyAPIModule,
|
|
|
|
IconifyAPISendQuery,
|
2021-09-01 08:34:58 +00:00
|
|
|
IconifyAPIPrepareIconsQuery,
|
2021-04-24 11:49:37 +00:00
|
|
|
} from '@iconify/core/lib/api/modules';
|
2021-09-25 08:43:00 +00:00
|
|
|
import { setAPIModule } from '@iconify/core/lib/api/modules';
|
|
|
|
import type {
|
2021-04-24 11:49:37 +00:00
|
|
|
PartialIconifyAPIConfig,
|
|
|
|
IconifyAPIConfig,
|
|
|
|
GetAPIConfig,
|
|
|
|
} from '@iconify/core/lib/api/config';
|
2021-09-25 08:43:00 +00:00
|
|
|
import {
|
|
|
|
addAPIProvider,
|
|
|
|
getAPIConfig,
|
|
|
|
listAPIProviders,
|
|
|
|
} from '@iconify/core/lib/api/config';
|
|
|
|
import { fetchAPIModule, setFetch } from '@iconify/core/lib/api/modules/fetch';
|
2021-04-24 11:49:37 +00:00
|
|
|
import type {
|
|
|
|
IconifyIconLoaderCallback,
|
|
|
|
IconifyIconLoaderAbort,
|
2021-09-05 16:09:25 +00:00
|
|
|
} from '@iconify/core/lib/api/icons';
|
2021-09-25 08:43:00 +00:00
|
|
|
import { loadIcons } from '@iconify/core/lib/api/icons';
|
|
|
|
import { sendAPIQuery } from '@iconify/core/lib/api/query';
|
|
|
|
import { mergeParams } from '@iconify/core/lib/api/params';
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
// Cache
|
2021-09-05 16:09:25 +00:00
|
|
|
import { cache } from '@iconify/core/lib/cache';
|
2021-04-24 11:49:37 +00:00
|
|
|
import { storeCache, loadCache } from '@iconify/core/lib/browser-storage';
|
|
|
|
import { toggleBrowserCache } from '@iconify/core/lib/browser-storage/functions';
|
|
|
|
import type {
|
|
|
|
IconifyBrowserCacheType,
|
|
|
|
IconifyBrowserCacheFunctions,
|
|
|
|
} from '@iconify/core/lib/browser-storage/functions';
|
|
|
|
|
|
|
|
// Properties
|
2021-04-23 20:50:17 +00:00
|
|
|
import type {
|
2021-05-11 20:27:13 +00:00
|
|
|
RawIconCustomisations,
|
|
|
|
IconifyIconOnLoad,
|
2021-04-23 20:50:17 +00:00
|
|
|
IconifyIconCustomisations,
|
|
|
|
IconifyIconProps,
|
|
|
|
IconProps,
|
|
|
|
IconRef,
|
|
|
|
} from './props';
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
// Render SVG
|
2021-04-23 20:50:17 +00:00
|
|
|
import { render } from './render';
|
|
|
|
|
|
|
|
/**
|
2021-04-24 11:49:37 +00:00
|
|
|
* Export required types
|
2021-04-23 20:50:17 +00:00
|
|
|
*/
|
2021-04-24 11:49:37 +00:00
|
|
|
// Function sets
|
|
|
|
export {
|
|
|
|
IconifyStorageFunctions,
|
|
|
|
IconifyBuilderFunctions,
|
|
|
|
IconifyBrowserCacheFunctions,
|
|
|
|
IconifyAPIFunctions,
|
|
|
|
IconifyAPIInternalFunctions,
|
|
|
|
};
|
2021-04-23 20:50:17 +00:00
|
|
|
|
2021-04-24 11:49:37 +00:00
|
|
|
// JSON stuff
|
|
|
|
export { IconifyIcon, IconifyJSON, IconifyIconName };
|
|
|
|
|
2021-05-11 20:27:13 +00:00
|
|
|
// Customisations and icon props
|
2021-04-23 20:50:17 +00:00
|
|
|
export {
|
2021-04-24 11:49:37 +00:00
|
|
|
IconifyIconCustomisations,
|
|
|
|
IconifyIconSize,
|
2021-04-23 20:50:17 +00:00
|
|
|
IconifyHorizontalIconAlignment,
|
|
|
|
IconifyVerticalIconAlignment,
|
2021-04-24 11:49:37 +00:00
|
|
|
IconifyIconProps,
|
|
|
|
IconProps,
|
2021-05-11 20:27:13 +00:00
|
|
|
IconifyIconOnLoad,
|
2021-04-23 20:50:17 +00:00
|
|
|
};
|
|
|
|
|
2021-04-24 11:49:37 +00:00
|
|
|
// API
|
|
|
|
export {
|
|
|
|
IconifyAPIConfig,
|
|
|
|
IconifyIconLoaderCallback,
|
|
|
|
IconifyIconLoaderAbort,
|
|
|
|
IconifyAPIModule,
|
|
|
|
GetAPIConfig,
|
2021-09-01 08:34:58 +00:00
|
|
|
IconifyAPIPrepareIconsQuery,
|
2021-04-24 11:49:37 +00:00
|
|
|
IconifyAPISendQuery,
|
2021-05-01 20:39:56 +00:00
|
|
|
PartialIconifyAPIConfig,
|
2021-09-01 08:34:58 +00:00
|
|
|
IconifyAPIQueryParams,
|
|
|
|
IconifyAPICustomQueryParams,
|
|
|
|
IconifyAPIMergeQueryParams,
|
2021-04-24 11:49:37 +00:00
|
|
|
};
|
|
|
|
|
2021-05-11 20:27:13 +00:00
|
|
|
// Builder functions
|
|
|
|
export { RawIconCustomisations, IconifyIconBuildResult };
|
|
|
|
|
2021-04-24 11:49:37 +00:00
|
|
|
/* Browser cache */
|
|
|
|
export { IconifyBrowserCacheType };
|
|
|
|
|
|
|
|
/**
|
2021-09-25 08:43:00 +00:00
|
|
|
* Enable cache
|
2021-04-24 11:49:37 +00:00
|
|
|
*/
|
2021-09-25 08:43:00 +00:00
|
|
|
function enableCache(storage: IconifyBrowserCacheType): void {
|
2021-04-24 11:49:37 +00:00
|
|
|
toggleBrowserCache(storage, true);
|
2021-09-25 08:43:00 +00:00
|
|
|
}
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
/**
|
2021-09-25 08:43:00 +00:00
|
|
|
* Disable cache
|
2021-04-24 11:49:37 +00:00
|
|
|
*/
|
2021-09-25 08:43:00 +00:00
|
|
|
function disableCache(storage: IconifyBrowserCacheType): void {
|
|
|
|
toggleBrowserCache(storage, false);
|
|
|
|
}
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialise stuff
|
|
|
|
*/
|
|
|
|
// Enable short names
|
|
|
|
allowSimpleNames(true);
|
|
|
|
|
2021-09-05 16:09:25 +00:00
|
|
|
// Set API module
|
2021-09-25 08:43:00 +00:00
|
|
|
setAPIModule('', fetchAPIModule);
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Browser stuff
|
|
|
|
*/
|
|
|
|
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
|
|
|
// Set cache and load existing cache
|
2021-09-05 16:09:25 +00:00
|
|
|
cache.store = storeCache;
|
2021-04-24 11:49:37 +00:00
|
|
|
loadCache();
|
|
|
|
|
2021-05-13 19:33:33 +00:00
|
|
|
interface WindowWithIconifyStuff {
|
|
|
|
IconifyPreload?: IconifyJSON[] | IconifyJSON;
|
|
|
|
IconifyProviders?: Record<string, PartialIconifyAPIConfig>;
|
|
|
|
}
|
|
|
|
const _window = window as WindowWithIconifyStuff;
|
2021-04-24 11:49:37 +00:00
|
|
|
|
|
|
|
// Load icons from global "IconifyPreload"
|
2021-05-13 19:33:33 +00:00
|
|
|
if (_window.IconifyPreload !== void 0) {
|
|
|
|
const preload = _window.IconifyPreload;
|
2021-04-24 11:49:37 +00:00
|
|
|
const err = 'Invalid IconifyPreload syntax.';
|
|
|
|
if (typeof preload === 'object' && preload !== null) {
|
|
|
|
(preload instanceof Array ? preload : [preload]).forEach((item) => {
|
|
|
|
try {
|
|
|
|
if (
|
|
|
|
// Check if item is an object and not null/array
|
|
|
|
typeof item !== 'object' ||
|
|
|
|
item === null ||
|
|
|
|
item instanceof Array ||
|
|
|
|
// Check for 'icons' and 'prefix'
|
|
|
|
typeof item.icons !== 'object' ||
|
|
|
|
typeof item.prefix !== 'string' ||
|
|
|
|
// Add icon set
|
|
|
|
!addCollection(item)
|
|
|
|
) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set API from global "IconifyProviders"
|
2021-05-13 19:33:33 +00:00
|
|
|
if (_window.IconifyProviders !== void 0) {
|
|
|
|
const providers = _window.IconifyProviders;
|
2021-04-24 11:49:37 +00:00
|
|
|
if (typeof providers === 'object' && providers !== null) {
|
|
|
|
for (let key in providers) {
|
|
|
|
const err = 'IconifyProviders[' + key + '] is invalid.';
|
|
|
|
try {
|
|
|
|
const value = providers[key];
|
|
|
|
if (
|
|
|
|
typeof value !== 'object' ||
|
|
|
|
!value ||
|
|
|
|
value.resources === void 0
|
|
|
|
) {
|
|
|
|
continue;
|
|
|
|
}
|
2021-09-25 08:43:00 +00:00
|
|
|
if (!addAPIProvider(key, value)) {
|
2021-04-24 11:49:37 +00:00
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component
|
2021-04-23 20:50:17 +00:00
|
|
|
*/
|
2021-04-27 16:21:35 +00:00
|
|
|
interface InternalIconProps extends IconProps {
|
|
|
|
_ref?: IconRef;
|
|
|
|
_inline: boolean;
|
|
|
|
}
|
|
|
|
|
2021-05-13 12:46:50 +00:00
|
|
|
interface IconComponentData {
|
|
|
|
data: Required<IconifyIcon>;
|
|
|
|
classes?: string[];
|
|
|
|
}
|
2021-04-27 16:21:35 +00:00
|
|
|
|
|
|
|
interface IconComponentState {
|
2021-05-13 12:46:50 +00:00
|
|
|
icon: IconComponentData | null;
|
2021-04-27 16:21:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ComponentAbortData {
|
|
|
|
name: string;
|
|
|
|
abort: IconifyIconLoaderAbort;
|
|
|
|
}
|
|
|
|
|
|
|
|
class IconComponent extends React.Component<
|
|
|
|
InternalIconProps,
|
|
|
|
IconComponentState
|
|
|
|
> {
|
|
|
|
protected _icon: string;
|
|
|
|
protected _loading: ComponentAbortData | null;
|
|
|
|
|
|
|
|
constructor(props: InternalIconProps) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
// Render placeholder before component is mounted
|
2021-05-13 12:46:50 +00:00
|
|
|
icon: null,
|
2021-04-27 16:21:35 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Abort loading icon
|
|
|
|
*/
|
|
|
|
_abortLoading() {
|
|
|
|
if (this._loading) {
|
|
|
|
this._loading.abort();
|
|
|
|
this._loading = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update state
|
|
|
|
*/
|
2021-05-13 12:46:50 +00:00
|
|
|
_setData(icon: IconComponentData | null) {
|
|
|
|
if (this.state.icon !== icon) {
|
2021-04-27 16:21:35 +00:00
|
|
|
this.setState({
|
2021-05-13 12:46:50 +00:00
|
|
|
icon,
|
2021-04-27 16:21:35 +00:00
|
|
|
});
|
|
|
|
}
|
2021-04-23 20:50:17 +00:00
|
|
|
}
|
|
|
|
|
2021-04-27 16:21:35 +00:00
|
|
|
/**
|
|
|
|
* Check if icon should be loaded
|
|
|
|
*/
|
|
|
|
_checkIcon(changed: boolean) {
|
|
|
|
const state = this.state;
|
|
|
|
const icon = this.props.icon;
|
|
|
|
|
|
|
|
// Icon is an object
|
2021-05-01 20:39:56 +00:00
|
|
|
if (
|
|
|
|
typeof icon === 'object' &&
|
|
|
|
icon !== null &&
|
|
|
|
typeof icon.body === 'string'
|
|
|
|
) {
|
2021-04-27 16:21:35 +00:00
|
|
|
// Stop loading
|
|
|
|
this._icon = '';
|
|
|
|
this._abortLoading();
|
|
|
|
|
2021-05-13 12:46:50 +00:00
|
|
|
if (changed || state.icon === null) {
|
2021-04-27 16:21:35 +00:00
|
|
|
// Set data if it was changed
|
2021-05-13 12:46:50 +00:00
|
|
|
this._setData({
|
|
|
|
data: fullIcon(icon),
|
|
|
|
});
|
2021-04-27 16:21:35 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Invalid icon?
|
2021-05-13 12:46:50 +00:00
|
|
|
let iconName: IconifyIconName | null;
|
|
|
|
if (
|
|
|
|
typeof icon !== 'string' ||
|
|
|
|
(iconName = stringToIcon(icon, false, true)) === null
|
|
|
|
) {
|
2021-04-27 16:21:35 +00:00
|
|
|
this._abortLoading();
|
|
|
|
this._setData(null);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load icon
|
2021-05-13 12:46:50 +00:00
|
|
|
const data = getIconData(iconName);
|
2021-04-27 16:21:35 +00:00
|
|
|
if (data === null) {
|
|
|
|
// Icon needs to be loaded
|
|
|
|
if (!this._loading || this._loading.name !== icon) {
|
|
|
|
// New icon to load
|
|
|
|
this._abortLoading();
|
|
|
|
this._icon = '';
|
|
|
|
this._setData(null);
|
|
|
|
this._loading = {
|
|
|
|
name: icon,
|
2021-09-05 16:09:25 +00:00
|
|
|
abort: loadIcons(
|
2021-05-13 12:46:50 +00:00
|
|
|
[iconName],
|
2021-04-27 16:21:35 +00:00
|
|
|
this._checkIcon.bind(this, false)
|
|
|
|
),
|
|
|
|
};
|
2021-04-24 11:49:37 +00:00
|
|
|
}
|
2021-04-27 16:21:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Icon data is available
|
2021-05-13 12:46:50 +00:00
|
|
|
if (this._icon !== icon || state.icon === null) {
|
2021-04-27 16:21:35 +00:00
|
|
|
// New icon or icon has been loaded
|
|
|
|
this._abortLoading();
|
|
|
|
this._icon = icon;
|
2021-05-13 12:46:50 +00:00
|
|
|
|
|
|
|
// Add classes
|
|
|
|
const classes: string[] = ['iconify'];
|
|
|
|
if (iconName.prefix !== '') {
|
|
|
|
classes.push('iconify--' + iconName.prefix);
|
|
|
|
}
|
|
|
|
if (iconName.provider !== '') {
|
|
|
|
classes.push('iconify--' + iconName.provider);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set data
|
|
|
|
this._setData({
|
|
|
|
data,
|
|
|
|
classes,
|
|
|
|
});
|
2021-05-11 20:27:13 +00:00
|
|
|
if (this.props.onLoad) {
|
|
|
|
this.props.onLoad(icon);
|
|
|
|
}
|
2021-04-27 16:21:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component mounted
|
|
|
|
*/
|
|
|
|
componentDidMount() {
|
|
|
|
this._checkIcon(false);
|
|
|
|
}
|
2021-04-24 11:49:37 +00:00
|
|
|
|
2021-04-27 16:21:35 +00:00
|
|
|
/**
|
|
|
|
* Component updated
|
|
|
|
*/
|
|
|
|
componentDidUpdate(oldProps) {
|
|
|
|
if (oldProps.icon !== this.props.icon) {
|
|
|
|
this._checkIcon(true);
|
2021-04-24 11:49:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-27 16:21:35 +00:00
|
|
|
/**
|
|
|
|
* Abort loading
|
|
|
|
*/
|
|
|
|
componentWillUnmount() {
|
|
|
|
this._abortLoading();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Render
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
const props = this.props;
|
2021-05-13 12:46:50 +00:00
|
|
|
const icon = this.state.icon;
|
2021-04-27 16:21:35 +00:00
|
|
|
|
2021-05-13 12:46:50 +00:00
|
|
|
if (icon === null) {
|
2021-04-27 16:21:35 +00:00
|
|
|
// Render placeholder
|
|
|
|
return props.children
|
|
|
|
? (props.children as JSX.Element)
|
|
|
|
: React.createElement('span', {});
|
|
|
|
}
|
|
|
|
|
2021-05-13 12:46:50 +00:00
|
|
|
// Add classes
|
|
|
|
let newProps = props;
|
|
|
|
if (icon.classes) {
|
2021-05-24 10:25:02 +00:00
|
|
|
newProps = {
|
|
|
|
...props,
|
2021-05-13 12:46:50 +00:00
|
|
|
className:
|
|
|
|
(typeof props.className === 'string'
|
|
|
|
? props.className + ' '
|
|
|
|
: '') + icon.classes.join(' '),
|
2021-05-24 10:25:02 +00:00
|
|
|
};
|
2021-05-13 12:46:50 +00:00
|
|
|
}
|
|
|
|
|
2021-04-27 16:21:35 +00:00
|
|
|
// Render icon
|
2021-05-13 12:46:50 +00:00
|
|
|
return render(icon.data, newProps, props._inline, props._ref);
|
2021-04-27 16:21:35 +00:00
|
|
|
}
|
2021-04-23 20:50:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Block icon
|
|
|
|
*
|
|
|
|
* @param props - Component properties
|
|
|
|
*/
|
2021-08-16 07:55:28 +00:00
|
|
|
export const Icon = React.forwardRef<IconRef, IconProps>(function Icon(
|
|
|
|
props,
|
|
|
|
ref
|
|
|
|
) {
|
|
|
|
const newProps = {
|
|
|
|
...props,
|
|
|
|
_ref: ref,
|
|
|
|
_inline: false,
|
|
|
|
};
|
|
|
|
return React.createElement(IconComponent, newProps);
|
|
|
|
});
|
2021-04-23 20:50:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Inline icon (has negative verticalAlign that makes it behave like icon font)
|
|
|
|
*
|
|
|
|
* @param props - Component properties
|
|
|
|
*/
|
2021-08-16 07:55:28 +00:00
|
|
|
export const InlineIcon = React.forwardRef<IconRef, IconProps>(
|
|
|
|
function InlineIcon(props, ref) {
|
2021-05-24 10:25:02 +00:00
|
|
|
const newProps = { ...props, _ref: ref, _inline: true };
|
2021-04-27 16:21:35 +00:00
|
|
|
return React.createElement(IconComponent, newProps);
|
|
|
|
}
|
2021-04-23 20:50:17 +00:00
|
|
|
);
|
2021-09-25 08:43:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal API
|
|
|
|
*/
|
|
|
|
const _api: IconifyAPIInternalFunctions = {
|
|
|
|
getAPIConfig,
|
|
|
|
setAPIModule,
|
|
|
|
sendAPIQuery,
|
|
|
|
setFetch,
|
|
|
|
listAPIProviders,
|
|
|
|
mergeParams,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Export functions
|
|
|
|
*/
|
|
|
|
// IconifyAPIInternalFunctions
|
|
|
|
export { _api };
|
|
|
|
|
|
|
|
// IconifyAPIFunctions
|
|
|
|
export { addAPIProvider, loadIcons };
|
|
|
|
|
|
|
|
// IconifyStorageFunctions
|
2022-01-09 08:21:53 +00:00
|
|
|
export { iconExists, getIcon, listIcons, addIcon, addCollection, shareStorage };
|
2021-09-25 08:43:00 +00:00
|
|
|
|
|
|
|
// IconifyBuilderFunctions
|
|
|
|
export { replaceIDs, calculateSize, buildIcon };
|
|
|
|
|
|
|
|
// IconifyBrowserCacheFunctions
|
|
|
|
export { enableCache, disableCache };
|